]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/irq-common.h
2 * SPDX-License-Identifier: GPL-2.1-or-later
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * Copyright (C) 2012 Sami Kerola <kerolasa@iki.fi>
10 * Copyright (C) 2012-2023 Karel Zak <kzak@redhat.com>
12 #ifndef UTIL_LINUX_H_IRQ_COMMON
13 #define UTIL_LINUX_H_IRQ_COMMON
19 /* supported columns */
30 char *irq
; /* short name of this irq */
31 char *name
; /* descriptive name of this irq */
32 unsigned long total
; /* total count since system start up */
33 unsigned long delta
; /* delta count since previous update */
42 unsigned long nr_irq
; /* number of irq vector */
43 unsigned long nr_irq_info
; /* number of irq info */
44 struct irq_info
*irq_info
; /* array of irq_info */
45 struct irq_cpu
*cpus
; /* array of irq_cpu */
46 size_t nr_active_cpu
; /* number of active cpu */
47 unsigned long total_irq
; /* total irqs */
48 unsigned long delta_irq
; /* delta irqs */
52 typedef int (irq_cmp_t
)(const struct irq_info
*, const struct irq_info
*);
54 /* output definition */
56 int columns
[__COL_COUNT
* 2];
59 irq_cmp_t
*sort_cmp_func
;
62 json
:1, /* JSON output */
63 pairs
:1, /* export, NAME="value" aoutput */
64 no_headings
:1; /* don't print header */
67 int irq_column_name_to_id(char const *const name
, size_t const namesz
);
68 void free_irqstat(struct irq_stat
*stat
);
70 void irq_print_columns(FILE *f
, int nodelta
);
72 void set_sort_func_by_name(struct irq_output
*out
, const char *name
);
73 void set_sort_func_by_key(struct irq_output
*out
, const char c
);
75 struct libscols_table
*get_scols_table(struct irq_output
*out
,
76 struct irq_stat
*prev
,
77 struct irq_stat
**xstat
,
82 struct libscols_table
*get_scols_cpus_table(struct irq_output
*out
,
83 struct irq_stat
*prev
,
84 struct irq_stat
*curr
,
88 #endif /* UTIL_LINUX_H_IRQ_COMMON */