trace_stat.h 973 B

12345678910111213141516171819202122232425262728293031323334
  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. /* Release an entry */
  20. void (*stat_release)(void *stat);
  21. /* Print the headers of your stat entries */
  22. int (*stat_headers)(struct seq_file *s);
  23. };
  24. /*
  25. * Destroy or create a stat file
  26. */
  27. extern int register_stat_tracer(struct tracer_stat *trace);
  28. extern void unregister_stat_tracer(struct tracer_stat *trace);
  29. #endif /* __TRACE_STAT_H */