aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace_event.h
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-07-01 23:07:32 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-07-20 21:52:33 -0400
commite870e9a1240bcef1157ffaaf71dac63362e71904 (patch)
treeb8f57a68ff45b35dab8cdfa474e17622d275bdc6 /include/linux/ftrace_event.h
parentcc5edb0eb9ce892b530e34a5d110382483587942 (diff)
tracing: Allow to disable cmdline recording
We found that even enabling a single trace event that will rarely be triggered can add big overhead to context switch. (lmbench context switch test) ------------------------------------------------- 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw ------ ------ ------ ------ ------ ------- ------- 2.19 2.3 2.21 2.56 2.13 2.54 2.07 2.39 2.51 2.35 2.75 2.27 2.81 2.24 The overhead is 6% ~ 11%. It's because when a trace event is enabled 3 tracepoints (sched_switch, sched_wakeup, sched_wakeup_new) will be activated to map pid to cmdname. We'd like to avoid this overhead, so add a trace option '(no)record-cmd' to allow to disable cmdline recording. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> LKML-Reference: <4C2D57F4.2050204@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r--include/linux/ftrace_event.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 01df7ca4ead7..2b7b1395b4d5 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -152,11 +152,13 @@ extern int ftrace_event_reg(struct ftrace_event_call *event,
152enum { 152enum {
153 TRACE_EVENT_FL_ENABLED_BIT, 153 TRACE_EVENT_FL_ENABLED_BIT,
154 TRACE_EVENT_FL_FILTERED_BIT, 154 TRACE_EVENT_FL_FILTERED_BIT,
155 TRACE_EVENT_FL_RECORDED_CMD_BIT,
155}; 156};
156 157
157enum { 158enum {
158 TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), 159 TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT),
159 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), 160 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
161 TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT),
160}; 162};
161 163
162struct ftrace_event_call { 164struct ftrace_event_call {
@@ -174,6 +176,7 @@ struct ftrace_event_call {
174 * 32 bit flags: 176 * 32 bit flags:
175 * bit 1: enabled 177 * bit 1: enabled
176 * bit 2: filter_active 178 * bit 2: filter_active
179 * bit 3: enabled cmd record
177 * 180 *
178 * Changes to flags must hold the event_mutex. 181 * Changes to flags must hold the event_mutex.
179 * 182 *