From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 6/8] ftrace: change function graph tracer to use new in_nmi
Date: Sun, 08 Feb 2009 00:50:01 -0500 [thread overview]
Message-ID: <20090208055341.660793832@goodmis.org> (raw)
In-Reply-To: 20090208054955.777429253@goodmis.org
[-- Attachment #1: 0006-ftrace-change-function-graph-tracer-to-use-new-in_n.patch --]
[-- Type: text/plain, Size: 2405 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
The function graph tracer piggy backed onto the dynamic ftracer
to use the in_nmi custom code for dynamic tracing. The problem
was (as Andrew Morton pointed out) it really only wanted to bail
out if the context of the current CPU was in NMI context. But the
dynamic ftrace in_nmi custom code was true if _any_ CPU happened
to be in NMI context.
Now that we have a generic in_nmi interface, this patch changes
the function graph code to use it instead of the dynamic ftarce
custom code.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
arch/x86/Kconfig | 2 +-
arch/x86/kernel/ftrace.c | 21 +--------------------
2 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a6be725..2cf7bbc 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -34,7 +34,7 @@ config X86
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
- select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE || FUNCTION_GRAPH_TRACER
+ select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
select HAVE_ARCH_KGDB if !X86_VOYAGER
select HAVE_ARCH_TRACEHOOK
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index e3fad2e..918073c 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -367,25 +367,6 @@ int ftrace_disable_ftrace_graph_caller(void)
return ftrace_mod_jmp(ip, old_offset, new_offset);
}
-#else /* CONFIG_DYNAMIC_FTRACE */
-
-/*
- * These functions are picked from those used on
- * this page for dynamic ftrace. They have been
- * simplified to ignore all traces in NMI context.
- */
-static atomic_t nmi_running;
-
-void arch_ftrace_nmi_enter(void)
-{
- atomic_inc(&nmi_running);
-}
-
-void arch_ftrace_nmi_exit(void)
-{
- atomic_dec(&nmi_running);
-}
-
#endif /* !CONFIG_DYNAMIC_FTRACE */
/* Add a function return address to the trace stack on thread info.*/
@@ -475,7 +456,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
&return_to_handler;
/* Nmi's are currently unsupported */
- if (unlikely(atomic_read(&nmi_running)))
+ if (unlikely(in_nmi()))
return;
if (unlikely(atomic_read(¤t->tracing_graph_pause)))
--
1.5.6.5
--
next prev parent reply other threads:[~2009-02-08 5:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-08 5:49 [PATCH 0/8] git pull request for tip/tracing/core Steven Rostedt
2009-02-08 5:49 ` [PATCH 1/8] trace: remove deprecated entry->cpu Steven Rostedt
2009-02-08 12:29 ` Frederic Weisbecker
2009-02-08 5:49 ` [PATCH 2/8] ring-buffer: add NMI protection for spinlocks Steven Rostedt
2009-02-08 5:49 ` [PATCH 3/8] ring-buffer: allow tracing_off to be used in core kernel code Steven Rostedt
2009-02-08 5:49 ` [PATCH 4/8] ftrace, x86: rename in_nmi variable Steven Rostedt
2009-02-08 5:50 ` [PATCH 5/8] nmi: add generic nmi tracking state Steven Rostedt
2009-02-08 5:50 ` Steven Rostedt [this message]
2009-02-08 5:50 ` [PATCH 7/8] ring-buffer: use generic version of in_nmi Steven Rostedt
2009-02-08 5:50 ` [PATCH 8/8] trace: trivial fixes in comment typos Steven Rostedt
2009-02-09 9:37 ` [PATCH 0/8] git pull request for tip/tracing/core Ingo Molnar
2009-02-11 15:36 ` Ingo Molnar
2009-02-11 15:46 ` Steven Rostedt
2009-02-11 16:25 ` Ingo Molnar
2009-02-11 16:33 ` Steven Rostedt
2009-02-11 16:49 ` Steven Rostedt
2009-02-11 16:59 ` Steven Rostedt
2009-02-11 17:16 ` Ingo Molnar
2009-02-11 17:30 ` Steven Rostedt
2009-02-11 17:31 ` Ingo Molnar
2009-02-11 17:57 ` Luck, Tony
2009-02-11 18:23 ` Steven Rostedt
2009-02-11 18:34 ` Luck, Tony
2009-02-11 18:42 ` Steven Rostedt
2009-02-11 20:20 ` Ingo Molnar
2009-02-11 20:39 ` Jack Steiner
2009-02-12 2:39 ` Kenji Kaneshige
2009-02-12 2:43 ` Steven Rostedt
2009-02-12 3:15 ` Kenji Kaneshige
2009-02-12 3:22 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090208055341.660793832@goodmis.org \
--to=rostedt@goodmis.org \
--cc=acme@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=srostedt@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox