From 77ae1797b0b72e51caca1763f99ff42159012401 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sun, 23 Jan 2022 15:48:52 +0100 Subject: [PATCH] A_IRQ: Move to new structure Interrupts activity structure is modified. The interrupt name will now be saved together with the number of interrupts. The number of interrupts is saved as an unsigned int to be consistent with the type used by the kernel. Signed-off-by: Sebastien GODARD --- activity.c | 10 ++-------- rd_stats.h | 16 +++++++++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/activity.c b/activity.c index 3030364..078fd34 100644 --- a/activity.c +++ b/activity.c @@ -53,12 +53,6 @@ struct act_bitmap cpu_bitmap = { .b_size = NR_CPUS }; -/* Interrupts bitmap */ -struct act_bitmap irq_bitmap = { - .b_array = NULL, - .b_size = NR_IRQS -}; - /* * CPU statistics. @@ -162,7 +156,7 @@ struct activity pcsw_act = { /* Interrupts statistics */ struct activity irq_act = { .id = A_IRQ, - .options = AO_COUNTED + AO_MATRIX, + .options = AO_COUNTED + AO_MATRIX + AO_PERSISTENT, .magic = ACTIVITY_MAGIC_BASE + 2, .group = G_INT, #ifdef SOURCE_SADC @@ -202,7 +196,7 @@ struct activity irq_act = { .msize = STATS_IRQ_SIZE, .opt_flags = 0, .buf = {NULL, NULL, NULL}, - .bitmap = &irq_bitmap + .bitmap = &cpu_bitmap }; /* Swapping activity */ diff --git a/rd_stats.h b/rd_stats.h index c9d0a1e..f2abafc 100644 --- a/rd_stats.h +++ b/rd_stats.h @@ -26,6 +26,8 @@ #define MAX_FS_LEN 128 /* Maximum length of FC host name */ #define MAX_FCH_LEN 16 +/* Maximum length of interrupt name */ +#define MAX_SA_IRQ_LEN 8 #define CNT_PART 1 #define CNT_ALL_DEV 0 @@ -133,17 +135,21 @@ struct stats_pcsw { /* * Structure for interrupts statistics. - * In activity buffer: First structure is for total number of interrupts ("SUM"). - * Following structures are for each individual interrupt (0, 1, etc.) + * In activity buffer (sadc): First structures are for global CPU utilization ("all"): + * interrupts sum, 0, 1,... + * Following structures are for each individual CPU (0, 1, etc.) + * + * Used by: sadc, sar, sadf */ struct stats_irq { - unsigned long long irq_nr; + unsigned int irq_nr; + char irq_name[MAX_SA_IRQ_LEN]; }; #define STATS_IRQ_SIZE (sizeof(struct stats_irq)) -#define STATS_IRQ_ULL 1 +#define STATS_IRQ_ULL 0 #define STATS_IRQ_UL 0 -#define STATS_IRQ_U 0 +#define STATS_IRQ_U 1 /* Structure for swapping statistics */ struct stats_swap { -- 2.40.0