aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index dbff0207b213..eed732c151fc 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -337,18 +337,34 @@ struct tracer_flags {
337#define TRACER_OPT(s, b) .name = #s, .bit = b 337#define TRACER_OPT(s, b) .name = #s, .bit = b
338 338
339 339
340/* 340/**
341 * A specific tracer, represented by methods that operate on a trace array: 341 * struct tracer - a specific tracer and its callbacks to interact with debugfs
342 * @name: the name chosen to select it on the available_tracers file
343 * @init: called when one switches to this tracer (echo name > current_tracer)
344 * @reset: called when one switches to another tracer
345 * @start: called when tracing is unpaused (echo 1 > tracing_enabled)
346 * @stop: called when tracing is paused (echo 0 > tracing_enabled)
347 * @open: called when the trace file is opened
348 * @pipe_open: called when the trace_pipe file is opened
349 * @wait_pipe: override how the user waits for traces on trace_pipe
350 * @close: called when the trace file is released
351 * @read: override the default read callback on trace_pipe
352 * @splice_read: override the default splice_read callback on trace_pipe
353 * @selftest: selftest to run on boot (see trace_selftest.c)
354 * @print_headers: override the first lines that describe your columns
355 * @print_line: callback that prints a trace
356 * @set_flag: signals one of your private flags changed (trace_options file)
357 * @flags: your private flags
342 */ 358 */
343struct tracer { 359struct tracer {
344 const char *name; 360 const char *name;
345 /* Your tracer should raise a warning if init fails */
346 int (*init)(struct trace_array *tr); 361 int (*init)(struct trace_array *tr);
347 void (*reset)(struct trace_array *tr); 362 void (*reset)(struct trace_array *tr);
348 void (*start)(struct trace_array *tr); 363 void (*start)(struct trace_array *tr);
349 void (*stop)(struct trace_array *tr); 364 void (*stop)(struct trace_array *tr);
350 void (*open)(struct trace_iterator *iter); 365 void (*open)(struct trace_iterator *iter);
351 void (*pipe_open)(struct trace_iterator *iter); 366 void (*pipe_open)(struct trace_iterator *iter);
367 void (*wait_pipe)(struct trace_iterator *iter);
352 void (*close)(struct trace_iterator *iter); 368 void (*close)(struct trace_iterator *iter);
353 ssize_t (*read)(struct trace_iterator *iter, 369 ssize_t (*read)(struct trace_iterator *iter,
354 struct file *filp, char __user *ubuf, 370 struct file *filp, char __user *ubuf,
@@ -432,6 +448,9 @@ void tracing_generic_entry_update(struct trace_entry *entry,
432 unsigned long flags, 448 unsigned long flags,
433 int pc); 449 int pc);
434 450
451void default_wait_pipe(struct trace_iterator *iter);
452void poll_wait_pipe(struct trace_iterator *iter);
453
435void ftrace(struct trace_array *tr, 454void ftrace(struct trace_array *tr,
436 struct trace_array_cpu *data, 455 struct trace_array_cpu *data,
437 unsigned long ip, 456 unsigned long ip,