From patchwork Mon Dec 14 20:14:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kirjanov X-Patchwork-Id: 556624 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F1E031401CA for ; Tue, 15 Dec 2015 07:19:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linux-powerpc-org.20150623.gappssmtp.com header.i=@linux-powerpc-org.20150623.gappssmtp.com header.b=ker2JBJY; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id D02F81A0502 for ; Tue, 15 Dec 2015 07:19:43 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linux-powerpc-org.20150623.gappssmtp.com header.i=@linux-powerpc-org.20150623.gappssmtp.com header.b=ker2JBJY; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 61AC41A01B8 for ; Tue, 15 Dec 2015 07:16:48 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linux-powerpc-org.20150623.gappssmtp.com header.i=@linux-powerpc-org.20150623.gappssmtp.com header.b=ker2JBJY; dkim-atps=neutral Received: by ozlabs.org (Postfix) id 4F52014032F; Tue, 15 Dec 2015 07:16:48 +1100 (AEDT) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 71C3814030D for ; Tue, 15 Dec 2015 07:16:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linux-powerpc-org.20150623.gappssmtp.com header.i=@linux-powerpc-org.20150623.gappssmtp.com header.b=ker2JBJY; dkim-atps=neutral Received: by lfed137 with SMTP id d137so78875835lfe.3 for ; Mon, 14 Dec 2015 12:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-powerpc-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=s/dDQ1EPEGi//Y7b9/IvLUAYCsj8JN0YsCBirij+R+8=; b=ker2JBJYe64GD3GbloWWpRQgQme5nz2kaO3NqRTFGUwDkOlAk/gM2DSSq5pPkxdRMm Tf9qSIyTkWEwGZ3f4hkhok57E2dmduYpRrLU5bNLZ9v9vYu+llLfYKl0ZQ4GtJZJSbRV /JPQW1e5au5AlcxVX72Es/DIjImLO8ZeDrFKy9k4AVObH/o3nNLL8ihNiSD/RL/FQT1k tZdTLOTvsmOjnywk6DPjWn5+DEPJ3QcaSGjE/L1tkwyC/1s4ai1COlALfyi544QlY9N1 Vs+urV9eNV1S2CdFyJvrvBlBnWtnTNVO8TMXLHNqybSj2j+hPio+diFIVvlKALB0BNml O8CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=s/dDQ1EPEGi//Y7b9/IvLUAYCsj8JN0YsCBirij+R+8=; b=TYjXdaxMMi0K5oNGmrPHFoncUvAMHiG0Q3vbn/8YHvInDe38kkij7zQ4TgBbOvgi51 yUfV7hzImBFVaFP4o/Ry+EObkYN9QSKCSTqBJqIKg9sXxPGGIk6Jy79bwbeWDZNxFQhV G0/yiOh/fX1tBzb5lCC7UcBNLOWmJEOGFofAsq3yaupLtos6ZnYqrdD7+HS5eYB9xfIz 5LnED1puylE9ull+0BUW6Zr22jJc3cUMqA+PAUVgqRPhvRhAWjUPiCfRPO60kjy8QEBY bRLw+e7PjUjTEZti+olSHyfIT0s124LM8OyyhbxDdak7IPELJP2LzZkC7LgzRhvsA9bY 87ng== X-Gm-Message-State: ALoCoQlaHH5PcCe8We2Wk9pdsIMcgqQd5rm0VFgVnKfLwqV8GdwbdPEPXhuI//NJOBCPawbAtj3MpmgrY+2Mnw8QZ5xo2Pbx6Q== X-Received: by 10.25.167.209 with SMTP id q200mr14791404lfe.15.1450124203743; Mon, 14 Dec 2015 12:16:43 -0800 (PST) Received: from hydra.kdaintranet ([87.228.119.85]) by smtp.gmail.com with ESMTPSA id q8sm5773580lbr.1.2015.12.14.12.16.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Dec 2015 12:16:43 -0800 (PST) From: Denis Kirjanov To: Steven Rostedt , Michael Ellerman Subject: [PATCH v2 1/2] tracing: introduce TRACE_EVENT_FN_COND macro Date: Mon, 14 Dec 2015 23:14:51 +0300 Message-Id: <1450124092-4755-1-git-send-email-kda@linux-powerpc.org> X-Mailer: git-send-email 2.4.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@ozlabs.org, Denis Kirjanov , linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" TRACE_EVENT_FN can't be used in some circumstances like invoking trace functions from offlined CPU due to RCU usage. This patch adds the TRACE_EVENT_FN_COND macro to make such trace points conditional. Signed-off-by: Denis Kirjanov --- include/linux/tracepoint.h | 4 ++++ include/trace/define_trace.h | 6 ++++++ include/trace/trace_events.h | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 696a339c..45b3fcf 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -493,6 +493,10 @@ extern void syscall_unregfunc(void); #define TRACE_EVENT_FN(name, proto, args, struct, \ assign, print, reg, unreg) \ DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) +#define TRACE_EVENT_FN_COND(name, proto, args, cond, struct, \ + assign, print, reg, unreg) \ + DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ + PARAMS(args), PARAMS(cond)) #define TRACE_EVENT_CONDITION(name, proto, args, cond, \ struct, assign, print) \ DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 2d8639e..6e3945f 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h @@ -40,6 +40,11 @@ assign, print, reg, unreg) \ DEFINE_TRACE_FN(name, reg, unreg) +#undef TRACE_EVENT_FN_COND +#define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct, \ + assign, print, reg, unreg) \ + DEFINE_TRACE_FN(name, reg, unreg) + #undef DEFINE_EVENT #define DEFINE_EVENT(template, name, proto, args) \ DEFINE_TRACE(name) @@ -93,6 +98,7 @@ #undef TRACE_EVENT #undef TRACE_EVENT_FN +#undef TRACE_EVENT_FN_COND #undef TRACE_EVENT_CONDITION #undef DECLARE_EVENT_CLASS #undef DEFINE_EVENT diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index de996cf..170c93b 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h @@ -123,6 +123,12 @@ TRACE_MAKE_SYSTEM_STR(); TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ +#undef TRACE_EVENT_FN_COND +#define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct, \ + assign, print, reg, unreg) \ + TRACE_EVENT_CONDITION(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \ + PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ + #undef TRACE_EVENT_FLAGS #define TRACE_EVENT_FLAGS(name, value) \ __TRACE_EVENT_FLAGS(name, value)