From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Li Zefan <lizf@cn.fujitsu.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 4/6] tracing/core: Make the stack entry helpers global
Date: Wed, 29 Jul 2009 19:13:27 +0200 [thread overview]
Message-ID: <1248887609-5147-5-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1248887609-5147-1-git-send-email-fweisbec@gmail.com>
Make the stacktrace event insertion helpers globals.
This has two effects:
- Prepare for moving the sched events insertion helpers to
the sched switch tracer file.
- Move some ifdef outside function definitions
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace.c | 24 ++++++++----------------
kernel/trace/trace.h | 28 +++++++++++++++++++++++++---
2 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 769d5cf..d126c88 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -866,10 +866,6 @@ struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr,
return event;
}
-static void ftrace_trace_stack(struct trace_array *tr,
- unsigned long flags, int skip, int pc);
-static void ftrace_trace_userstack(struct trace_array *tr,
- unsigned long flags, int pc);
static inline void __trace_buffer_unlock_commit(struct trace_array *tr,
struct ring_buffer_event *event,
@@ -978,11 +974,11 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
trace_function(tr, ip, parent_ip, flags, pc);
}
+#ifdef CONFIG_STACKTRACE
static void __ftrace_trace_stack(struct trace_array *tr,
unsigned long flags,
int skip, int pc)
{
-#ifdef CONFIG_STACKTRACE
struct ftrace_event_call *call = &event_kernel_stack;
struct ring_buffer_event *event;
struct stack_entry *entry;
@@ -1003,12 +999,10 @@ static void __ftrace_trace_stack(struct trace_array *tr,
save_stack_trace(&trace);
if (!filter_check_discard(call, entry, tr->buffer, event))
ring_buffer_unlock_commit(tr->buffer, event);
-#endif
}
-static void ftrace_trace_stack(struct trace_array *tr,
- unsigned long flags,
- int skip, int pc)
+void ftrace_trace_stack(struct trace_array *tr, unsigned long flags, int skip,
+ int pc)
{
if (!(trace_flags & TRACE_ITER_STACKTRACE))
return;
@@ -1016,17 +1010,14 @@ static void ftrace_trace_stack(struct trace_array *tr,
__ftrace_trace_stack(tr, flags, skip, pc);
}
-void __trace_stack(struct trace_array *tr,
- unsigned long flags,
- int skip, int pc)
+void __trace_stack(struct trace_array *tr, unsigned long flags, int skip,
+ int pc)
{
__ftrace_trace_stack(tr, flags, skip, pc);
}
-static void ftrace_trace_userstack(struct trace_array *tr,
- unsigned long flags, int pc)
+void ftrace_trace_userstack(struct trace_array *tr, unsigned long flags, int pc)
{
-#ifdef CONFIG_STACKTRACE
struct ftrace_event_call *call = &event_user_stack;
struct ring_buffer_event *event;
struct userstack_entry *entry;
@@ -1051,7 +1042,6 @@ static void ftrace_trace_userstack(struct trace_array *tr,
save_stack_trace_user(&trace);
if (!filter_check_discard(call, entry, tr->buffer, event))
ring_buffer_unlock_commit(tr->buffer, event);
-#endif
}
#ifdef UNUSED
@@ -1061,6 +1051,8 @@ static void __trace_userstack(struct trace_array *tr, unsigned long flags)
}
#endif /* UNUSED */
+#endif /* CONFIG_STACKTRACE */
+
static void
ftrace_trace_special(void *__tr,
unsigned long arg1, unsigned long arg2, unsigned long arg3,
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 186543a..e5802a2 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -489,9 +489,31 @@ void update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu);
void update_max_tr_single(struct trace_array *tr,
struct task_struct *tsk, int cpu);
-void __trace_stack(struct trace_array *tr,
- unsigned long flags,
- int skip, int pc);
+#ifdef CONFIG_STACKTRACE
+void ftrace_trace_stack(struct trace_array *tr, unsigned long flags,
+ int skip, int pc);
+
+void ftrace_trace_userstack(struct trace_array *tr, unsigned long flags,
+ int pc);
+
+void __trace_stack(struct trace_array *tr, unsigned long flags, int skip,
+ int pc);
+#else
+static inline void ftrace_trace_stack(struct trace_array *tr,
+ unsigned long flags, int skip, int pc)
+{
+}
+
+static inline void ftrace_trace_userstack(struct trace_array *tr,
+ unsigned long flags, int pc)
+{
+}
+
+static inline void __trace_stack(struct trace_array *tr, unsigned long flags,
+ int skip, int pc)
+{
+}
+#endif /* CONFIG_STACKTRACE */
extern cycle_t ftrace_now(int cpu);
--
1.6.2.3
next prev parent reply other threads:[~2009-07-29 17:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 17:13 [GIT PULL] tracing: Various cleanups for 2.6.32 Frederic Weisbecker
2009-07-29 17:13 ` [PATCH 1/6] tracing: Simplify print_graph_cpu() Frederic Weisbecker
2009-07-29 17:13 ` [PATCH 2/6] tracing/function-graph-tracer: Drop the useless nmi protection Frederic Weisbecker
2009-07-29 17:13 ` [PATCH 3/6] tracing/function-tracer: Move trace_function() in the function tracer file Frederic Weisbecker
2009-07-29 17:13 ` Frederic Weisbecker [this message]
2009-07-29 17:13 ` [PATCH 5/6] tracing: Move sched event insertion helpers in the sched switch " Frederic Weisbecker
2009-07-29 17:13 ` [PATCH 6/6] tracing/function-graph-tracer: Move graph event insertion helpers in the graph " Frederic Weisbecker
2009-07-30 1:48 ` [GIT PULL] tracing: Various cleanups for 2.6.32 Li Zefan
2009-07-30 13:00 ` Steven Rostedt
2009-08-02 19:34 ` Ingo Molnar
2009-08-02 19:53 ` Ingo Molnar
2009-08-03 1:18 ` Frédéric Weisbecker
2009-08-06 6:27 ` [GIT PULL] tracing: Various cleanups for 2.6.32, v2 Frederic Weisbecker
2009-08-06 12:24 ` Ingo Molnar
2009-08-06 6:27 ` [PATCH 1/7] tracing: Simplify print_graph_cpu() Frederic Weisbecker
2009-08-06 6:27 ` [PATCH 2/7] tracing/function-graph-tracer: Drop the useless nmi protection Frederic Weisbecker
2009-08-06 6:27 ` [PATCH 3/7] tracing/core: Turn ftrace_cpu_disabled into a global var Frederic Weisbecker
2009-08-06 6:27 ` [PATCH 4/7] tracing/core: Make the stack entry helpers global Frederic Weisbecker
2009-08-06 6:27 ` [PATCH 5/7] tracing: Move sched event insertion helpers in the sched switch tracer file Frederic Weisbecker
2009-08-06 6:27 ` [PATCH 6/7] tracing/function-graph-tracer: Move graph event insertion helpers in the graph " Frederic Weisbecker
2009-08-06 6:27 ` [PATCH 7/7] tracing/events: Only define remove_subsystem_dir() if CONFIG_MODULES Frederic Weisbecker
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=1248887609-5147-5-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--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
all inboxes | Powered by JetHome®