From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755260Ab2EGCgF (ORCPT ); Sun, 6 May 2012 22:36:05 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:55907 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754894Ab2EGCgD (ORCPT ); Sun, 6 May 2012 22:36:03 -0400 X-AuditID: cbfee61b-b7c60ae000000c58-75-4fa73511c71c Message-id: <4FA73510.7070705@samsung.com> Date: Mon, 07 May 2012 11:36:00 +0900 From: Minho Ban User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-version: 1.0 To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Frederic Weisbecker , Peter Zijlstra , Paul Turner , Thomas Gleixner , Hidetoshi Seto , "Paul E. McKenney" , Josh Triplett Subject: [PATCH] tracing: Prevent wasting time evaluating parameters in trace_preempt_on/off Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This fixes spending time for evaluating parameters in trace_preempt_on/off when the tracer config is off. The patch mainly inspired by Steven Rostedt, thanks Steven. Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Paul Turner Cc: Thomas Gleixner Cc: Hidetoshi Seto Cc: Paul E. McKenney Cc: Josh Triplett Signed-off-by: Minho Ban Acked-by: Steven Rostedt --- include/linux/ftrace.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 72a6cab..bc7af66 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -485,8 +485,12 @@ static inline void __ftrace_enabled_restore(int enabled) extern void trace_preempt_on(unsigned long a0, unsigned long a1); extern void trace_preempt_off(unsigned long a0, unsigned long a1); #else - static inline void trace_preempt_on(unsigned long a0, unsigned long a1) { } - static inline void trace_preempt_off(unsigned long a0, unsigned long a1) { } +/* + * Use defines instead of static inlines because some arches will make code out + * of the CALLER_ADDR, when we really want these to be a real nop. + */ +# define trace_preempt_on(a0, a1) do { } while (0) +# define trace_preempt_off(a0, a1) do { } while (0) #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD -- 1.7.5.4