2 * mpstat: per-processor statistics
3 * (C) 2000-2021 by Sebastien Godard (sysstat <at> orange.fr)
12 ***************************************************************************
13 * mpstat's specific system files.
14 ***************************************************************************
17 #define SOFTIRQS PRE "/proc/softirqs"
18 #define PHYS_PACK_ID "topology/physical_package_id"
19 #define THREAD_SBL_LST "topology/thread_siblings_list"
22 ***************************************************************************
23 * Activities definitions.
24 ***************************************************************************
27 #define M_D_CPU 0x0001
28 #define M_D_IRQ_SUM 0x0002
29 #define M_D_IRQ_CPU 0x0004
30 #define M_D_SOFTIRQS 0x0008
31 #define M_D_NODE 0x0010
33 #define DISPLAY_CPU(m) (((m) & M_D_CPU) == M_D_CPU)
34 #define DISPLAY_IRQ_SUM(m) (((m) & M_D_IRQ_SUM) == M_D_IRQ_SUM)
35 #define DISPLAY_IRQ_CPU(m) (((m) & M_D_IRQ_CPU) == M_D_IRQ_CPU)
36 #define DISPLAY_SOFTIRQS(m) (((m) & M_D_SOFTIRQS) == M_D_SOFTIRQS)
37 #define DISPLAY_NODE(m) (((m) & M_D_NODE) == M_D_NODE)
40 ***************************************************************************
41 * Keywords and constants.
42 ***************************************************************************
45 /* Indicate that option -P has been used */
46 #define F_OPTION_P 0x01
47 /* Indicate that option -A has been used */
48 #define F_OPTION_A 0x02
50 #define F_JSON_OUTPUT 0x04
51 /* Indicate that option -N has been used */
52 #define F_OPTION_N 0x08
53 /* Display topology */
54 #define F_TOPOLOGY 0x10
56 #define USE_OPTION_P(m) (((m) & F_OPTION_P) == F_OPTION_P)
57 #define USE_OPTION_A(m) (((m) & F_OPTION_A) == F_OPTION_A)
58 #define DISPLAY_JSON_OUTPUT(m) (((m) & F_JSON_OUTPUT) == F_JSON_OUTPUT)
59 #define USE_OPTION_N(m) (((m) & F_OPTION_N) == F_OPTION_N)
60 #define DISPLAY_TOPOLOGY(m) (((m) & F_TOPOLOGY) == F_TOPOLOGY)
66 #define NR_IRQCPU_PREALLOC 3
68 #define MAX_IRQ_LEN 16
71 ***************************************************************************
72 * Structures used to store statistics.
73 ***************************************************************************
77 * stats_irqcpu->irq_name: IRQ#-A
78 * stats_irqcpu->interrupt: number of IRQ#-A for proc 0
79 * stats_irqcpu->irq_name: IRQ#-B
80 * stats_irqcpu->interrupt: number of IRQ#-B for proc 0
82 * stats_irqcpu->irq_name: (undef'd)
83 * stats_irqcpu->interrupt: number of IRQ#-A for proc 1
84 * stats_irqcpu->irq_name: (undef'd)
85 * stats_irqcpu->interrupt: number of IRQ#-B for proc 1
89 unsigned int interrupt __attribute__ ((aligned (4)));
90 char irq_name[MAX_IRQ_LEN];
98 #define STATS_IRQCPU_SIZE (sizeof(struct stats_irqcpu))