From patchwork Thu Oct 29 19:10:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kirjanov X-Patchwork-Id: 537981 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 616111402DD for ; Fri, 30 Oct 2015 06:11:49 +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=GakdGQ68; 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 348B21A0CAC for ; Fri, 30 Oct 2015 06:11:49 +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=GakdGQ68; 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 B9E751A0BFD for ; Fri, 30 Oct 2015 06:10:28 +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=GakdGQ68; dkim-atps=neutral Received: by ozlabs.org (Postfix) id A3FDB14076E; Fri, 30 Oct 2015 06:10:28 +1100 (AEDT) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 66D971402D2 for ; Fri, 30 Oct 2015 06:10:26 +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=GakdGQ68; dkim-atps=neutral Received: by lfbn126 with SMTP id n126so23275982lfb.2 for ; Thu, 29 Oct 2015 12:10:23 -0700 (PDT) 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=mymxNVFP6LiDByYMEIR++UXwXM0l29g+Fd+aiByplwU=; b=GakdGQ68AkfIaliaGG+LS5Qt9UePtumtbOU3IY/58wPisAhStCQQBrLOjOXzM9VpgX 5DvZEYpJp0raY9n8qlZydjHKF6Xq7vpruCAEcWnrz97DaCMxi0ZTsMfOqS36Z4Z0Xu3Y gidAihhECEGF6yCdOmnz7jyvSaymNITk+0nyj5R7R5Hb41hHioi/rO4Oh/hfZL+wcm15 By7AyJGElbINodRPBX2DZcg2RGk2MzCqCebGiwfP3jl7871Hzl5JLapmY+Ak9qaviGMU Flb/JU75wCk09EX6O7RCdJmaxkLVlJxeU3WM/clFx9UN6Dw2lEQ9W1hDgO7Wj5eocWlS dLeg== 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=mymxNVFP6LiDByYMEIR++UXwXM0l29g+Fd+aiByplwU=; b=GCdLvmjZfYgIlRJ/k3+hIlyg3QO4gSfVUVUekRry/FUGlnamcwfwxC8VS953ILzsEE 6ihUP7Qqv7wQ1E15kAI5LZr/HTZ4Gdwjbh5BvioXk40E8eFZ08pPmesogDHhhc4GK9jj 7AOGC4aqbhDX0rll4HudL3PdCVeMUlSXMkmWL9uvKksSrDiVf1Ihkv+BhX6OjVAO0VHm 6CtlvZdE28vEzLy+KtBHjZegvgneNnOLW0j6Q/noCXgcD5pYHa4/5K9/Bu+l49hzMwee xdjQRwzqxYRTcBWL4PkEBO+aU3vk2fSLJ9ZmbOuVE8DNpH/STePIpb+3u/fcTYejWv/V eZKw== X-Gm-Message-State: ALoCoQnIfQDcY2yI5Fsclvhv/0HNSvjBJH2sBiPv61hRgsECc/Zjw/Z+7mjwXaCL++fmN16uAplo X-Received: by 10.25.20.97 with SMTP id k94mr1208134lfi.27.1446145823000; Thu, 29 Oct 2015 12:10:23 -0700 (PDT) Received: from ps700_1.192.168.0.1 ([5.35.73.89]) by smtp.gmail.com with ESMTPSA id jk6sm565836lbc.36.2015.10.29.12.10.21 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 29 Oct 2015 12:10:22 -0700 (PDT) From: Denis Kirjanov To: linuxppc-dev@ozlabs.org Subject: [PATCH] powerpc: tracing: don't trace hcalls on offline CPUs Date: Thu, 29 Oct 2015 22:10:10 +0300 Message-Id: <1446145810-5383-1-git-send-email-kda@linux-powerpc.org> X-Mailer: git-send-email 2.4.6 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: Denis Kirjanov , "Paul E. McKenney" , Anton Blanchard , Steven Rostedt , linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" ./drmgr -c cpu -a -r gives the following warning: [ 2327.035563] RCU used illegally from offline CPU! rcu_scheduler_active = 1, debug_locks = 1 [ 2327.035564] no locks held by swapper/12/0. [ 2327.035565] stack backtrace: [ 2327.035567] CPU: 12 PID: 0 Comm: swapper/12 Tainted: G S 4.3.0-rc3-00060-g353169a #5 [ 2327.035568] Call Trace: [ 2327.035573] [c0000001d62578e0] [c0000000008977fc] .dump_stack+0x98/0xd4 (unreliable) [ 2327.035577] [c0000001d6257960] [c000000000109bd8] .lockdep_rcu_suspicious+0x108/0x170 [ 2327.035580] [c0000001d62579f0] [c00000000006a1d0] .__trace_hcall_exit+0x2b0/0x2c0 [ 2327.035584] [c0000001d6257ab0] [c00000000006a2e8] plpar_hcall_norets_trace+0x70/0x8c [ 2327.035588] [c0000001d6257b20] [c000000000067a14] .icp_hv_set_cpu_priority+0x54/0xc0 [ 2327.035592] [c0000001d6257ba0] [c000000000066c5c] .xics_teardown_cpu+0x5c/0xa0 [ 2327.035595] [c0000001d6257c20] [c0000000000747ac] .pseries_mach_cpu_die+0x6c/0x320 [ 2327.035598] [c0000001d6257cd0] [c0000000000439cc] .cpu_die+0x3c/0x60 [ 2327.035602] [c0000001d6257d40] [c0000000000183d8] .arch_cpu_idle_dead+0x28/0x40 [ 2327.035606] [c0000001d6257db0] [c0000000000ff1dc] .cpu_startup_entry+0x4fc/0x560 [ 2327.035610] [c0000001d6257ed0] [c000000000043728] .start_secondary+0x328/0x360 [ 2327.035614] [c0000001d6257f90] [c000000000008a6c] start_secondary_prolog+0x10/0x14 [ 2327.035620] cpu 12 (hwid 12) Ready to die... [ 2327.144463] cpu 13 (hwid 13) Ready to die... [ 2327.294180] cpu 14 (hwid 14) Ready to die... [ 2327.403599] cpu 15 (hwid 15) Ready to die... Make the hypervisor tracepoints conditional by introducing TRACE_EVENT_FN_COND similar to TRACE_EVENT_FN Signed-off-by: Denis Kirjanov --- arch/powerpc/include/asm/trace.h | 8 ++++++-- include/linux/tracepoint.h | 4 ++++ include/trace/define_trace.h | 6 ++++++ include/trace/trace_events.h | 6 ++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h index 8e86b48..3dc5803 100644 --- a/arch/powerpc/include/asm/trace.h +++ b/arch/powerpc/include/asm/trace.h @@ -57,12 +57,14 @@ DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit, extern void hcall_tracepoint_regfunc(void); extern void hcall_tracepoint_unregfunc(void); -TRACE_EVENT_FN(hcall_entry, +TRACE_EVENT_FN_COND(hcall_entry, TP_PROTO(unsigned long opcode, unsigned long *args), TP_ARGS(opcode, args), + TP_CONDITION(cpu_online(smp_processor_id())), + TP_STRUCT__entry( __field(unsigned long, opcode) ), @@ -76,13 +78,15 @@ TRACE_EVENT_FN(hcall_entry, hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc ); -TRACE_EVENT_FN(hcall_exit, +TRACE_EVENT_FN_COND(hcall_exit, TP_PROTO(unsigned long opcode, unsigned long retval, unsigned long *retbuf), TP_ARGS(opcode, retval, retbuf), + TP_CONDITION(cpu_online(smp_processor_id())), + TP_STRUCT__entry( __field(unsigned long, opcode) __field(unsigned long, retval) diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index a5f7f3e..be17490 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -468,6 +468,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 09b3880..bfd14e3 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 43be3b0..1ebf1d9 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)