From patchwork Fri Jul 18 05:18:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 33816 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1125D20969 for ; Fri, 18 Jul 2014 05:21:48 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id ft15sf22240386pdb.2 for ; Thu, 17 Jul 2014 22:21:48 -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=el/mx1TXc+p2189V1lLL2kBUjXzXsmWLp1rzHy0vgQ4=; b=C8/4cbfFFkkXfB0e2943UrqJQ7o+eSIGyCOb7v3XrNDpgDRGV376pKZfVFhNymkYwj JWSZVtv4Cp9MVZkPsP0Ij+puoyGJyI456N7EQeP6MkCYziDy4glikaNlc5CO4gd+dWRw RYFkaRpRss7zYNrZVrBGcP6eFckB3euiW8ppHKlafvp3YlWztZ7Ju5eegT8sUpnv+78g +JKsM83FLiuR/aKfL8C9PZtb9bPWCvs6aLVAB9t6Y3LFtlMbWQwUwd8Em0EO5h2oepW0 OvQ9/gC763rJOhUe/bGI3hy6vVRRRyaKBQ0rd0fyt4YiksiGspdA7H9bgUQEb4C1bX5p Lzbg== X-Gm-Message-State: ALoCoQnFjRAscxGAliNcnTbqGcPdq4ZT+yWRCO8TxwuBCDaX3i1GrUUSB3OjIhsTIvt+i7k3J29D X-Received: by 10.68.107.33 with SMTP id gz1mr1258703pbb.5.1405660908162; Thu, 17 Jul 2014 22:21:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.198 with SMTP id m64ls871099qge.39.gmail; Thu, 17 Jul 2014 22:21:48 -0700 (PDT) X-Received: by 10.221.69.8 with SMTP id ya8mr1835649vcb.39.1405660908048; Thu, 17 Jul 2014 22:21:48 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id d9si4780341vek.22.2014.07.17.22.21.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jul 2014 22:21:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so6570957vcb.17 for ; Thu, 17 Jul 2014 22:21:48 -0700 (PDT) X-Received: by 10.52.239.6 with SMTP id vo6mr1509186vdc.59.1405660907962; Thu, 17 Jul 2014 22:21:47 -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 tc5csp91946vcb; Thu, 17 Jul 2014 22:21:47 -0700 (PDT) X-Received: by 10.66.139.131 with SMTP id qy3mr2099805pab.130.1405660906988; Thu, 17 Jul 2014 22:21:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ff7si4560833pad.240.2014.07.17.22.21.46; Thu, 17 Jul 2014 22:21:46 -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 S934026AbaGRFVh (ORCPT + 24 others); Fri, 18 Jul 2014 01:21:37 -0400 Received: from relais.videotron.ca ([24.201.245.36]:62580 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760200AbaGRFUe (ORCPT ); Fri, 18 Jul 2014 01:20:34 -0400 Received: from yoda.home ([66.130.143.177]) by VL-VM-MR001.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N8W00MUQ6U90970@VL-VM-MR001.ip.videotron.ca> for linux-kernel@vger.kernel.org; Fri, 18 Jul 2014 01:20:33 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 2116B2DA08B3; Fri, 18 Jul 2014 01:20:33 -0400 (EDT) From: Nicolas Pitre To: Steven Rostedt , Ingo Molnar , Daniel Lezcano , Russell King - ARM Linux , Catalin Marinas Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org Subject: [PATCH 1/4] tracepoint: add generic tracepoint definitions for IPI tracing Date: Fri, 18 Jul 2014 01:18:52 -0400 Message-id: <1405660735-13408-2-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.4.108.g55ea5f6 In-reply-to: <1405660735-13408-1-git-send-email-nicolas.pitre@linaro.org> References: <1405660735-13408-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.172 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: 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