Blame view

kernel/trace/trace_stat.h 992 Bytes
bb730b583   Steven Rostedt (VMware)   tracing: Fix SPDX...
1
  // SPDX-License-Identifier: GPL-2.0
002bb86d8   Frederic Weisbecker   tracing/ftrace: s...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  #ifndef __TRACE_STAT_H
  #define __TRACE_STAT_H
  
  #include <linux/seq_file.h>
  
  /*
   * If you want to provide a stat file (one-shot statistics), fill
   * an iterator with stat_start/stat_next and a stat_show callbacks.
   * The others callbacks are optional.
   */
  struct tracer_stat {
  	/* The name of your stat file */
  	const char		*name;
  	/* Iteration over statistic entries */
425480081   Steven Rostedt   tracing: add hand...
16
  	void			*(*stat_start)(struct tracer_stat *trace);
002bb86d8   Frederic Weisbecker   tracing/ftrace: s...
17
18
  	void			*(*stat_next)(void *prev, int idx);
  	/* Compare two entries for stats sorting */
80042c8f0   Andy Shevchenko   tracing: Use gene...
19
  	cmp_func_t		stat_cmp;
002bb86d8   Frederic Weisbecker   tracing/ftrace: s...
20
21
  	/* Print a stat entry */
  	int			(*stat_show)(struct seq_file *s, void *p);
d8ea37d5d   Lai Jiangshan   tracing/stat: Add...
22
23
  	/* Release an entry */
  	void			(*stat_release)(void *stat);
002bb86d8   Frederic Weisbecker   tracing/ftrace: s...
24
25
26
27
28
29
30
31
32
33
34
  	/* Print the headers of your stat entries */
  	int			(*stat_headers)(struct seq_file *s);
  };
  
  /*
   * Destroy or create a stat file
   */
  extern int register_stat_tracer(struct tracer_stat *trace);
  extern void unregister_stat_tracer(struct tracer_stat *trace);
  
  #endif /* __TRACE_STAT_H */