From 97393bcb0b918840768c85af2ecc7716565e3425 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Mon, 10 Jan 2022 18:19:18 +0100 Subject: [PATCH] Add comments in files and cosmetic fix Signed-off-by: Sebastien GODARD --- count.c | 6 ++++++ rd_stats.c | 17 ++++++++++++++++- rd_stats.h | 20 +++++++++++++++----- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/count.c b/count.c index 0adc25e..1a520a4 100644 --- a/count.c +++ b/count.c @@ -154,6 +154,9 @@ int get_proc_cpu_nr(void) * one have been disabled, we get the total number of proc since we use * /sys to count them). * 2: two proc... + * + * USED BY: + * sadc, cifsiostat, iostat, mpstat, pidstat, tapestat *************************************************************************** */ __nr_t get_cpu_nr(unsigned int max_nr_cpus, int highest) @@ -186,6 +189,9 @@ __nr_t get_cpu_nr(unsigned int max_nr_cpus, int highest) * * RETURNS: * Number of interrupts per processor. + * + * USED BY: + * sadc, mpstat *************************************************************************** */ __nr_t get_irqcpu_nr(char *file, int max_nr_irqcpu, int cpu_nr) diff --git a/rd_stats.c b/rd_stats.c index ec07420..7c59b92 100644 --- a/rd_stats.c +++ b/rd_stats.c @@ -68,6 +68,9 @@ struct stats_psi { * * (*)This doesn't account for all processors in the machine in the case * where some CPU are offline and located at the end of the list. + * + * USED BY: + * sadc, iostat, mpstat, pidstat *************************************************************************** */ __nr_t read_stat_cpu(struct stats_cpu *st_cpu, __nr_t nr_alloc) @@ -237,6 +240,9 @@ __nr_t read_stat_irq(struct stats_irq *st_irq, __nr_t nr_alloc) * * RETURNS: * 1 on success, 0 otherwise. + * + * USED BY: + * sadc, pidstat *************************************************************************** */ __nr_t read_meminfo(struct stats_memory *st_memory) @@ -329,6 +335,9 @@ __nr_t read_meminfo(struct stats_memory *st_memory) * * OUT: * @uptime Uptime value in hundredths of a second. + * + * USED BY: + * sadc, cifsiostat, iostat, mpstat, pidstat *************************************************************************** */ void read_uptime(unsigned long long *uptime) @@ -372,6 +381,9 @@ void read_uptime(unsigned long long *uptime) * * OUT: * @xds Structure with extended statistics. + * + * USED BY: + * sar, sadf, iostat *************************************************************************** */ void compute_ext_disk_stats(struct stats_disk *sdc, struct stats_disk *sdp, @@ -405,6 +417,9 @@ void compute_ext_disk_stats(struct stats_disk *sdc, struct stats_disk *sdp, * * RETURNS: * Interval of time based on current CPU, expressed in jiffies. + * + * USED BY: + * sar, sadf, mpstat *************************************************************************** */ unsigned long long get_per_cpu_interval(struct stats_cpu *scc, @@ -2728,7 +2743,7 @@ __nr_t read_fchost(struct stats_fchost *st_fc, __nr_t nr_alloc) *************************************************************************** */ int read_softnet(struct stats_softnet *st_softnet, __nr_t nr_alloc, - unsigned char online_cpu_bitmap[]) + unsigned char online_cpu_bitmap[]) { FILE *fp; struct stats_softnet *st_softnet_i; diff --git a/rd_stats.h b/rd_stats.h index 9dda2df..c9d0a1e 100644 --- a/rd_stats.h +++ b/rd_stats.h @@ -93,8 +93,10 @@ /* * Structure for CPU statistics. - * In activity buffer: First structure is for global CPU utilisation ("all"). + * In activity buffer: First structure is for global CPU utilization ("all"). * Following structures are for each individual CPU (0, 1, etc.) + * + * Used by: sadc, sar, sadf, iostat, mpstat, pidstat */ struct stats_cpu { unsigned long long cpu_user; @@ -187,7 +189,11 @@ struct stats_io { #define STATS_IO_UL 0 #define STATS_IO_U 0 -/* Structure for memory and swap space utilization statistics */ +/* + * Structure for memory and swap space utilization statistics. + * + * Used by: sadc, sar, sadf, pidstat + */ struct stats_memory { unsigned long long frmkb; unsigned long long bufkb; @@ -257,7 +263,11 @@ struct stats_serial { #define STATS_SERIAL_UL 0 #define STATS_SERIAL_U 7 -/* Structure for block devices statistics */ +/* + * Structure for block devices statistics. + * + * Used by: sadc, sar, sadf, iostat + */ struct stats_disk { unsigned long long nr_ios; unsigned long long wwn[2]; @@ -600,7 +610,7 @@ struct stats_net_udp6 { /* * Structure for CPU frequency statistics. - * In activity buffer: First structure is for global CPU utilisation ("all"). + * In activity buffer: First structure is for global CPU utilization ("all"). * Following structures are for each individual CPU (0, 1, etc.) */ struct stats_pwr_cpufreq { @@ -627,7 +637,7 @@ struct stats_huge { /* * Structure for weighted CPU frequency statistics. - * In activity buffer: First structure is for global CPU utilisation ("all"). + * In activity buffer: First structure is for global CPU utilization ("all"). * Following structures are for each individual CPU (0, 1, etc.) */ struct stats_pwr_wghfreq { -- 2.40.0