From patchwork Fri Jul 25 20:05:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 34316 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E2F5235AB for ; Fri, 25 Jul 2014 20:07:50 +0000 (UTC) Received: by mail-oi0-f69.google.com with SMTP id h136sf19291893oig.8 for ; Fri, 25 Jul 2014 13:07:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe :content-transfer-encoding; bh=WhMIELzCq1Y4RsUPZiN1k1aU1YzLtG38ZqXlkdFubPI=; b=Qpm6anLq6/jzzim+kZKKLCY0cWgCU+NfZHQ4iNhgaCpNIHbqxqaS4UNXO+UQOdB+yi fgs+GO/HxlPdzMWEqUlEbBp/R3J7jgi6HGa2Jz4ja0KAkhk0FJGY8o//Faly+wDGcNf4 Z/0ulasOwC8KjdRwdF1SNn7TAhs6TrbvJRhd+4J0FMbZaNb8IBEoFlHuy1jtxHHxhWdA 6iL11ZkeANNpa2ayiZ5bjkCHNtihSJe3bMDDgWBmjeJxolguJl4X9Xr6v9ZJMdHHPJk/ 7UWD3SQqqF2QACSORC04+ClsS8Pn2/K6y+WV+f2kSfxTGlCj0UJD2OI8rbh8Wq9hN1cq U3NA== X-Gm-Message-State: ALoCoQl1oqt4MMxS+K4DKw64lSX6xZUmY0zQrRhC9lHIEEWEMJqCOreQrAtpL5ELyKkg0o3xLURW X-Received: by 10.182.63.80 with SMTP id e16mr9474572obs.33.1406318870225; Fri, 25 Jul 2014 13:07:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.148 with SMTP id 20ls848594qgp.86.gmail; Fri, 25 Jul 2014 13:07:50 -0700 (PDT) X-Received: by 10.220.190.197 with SMTP id dj5mr23769418vcb.19.1406318870116; Fri, 25 Jul 2014 13:07:50 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id g14si8241438vdh.66.2014.07.25.13.07.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 13:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so8247905vcb.13 for ; Fri, 25 Jul 2014 13:07:50 -0700 (PDT) X-Received: by 10.221.34.13 with SMTP id sq13mr24227770vcb.16.1406318869996; Fri, 25 Jul 2014 13:07:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp63013vcb; Fri, 25 Jul 2014 13:07:49 -0700 (PDT) X-Received: by 10.70.34.39 with SMTP id w7mr21274979pdi.19.1406318868988; Fri, 25 Jul 2014 13:07:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si10239173pat.130.2014.07.25.13.07.48 for ; Fri, 25 Jul 2014 13:07:48 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935290AbaGYUHj (ORCPT + 16 others); Fri, 25 Jul 2014 16:07:39 -0400 Received: from relais.videotron.ca ([24.201.245.36]:13726 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932080AbaGYUHg (ORCPT ); Fri, 25 Jul 2014 16:07:36 -0400 Received: from yoda.home ([66.130.143.177]) by VL-VM-MR003.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N9A0061LAKLBQ90@VL-VM-MR003.ip.videotron.ca> for linux-kernel@vger.kernel.org; Fri, 25 Jul 2014 16:07:33 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 6DCE92DA0907; Fri, 25 Jul 2014 16:07:33 -0400 (EDT) From: Nicolas Pitre To: Steven Rostedt , Ingo Molnar Cc: Daniel Lezcano , Russell King - ARM Linux , Catalin Marinas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org Subject: [PATCH v2 2/5] tracepoint: add generic tracepoint definitions for IPI tracing Date: Fri, 25 Jul 2014 16:05:30 -0400 Message-id: <1406318733-26754-3-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.4.108.g55ea5f6 In-reply-to: <1406318733-26754-1-git-send-email-nicolas.pitre@linaro.org> References: <1406318733-26754-1-git-send-email-nicolas.pitre@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-transfer-encoding: 7BIT The Inter Processor Interrupt is used to make another processor do a specific action such as rescheduling tasks, signal a timer event or execute something in another CPU's context. IRQs are already traceable but IPIs were not. Tracing them is useful for monitoring IPI latency, or to verify when they are the source of CPU wake-ups with power management implications. Three trace hooks are defined: ipi_raise, ipi_entry and ipi_exit. To make them portable, a string is used to identify them and correlate related events. Additionally, ipi_raise records a bitmask representing targeted CPUs. Signed-off-by: Nicolas Pitre Acked-by: Steven Rostedt Acked-by: Daniel Lezcano --- include/trace/events/ipi.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 include/trace/events/ipi.h diff --git a/include/trace/events/ipi.h b/include/trace/events/ipi.h new file mode 100644 index 0000000000..834a7362a6 --- /dev/null +++ b/include/trace/events/ipi.h @@ -0,0 +1,89 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM ipi + +#if !defined(_TRACE_IPI_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_IPI_H + +#include + +/** + * ipi_raise - called when a smp cross call is made + * + * @mask: mask of recipient CPUs for the IPI + * @reason: string identifying the IPI purpose + * + * It is necessary for @reason to be a static string declared with + * __tracepoint_string. + */ +TRACE_EVENT(ipi_raise, + + TP_PROTO(const struct cpumask *mask, const char *reason), + + TP_ARGS(mask, reason), + + TP_STRUCT__entry( + __bitmask(target_cpus, nr_cpumask_bits) + __field(const char *, reason) + ), + + TP_fast_assign( + __assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits); + __entry->reason = reason; + ), + + TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason) +); + +DECLARE_EVENT_CLASS(ipi_handler, + + TP_PROTO(const char *reason), + + TP_ARGS(reason), + + TP_STRUCT__entry( + __field(const char *, reason) + ), + + TP_fast_assign( + __entry->reason = reason; + ), + + TP_printk("(%s)", __entry->reason) +); + +/** + * ipi_entry - called immediately before the IPI handler + * + * @reason: string identifying the IPI purpose + * + * It is necessary for @reason to be a static string declared with + * __tracepoint_string, ideally the same as used with trace_ipi_raise + * for that IPI. + */ +DEFINE_EVENT(ipi_handler, ipi_entry, + + TP_PROTO(const char *reason), + + TP_ARGS(reason) +); + +/** + * ipi_exit - called immediately after the IPI handler returns + * + * @reason: string identifying the IPI purpose + * + * It is necessary for @reason to be a static string declared with + * __tracepoint_string, ideally the same as used with trace_ipi_raise for + * that IPI. + */ +DEFINE_EVENT(ipi_handler, ipi_exit, + + TP_PROTO(const char *reason), + + TP_ARGS(reason) +); + +#endif /* _TRACE_IPI_H */ + +/* This part must be outside protection */ +#include