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.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 94ed45e93a80..b3f9ad1b4d84 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -335,6 +335,25 @@ struct tracer_flags {
335#define TRACER_OPT(s, b) .name = #s, .bit = b 335#define TRACER_OPT(s, b) .name = #s, .bit = b
336 336
337/* 337/*
338 * If you want to provide a stat file (one-shot statistics), fill
339 * an iterator with stat_start/stat_next and a stat_show callbacks.
340 * The others callbacks are optional.
341 */
342struct tracer_stat {
343 /* The name of your stat file */
344 const char *name;
345 /* Iteration over statistic entries */
346 void *(*stat_start)(void);
347 void *(*stat_next)(void *prev, int idx);
348 /* Compare two entries for sorting (optional) for stats */
349 int (*stat_cmp)(void *p1, void *p2);
350 /* Print a stat entry */
351 int (*stat_show)(struct seq_file *s, void *p);
352 /* Print the headers of your stat entries */
353 int (*stat_headers)(struct seq_file *s);
354};
355
356/*
338 * A specific tracer, represented by methods that operate on a trace array: 357 * A specific tracer, represented by methods that operate on a trace array:
339 */ 358 */
340struct tracer { 359struct tracer {
@@ -361,21 +380,7 @@ struct tracer {
361 struct tracer *next; 380 struct tracer *next;
362 int print_max; 381 int print_max;
363 struct tracer_flags *flags; 382 struct tracer_flags *flags;
364 383 struct tracer_stat *stats;
365 /*
366 * If you change one of the following on tracing runtime, recall
367 * init_tracer_stat()
368 */
369
370 /* Iteration over statistic entries */
371 void *(*stat_start)(void);
372 void *(*stat_next)(void *prev, int idx);
373 /* Compare two entries for sorting (optional) for stats */
374 int (*stat_cmp)(void *p1, void *p2);
375 /* Print a stat entry */
376 int (*stat_show)(struct seq_file *s, void *p);
377 /* Print the headers of your stat entries */
378 int (*stat_headers)(struct seq_file *s);
379}; 384};
380 385
381struct trace_seq { 386struct trace_seq {