trace_stat.h 912 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __TRACE_STAT_H
  2. #define __TRACE_STAT_H
  3. #include <linux/seq_file.h>
  4. /*
  5. * If you want to provide a stat file (one-shot statistics), fill
  6. * an iterator with stat_start/stat_next and a stat_show callbacks.
  7. * The others callbacks are optional.
  8. */
  9. struct tracer_stat {
  10. /* The name of your stat file */
  11. const char *name;
  12. /* Iteration over statistic entries */
  13. void *(*stat_start)(struct tracer_stat *trace);
  14. void *(*stat_next)(void *prev, int idx);
  15. /* Compare two entries for stats sorting */
  16. int (*stat_cmp)(void *p1, void *p2);
  17. /* Print a stat entry */
  18. int (*stat_show)(struct seq_file *s, void *p);
  19. /* Print the headers of your stat entries */
  20. int (*stat_headers)(struct seq_file *s);
  21. };
  22. /*
  23. * Destroy or create a stat file
  24. */
  25. extern int register_stat_tracer(struct tracer_stat *trace);
  26. extern void unregister_stat_tracer(struct tracer_stat *trace);
  27. #endif /* __TRACE_STAT_H */