]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/irq-common.h
[clang-tidy] do not return in void functions
[thirdparty/util-linux.git] / sys-utils / irq-common.h
CommitLineData
02f2919e
KZ
1#ifndef UTIL_LINUX_H_IRQ_COMMON
2#define UTIL_LINUX_H_IRQ_COMMON
94e7e258 3
02f2919e
KZ
4#include "c.h"
5#include "nls.h"
6
7/* supported columns */
94e7e258 8enum {
02f2919e 9 COL_IRQ = 0,
94e7e258
KZ
10 COL_TOTAL,
11 COL_DELTA,
12 COL_NAME,
13
14 __COL_COUNT
15};
16
17struct irq_info {
18 char *irq; /* short name of this irq */
19 char *name; /* descriptive name of this irq */
20 unsigned long total; /* total count since system start up */
21 unsigned long delta; /* delta count since previous update */
22};
23
77f57b90 24
94e7e258
KZ
25struct irq_stat {
26 unsigned int nr_irq; /* number of irq vector */
27 unsigned int nr_irq_info; /* number of irq info */
28 struct irq_info *irq_info; /* array of irq_info */
29 long nr_active_cpu; /* number of active cpu */
30 unsigned long total_irq; /* total irqs */
31 unsigned long delta_irq; /* delta irqs */
32};
33
44e39c99 34typedef int (irq_cmp_t)(const struct irq_info *, const struct irq_info *);
94e7e258 35
02f2919e 36/* output definition */
94e7e258
KZ
37struct irq_output {
38 int columns[__COL_COUNT * 2];
39 size_t ncolumns;
40
44e39c99 41 irq_cmp_t *sort_cmp_func;
94e7e258
KZ
42
43 unsigned int
5a20c0de
KZ
44 json:1, /* JSON output */
45 pairs:1, /* export, NAME="value" aoutput */
46 no_headings:1; /* don't print header */
94e7e258
KZ
47};
48
49int irq_column_name_to_id(char const *const name, size_t const namesz);
77f57b90 50void free_irqstat(struct irq_stat *stat);
94e7e258 51
a0f62b0b 52void irq_print_columns(FILE *f, int nodelta);
94e7e258 53
44e39c99
KZ
54void set_sort_func_by_name(struct irq_output *out, const char *name);
55void set_sort_func_by_key(struct irq_output *out, const char c);
94e7e258
KZ
56
57struct libscols_table *get_scols_table(struct irq_output *out,
58 struct irq_stat *prev,
59 struct irq_stat **xstat);
02f2919e
KZ
60
61#endif /* UTIL_LINUX_H_IRQ_COMMON */