From patchwork Fri Aug 8 14:32:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 35131 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2D84721457 for ; Fri, 8 Aug 2014 14:37:46 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf36531271pab.8 for ; Fri, 08 Aug 2014 07:37:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:user-agent:date:from:to :cc:subject:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-disposition; bh=WwfXHP9rJEw1LPXHCoWlXE9BGYZMDTwthnyg1RNnO3M=; b=AXDrKuI8Bk0JakUfTtgZHeL+f0cEjtyb7WVbNcvjj+EPLJgUAUn4RYcpR0av0W/tfm TrSUSemkPvtuswHLY9Zriuzv+awWOqKlpSSCp+UiHKDgnZxdyZAn/YEhVqt+Rcfrs5+x lLXO8koh2dyAczyW77cYT0xtqG282LZveWnWLXidsEQCpr2/iPhfnJX2asJfXXJrdqEh OL9cl/Ls0kio6QxRJ1w7wQ3Y7oFptsDJjihjK+rERfFo/UZ4jA7SX7NIBfnl0LLRlq5M eUqWMAu37cF2aru5DlzenDFWlydcSkz4qWa09BnxgPJGGoecWRHSbm8ekUwPELvM5pT9 QPNA== X-Gm-Message-State: ALoCoQl80WX64QmKET9U5MGFo7hiVlrSHXJQdHhh9NDKK16oJD9W7hLbnLez60uYJJ8dbvlnkp6f X-Received: by 10.67.23.197 with SMTP id ic5mr12730951pad.24.1407508665478; Fri, 08 Aug 2014 07:37:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.240 with SMTP id 103ls498499qgn.28.gmail; Fri, 08 Aug 2014 07:37:45 -0700 (PDT) X-Received: by 10.221.36.3 with SMTP id sy3mr547642vcb.67.1407508665338; Fri, 08 Aug 2014 07:37:45 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id f18si2952066veh.12.2014.08.08.07.37.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 07:37:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so8364247vcb.39 for ; Fri, 08 Aug 2014 07:37:45 -0700 (PDT) X-Received: by 10.52.144.14 with SMTP id si14mr174203vdb.95.1407508665151; Fri, 08 Aug 2014 07:37:45 -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 tc5csp128231vcb; Fri, 8 Aug 2014 07:37:44 -0700 (PDT) X-Received: by 10.68.231.138 with SMTP id tg10mr24657958pbc.72.1407508662716; Fri, 08 Aug 2014 07:37:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si2643916pdn.83.2014.08.08.07.37.42 for ; Fri, 08 Aug 2014 07:37:42 -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 S1757078AbaHHOh1 (ORCPT + 26 others); Fri, 8 Aug 2014 10:37:27 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.226]:33154 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756980AbaHHOhO (ORCPT ); Fri, 8 Aug 2014 10:37:14 -0400 Received: from [67.246.153.56] ([67.246.153.56:52858] helo=gandalf.local.home) by cdptpa-oedge02 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 33/34-18071-690E4E35; Fri, 08 Aug 2014 14:37:10 +0000 Received: from rostedt by gandalf.local.home with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XFlI6-00086U-4H; Fri, 08 Aug 2014 10:37:10 -0400 Message-Id: <20140808143710.037645264@goodmis.org> User-Agent: quilt/0.61-1 Date: Fri, 08 Aug 2014 10:32:56 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Ingo Molnar , Andrew Morton , Nicolas Pitre , Will Deacon , Catalin Marinas , Russell King - ARM Linux , Daniel Lezcano Subject: [PATCH 2/4] tracepoint: add generic tracepoint definitions for IPI tracing References: <20140808143254.145903999@goodmis.org> MIME-Version: 1.0 X-RR-Connecting-IP: 107.14.168.130:25 X-Cloudmark-Score: 0 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: rostedt@goodmis.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.180 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-Disposition: inline; filename=0002-tracepoint-add-generic-tracepoint-definitions-for-IP.patch From: Nicolas Pitre 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. Link: http://lkml.kernel.org/p/1406318733-26754-3-git-send-email-nicolas.pitre@linaro.org Acked-by: Daniel Lezcano Signed-off-by: Nicolas Pitre Signed-off-by: Steven Rostedt --- 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 000000000000..834a7362a610 --- /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