aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2008-11-25 03:24:15 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-25 11:31:13 -0500
commit1e9b51c28312f7334394aa30be56ff52c2b65b7e (patch)
treec0a231d83541263ee938e3452475409323e4e9a9 /kernel/trace/trace.h
parent8bba1bf5e2434c83f2fe8b1422604ace9bbe4cb8 (diff)
x86, bts, ftrace: a BTS ftrace plug-in prototype
Impact: add new ftrace plugin A prototype for a BTS ftrace plug-in. The tracer collects branch trace in a cyclic buffer for each cpu. The tracer is not configurable and the trace for each snapshot is appended when doing cat /debug/tracing/trace. This is a proof of concept that will be extended with future patches to become a (hopefully) useful tool. Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 717f9f045c6f..3abd645e8af2 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -27,6 +27,7 @@ enum trace_type {
27 TRACE_BOOT_RET, 27 TRACE_BOOT_RET,
28 TRACE_FN_RET, 28 TRACE_FN_RET,
29 TRACE_USER_STACK, 29 TRACE_USER_STACK,
30 TRACE_BTS,
30 31
31 __TRACE_LAST_TYPE 32 __TRACE_LAST_TYPE
32}; 33};
@@ -153,6 +154,12 @@ struct trace_branch {
153 char correct; 154 char correct;
154}; 155};
155 156
157struct bts_entry {
158 struct trace_entry ent;
159 unsigned long from;
160 unsigned long to;
161};
162
156/* 163/*
157 * trace_flag_type is an enumeration that holds different 164 * trace_flag_type is an enumeration that holds different
158 * states when a trace occurs. These are: 165 * states when a trace occurs. These are:
@@ -258,6 +265,7 @@ extern void __ftrace_bad_type(void);
258 IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\ 265 IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\
259 IF_ASSIGN(var, ent, struct trace_branch, TRACE_BRANCH); \ 266 IF_ASSIGN(var, ent, struct trace_branch, TRACE_BRANCH); \
260 IF_ASSIGN(var, ent, struct ftrace_ret_entry, TRACE_FN_RET);\ 267 IF_ASSIGN(var, ent, struct ftrace_ret_entry, TRACE_FN_RET);\
268 IF_ASSIGN(var, ent, struct bts_entry, TRACE_BTS);\
261 __ftrace_bad_type(); \ 269 __ftrace_bad_type(); \
262 } while (0) 270 } while (0)
263 271
@@ -392,6 +400,10 @@ void trace_function(struct trace_array *tr,
392void 400void
393trace_function_return(struct ftrace_retfunc *trace); 401trace_function_return(struct ftrace_retfunc *trace);
394 402
403void trace_bts(struct trace_array *tr,
404 unsigned long from,
405 unsigned long to);
406
395void tracing_start_cmdline_record(void); 407void tracing_start_cmdline_record(void);
396void tracing_stop_cmdline_record(void); 408void tracing_stop_cmdline_record(void);
397void tracing_sched_switch_assign_trace(struct trace_array *tr); 409void tracing_sched_switch_assign_trace(struct trace_array *tr);