2 * mpstat: per-processor statistics
3 * (C) 2000-2016 by Sebastien Godard (sysstat <at> orange.fr)
10 ***************************************************************************
11 * mpstat's specific system files.
12 ***************************************************************************
15 #define SOFTIRQS "/proc/softirqs"
18 ***************************************************************************
19 * Activities definitions.
20 ***************************************************************************
23 #define M_D_CPU 0x0001
24 #define M_D_IRQ_SUM 0x0002
25 #define M_D_IRQ_CPU 0x0004
26 #define M_D_SOFTIRQS 0x0008
28 #define DISPLAY_CPU(m) (((m) & M_D_CPU) == M_D_CPU)
29 #define DISPLAY_IRQ_SUM(m) (((m) & M_D_IRQ_SUM) == M_D_IRQ_SUM)
30 #define DISPLAY_IRQ_CPU(m) (((m) & M_D_IRQ_CPU) == M_D_IRQ_CPU)
31 #define DISPLAY_SOFTIRQS(m) (((m) & M_D_SOFTIRQS) == M_D_SOFTIRQS)
34 ***************************************************************************
35 * Keywords and constants.
36 ***************************************************************************
39 /* Indicate that option -P has been used */
40 #define F_P_OPTION 0x01
41 /* Indicate that stats should be displayed on for online CPU ("-P ON") */
44 #define USE_P_OPTION(m) (((m) & F_P_OPTION) == F_P_OPTION)
45 #define DISPLAY_ONLINE_CPU(m) (((m) & F_P_ON) == F_P_ON)
52 #define NR_IRQCPU_PREALLOC 3
54 #define MAX_IRQ_LEN 16
57 ***************************************************************************
58 * Structures used to store statistics.
59 ***************************************************************************
63 * stats_irqcpu->irq_name: IRQ#-A
64 * stats_irqcpu->interrupt: number of IRQ#-A for proc 0
65 * stats_irqcpu->irq_name: IRQ#-B
66 * stats_irqcpu->interrupt: number of IRQ#-B for proc 0
68 * stats_irqcpu->irq_name: (undef'd)
69 * stats_irqcpu->interrupt: number of IRQ#-A for proc 1
70 * stats_irqcpu->irq_name: (undef'd)
71 * stats_irqcpu->interrupt: number of IRQ#-B for proc 1
75 unsigned int interrupt __attribute__ ((aligned (4)));
76 char irq_name[MAX_IRQ_LEN];
79 #define STATS_IRQCPU_SIZE (sizeof(struct stats_irqcpu))