2018-08-16 22:26:55 +07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2009-01-11 02:34:13 +07:00
|
|
|
#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 */
|
2009-03-25 00:38:36 +07:00
|
|
|
void *(*stat_start)(struct tracer_stat *trace);
|
2009-01-11 02:34:13 +07:00
|
|
|
void *(*stat_next)(void *prev, int idx);
|
|
|
|
/* Compare two entries for stats sorting */
|
2019-10-07 20:56:56 +07:00
|
|
|
cmp_func_t stat_cmp;
|
2009-01-11 02:34:13 +07:00
|
|
|
/* Print a stat entry */
|
|
|
|
int (*stat_show)(struct seq_file *s, void *p);
|
2009-07-06 15:10:18 +07:00
|
|
|
/* Release an entry */
|
|
|
|
void (*stat_release)(void *stat);
|
2009-01-11 02:34:13 +07:00
|
|
|
/* 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 */
|