]> granicus.if.org Git - sysstat/commitdiff
Remove supernumerary spaces and tabulations in source files
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 22 Mar 2014 16:04:30 +0000 (17:04 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 22 Mar 2014 16:04:30 +0000 (17:04 +0100)
Remove white spaces and tabulations at end of lines.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
21 files changed:
cifsiostat.c
common.c
count.c
ioconf.c
iostat.c
json_stats.c
mpstat.c
nfsiostat-sysstat.c
pidstat.c
pr_stats.c
rd_sensors.c
rd_stats.c
rndr_stats.c
sa.h
sa_common.c
sa_wrap.c
sadc.c
sadf.c
sadf_misc.c
sar.c
xml_stats.c

index 04b561f006871797ca73eb9aef50731486df19d9..2db8a8fa5fa1679b6df7f05e1411f7204d752aa7 100644 (file)
@@ -114,7 +114,7 @@ int get_cifs_nr(void)
                return 0;
 
        while (fgets(line, sizeof(line), fp) != NULL) {
-               
+
                if (!strncmp(line, "Share (unique mount targets): ", 30)) {
                        sscanf(line + 30, "%d", &cifs);
                        break;
@@ -167,7 +167,7 @@ void free_inactive_entries(void)
 void io_sys_init(void)
 {
        int i;
-       
+
        /* How many processors on this machine? */
        cpu_nr = get_cpu_nr(~0, FALSE);
 
@@ -179,7 +179,7 @@ void io_sys_init(void)
                perror("malloc");
                exit(4);
        }
-       
+
        /* Allocate structures for number of CIFS directories found */
        for (i = 0; i < 2; i++) {
                if ((st_cifs[i] =
@@ -203,7 +203,7 @@ void io_sys_free(void)
        for (i = 0; i < 2; i++) {
                free(st_cifs[i]);
        }
-       
+
        free(st_hdr_cifs);
 }
 
@@ -362,7 +362,7 @@ void read_cifs_stat(int curr)
                        }
                }
        }
-       
+
        if (start) {
                scifs.fopens = all_open;
                save_stats(cifs_name, curr, &scifs);
@@ -521,7 +521,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime)
 
        /* Don't buffer data if redirected to a pipe */
        setbuf(stdout, NULL);
-       
+
        do {
                if (cpu_nr > 1) {
                        /*
@@ -594,7 +594,7 @@ int main(int argc, char **argv)
                                        /* Display an easy-to-read CIFS report */
                                        flags |= I_D_HUMAN_READ;
                                        break;
-       
+
                                case 'k':
                                        if (DISPLAY_MEGABYTES(flags)) {
                                                usage(argv[0]);
@@ -620,7 +620,7 @@ int main(int argc, char **argv)
                                        /* Print version number and exit */
                                        print_version();
                                        break;
-       
+
                                default:
                                        usage(argv[0]);
                                }
index e0d11256e8e8d1014a8774e1c9110dc33b2a8fe3..353b9557ccb4d527d491b9ebc32285c51b71d5af 100644 (file)
--- a/common.c
+++ b/common.c
@@ -144,7 +144,7 @@ time_t get_time(struct tm *rectime, int d_off)
                }
                utc++;
        }
-       
+
        if (utc == 2)
                return get_gmtime(rectime, d_off);
        else
@@ -169,7 +169,7 @@ int count_csvalues(int arg_c, char **arg_v)
        int opt = 1;
        int nr = 0;
        char *t;
-       
+
        while (opt < arg_c) {
                if (strchr(arg_v[opt], ',')) {
                        for (t = arg_v[opt]; t; t = strchr(t + 1, ',')) {
@@ -178,7 +178,7 @@ int count_csvalues(int arg_c, char **arg_v)
                }
                opt++;
        }
-       
+
        return nr;
 }
 
@@ -220,7 +220,7 @@ int get_dev_part_nr(char *dev_name)
                        part++;
                }
        }
-       
+
        /* Close directory */
        closedir(dir);
 
@@ -264,7 +264,7 @@ int get_sysfs_dev_nr(int display_partitions)
                if (!access(line, R_OK)) {
                        /* Yep... */
                        dev++;
-       
+
                        if (display_partitions) {
                                /* We also want the number of partitions for this device */
                                dev += get_dev_part_nr(drd->d_name);
@@ -425,7 +425,7 @@ char *device_name(char *name)
        out[MAX_FILE_LEN - 1] = '\0';
 
        free(resolved_name);
-               
+
        return out;
 }
 
@@ -456,7 +456,7 @@ int is_device(char *name, int allow_virtual)
        }
        snprintf(syspath, sizeof(syspath), "%s/%s%s", SYSFS_BLOCK, name,
                 allow_virtual ? "" : "/device");
-       
+
        return !(access(syspath, F_OK));
 }
 
@@ -554,7 +554,7 @@ unsigned long long get_interval(unsigned long long prev_uptime,
 
        /* prev_time=0 when displaying stats since system startup */
        itv = curr_uptime - prev_uptime;
-       
+
        if (!itv) {     /* Paranoia checking */
                itv = 1;
        }
@@ -582,7 +582,7 @@ unsigned long long get_per_cpu_interval(struct stats_cpu *scc,
                                        struct stats_cpu *scp)
 {
        unsigned long long ishift = 0LL;
-       
+
        if ((scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest)) {
                /*
                 * Sometimes the nr of jiffies spent in guest mode given by the guest
@@ -599,7 +599,7 @@ unsigned long long get_per_cpu_interval(struct stats_cpu *scc,
                ishift += (scp->cpu_nice - scp->cpu_guest_nice) -
                          (scc->cpu_nice - scc->cpu_guest_nice);
        }
-       
+
        /*
         * Don't take cpu_guest and cpu_guest_nice into account
         * because cpu_user and cpu_nice already include them.
@@ -681,7 +681,7 @@ void compute_ext_disk_stats(struct stats_disk *sdc, struct stats_disk *sdp,
 {
        double tput
                = ((double) (sdc->nr_ios - sdp->nr_ios)) * HZ / itv;
-       
+
        xds->util  = S_VALUE(sdp->tot_ticks, sdc->tot_ticks, itv);
        xds->svctm = tput ? xds->util / tput : 0.0;
        /*
@@ -804,7 +804,7 @@ char **get_persistent_names(void)
        files = (char **) calloc(n - 1, sizeof(char *));
        if (!files)
                goto free_list;
-       
+
        /*
         * i is for traversing namelist, k is for files.
         * i != k because we are ignoring "." and ".." entries.
@@ -824,7 +824,7 @@ char **get_persistent_names(void)
        files[k] = NULL;
 
 free_list:
-       
+
        for (i = 0; i < n; i++) {
                free(namelist[i]);
        }
diff --git a/count.c b/count.c
index a1fbc9deafda53716c50b3f279f919dd011d9670..426af31aa1f13e5a67ed132ed4b17b6e7358b241 100644 (file)
--- a/count.c
+++ b/count.c
@@ -472,17 +472,17 @@ int get_filesystem_nr(void)
        /* Get current filesystem */
        while (fgets(line, sizeof(line), fp) != NULL) {
                if (line[0] == '/') {
-                       
+
                        /* Read filesystem name and mount point */
                        sscanf(line, "%71s %127s", fs_name, mountp);
-                       
+
                        /* Replace octal codes */
                        oct2chr(mountp);
-                       
+
                        /* Check that total size is not null */
                        if (statfs(mountp, &buf) < 0)
                                continue;
-                       
+
                        if (buf.f_blocks) {
                                fs++;
                        }
index f9c06ad7ce2af49d1c57d65fc799418bc5cfc329..aec790d567cc9d31c023e6577c396c9e42c393b5 100644 (file)
--- a/ioconf.c
+++ b/ioconf.c
@@ -159,7 +159,7 @@ int ioc_init(void)
                strncpy(ioconf_name, IOCONF, 64);
        }
        ioconf_name[63] = '\0';
-       
+
        /* Init ioc_refnr array */
        memset(ioc_refnr, 0, sizeof(ioc_refnr));
 
index c5f942fa9ed01b2146bb3dfa43aa2973df054391..ed0a3a0a90c5c7b8d0a5baa887e14e18f1ed6b99 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -111,7 +111,7 @@ void usage(char *progname)
 void set_disk_output_unit(void)
 {
        char *e;
-       
+
        if (DISPLAY_KILOBYTES(flags) || DISPLAY_MEGABYTES(flags))
                return;
 
@@ -143,7 +143,7 @@ void alarm_handler(int sig)
 void init_stats(void)
 {
        int i;
-       
+
        /* Allocate structures for CPUs "all" and 0 */
        for (i = 0; i < 2; i++) {
                if ((st_cpu[i] = (struct stats_cpu *) malloc(STATS_CPU_SIZE * 2)) == NULL) {
@@ -332,7 +332,7 @@ void io_sys_init(void)
 
        /* Also allocate stat structures for "group" devices */
        iodev_nr += group_nr;
-       
+
        /*
         * Allocate structures for number of disks found, but also
         * for groups of devices if option -g has been entered on the command line.
@@ -398,7 +398,7 @@ void presave_device_list(void)
 void io_sys_free(void)
 {
        int i;
-       
+
        for (i = 0; i < 2; i++) {
                /* Free CPU structures */
                free(st_cpu[i]);
@@ -406,7 +406,7 @@ void io_sys_free(void)
                /* Free I/O device structures */
                free(st_iodev[i]);
        }
-       
+
        free(st_hdr_iodev);
 }
 
@@ -496,7 +496,7 @@ int read_sysfs_file_stat(int curr, char *filename, char *dev_name)
        /* Try to read given stat file */
        if ((fp = fopen(filename, "r")) == NULL)
                return 0;
-       
+
        i = fscanf(fp, "%lu %lu %lu %lu %lu %lu %lu %u %u %u %u",
                   &rd_ios, &rd_merges_or_rd_sec, &rd_sec_or_wr_ios, &rd_ticks_or_wr_sec,
                   &wr_ios, &wr_merges, &wr_sec, &wr_ticks, &ios_pgr, &tot_ticks, &rq_ticks);
@@ -522,7 +522,7 @@ int read_sysfs_file_stat(int curr, char *filename, char *dev_name)
                sdev.wr_ios     = rd_sec_or_wr_ios;
                sdev.wr_sectors = rd_ticks_or_wr_sec;
        }
-       
+
        if ((i == 11) || !DISPLAY_EXTENDED(flags)) {
                /*
                 * In fact, we _don't_ save stats if it's a partition without
@@ -645,10 +645,10 @@ void read_sysfs_stat(int curr)
                        snprintf(filename, MAX_PF_NAME, "%s/%s/%s",
                                 SYSFS_BLOCK, drd->d_name, S_STAT);
                        filename[MAX_PF_NAME - 1] = '\0';
-       
+
                        /* If current entry is a directory, try to read its stat file */
                        ok = read_sysfs_file_stat(curr, filename, drd->d_name);
-       
+
                        /*
                         * If '-p ALL' was entered on the command line,
                         * also try to read stats for its partitions
@@ -907,7 +907,7 @@ void write_ext_stat(int curr, unsigned long long itv, int fctr,
        struct stats_disk sdc, sdp;
        struct ext_disk_stats xds;
        double r_await, w_await;
-       
+
        /*
         * Counters overflows are possible, but don't need to be handled in
         * a special way: The difference is still properly calculated if the
@@ -932,9 +932,9 @@ void write_ext_stat(int curr, unsigned long long itv, int fctr,
        sdp.rd_sect   = ioj->rd_sectors;
        sdc.wr_sect   = ioi->wr_sectors;
        sdp.wr_sect   = ioj->wr_sectors;
-       
+
        compute_ext_disk_stats(&sdc, &sdp, itv, &xds);
-       
+
        r_await = (ioi->rd_ios - ioj->rd_ios) ?
                  (ioi->rd_ticks - ioj->rd_ticks) /
                  ((double) (ioi->rd_ios - ioj->rd_ios)) : 0.0;
@@ -1111,7 +1111,7 @@ void write_stats(int curr, struct tm *rectime)
 
                for (i = 0; i < iodev_nr; i++, shi++) {
                        if (shi->used) {
-       
+
                                if (dlist_idx && !HAS_SYSFS(flags)) {
                                        /*
                                         * With /proc/diskstats, stats for every device
@@ -1128,7 +1128,7 @@ void write_stats(int curr, struct tm *rectime)
                                                /* Device not found in list: Don't display it */
                                                continue;
                                }
-       
+
                                ioi = st_iodev[curr] + i;
                                ioj = st_iodev[!curr] + i;
 
@@ -1136,7 +1136,7 @@ void write_stats(int curr, struct tm *rectime)
                                        if (!ioi->rd_ios && !ioi->wr_ios)
                                                continue;
                                }
-                               
+
                                if (DISPLAY_ZERO_OMIT(flags)) {
                                        if ((ioi->rd_ios == ioj->rd_ios) &&
                                                (ioi->wr_ios == ioj->wr_ios))
@@ -1198,7 +1198,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime)
 {
        int curr = 1;
        int skip = 0;
-       
+
        /* Should we skip first report? */
        if (DISPLAY_OMIT_SINCE_BOOT(flags) && interval > 0) {
                skip = 1;
@@ -1206,7 +1206,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime)
 
        /* Don't buffer data if redirected to a pipe */
        setbuf(stdout, NULL);
-       
+
        do {
                if (cpu_nr > 1) {
                        /*
@@ -1263,7 +1263,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime)
                if (!skip) {
                        /* Print results */
                        write_stats(curr, rectime);
-                       
+
                        if (count > 0) {
                                count--;
                        }
@@ -1319,7 +1319,7 @@ int main(int argc, char **argv)
                            (strspn(argv[opt], DIGITS) != strlen(argv[opt])) &&
                            (strncmp(argv[opt], "-", 1))) {
                                flags |= I_D_UNFILTERED;
-                               
+
                                for (t = strtok(argv[opt], ","); t; t = strtok(NULL, ",")) {
                                        if (!strcmp(t, K_ALL)) {
                                                flags |= I_D_PART_ALL;
@@ -1371,7 +1371,7 @@ int main(int argc, char **argv)
                        }
                        group_nr++;
                }
-               
+
                else if (!strcmp(argv[opt], "-j")) {
                        if (argv[++opt]) {
                                if (strnlen(argv[opt], MAX_FILE_LEN) >= MAX_FILE_LEN - 1) {
@@ -1444,7 +1444,7 @@ int main(int argc, char **argv)
                                        /* Display stats in MB/s */
                                        flags |= I_D_MEGABYTES;
                                        break;
-       
+
                                case 'N':
                                        /* Display device mapper logical name */
                                        flags |= I_D_DEVMAP_NAME;
@@ -1464,7 +1464,7 @@ int main(int argc, char **argv)
                                        /* Display timestamp */
                                        flags |= I_D_TIMESTAMP;
                                        break;
-       
+
                                case 'x':
                                        /* Display extended stats */
                                        flags |= I_D_EXTENDED;
@@ -1474,7 +1474,7 @@ int main(int argc, char **argv)
                                        /* Don't display stats since system restart */
                                        flags |= I_D_OMIT_SINCE_BOOT;
                                        break;
-                                       
+
                                case 'z':
                                        /* Omit output for devices with no activity */
                                        flags |= I_D_ZERO_OMIT;
@@ -1484,7 +1484,7 @@ int main(int argc, char **argv)
                                        /* Print version number and exit */
                                        print_version();
                                        break;
-       
+
                                default:
                                        usage(argv[0]);
                                }
@@ -1499,7 +1499,7 @@ int main(int argc, char **argv)
                         * then don't apply this rule any more.
                         */
                        flags |= I_D_UNFILTERED;
-                       
+
                        if (strcmp(argv[opt], K_ALL)) {
                                /* Store device name entered on the command line */
                                devname = device_name(argv[opt++]);
@@ -1540,7 +1540,7 @@ int main(int argc, char **argv)
        if (!interval) {
                count = 1;
        }
-       
+
        /* Default: Display CPU and DISK reports */
        if (!report_set) {
                flags |= I_D_CPU + I_D_DISK;
@@ -1603,6 +1603,6 @@ int main(int argc, char **argv)
        /* Free structures */
        io_sys_free();
        sfree_dev_list();
-       
+
        return 0;
 }
index 6ade563a402bb7b2e8d2a21fda676415a208c148..7fbe4377ae6ee8f6d03e8bbbf62aa1efebbd83ae 100644 (file)
@@ -123,20 +123,20 @@ __print_funct_t json_print_cpu_stats(struct activity *a, int curr, int tab,
        }
 
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
-               
+
                scc = (struct stats_cpu *) ((char *) a->buf[curr]  + i * a->msize);
                scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
 
                /* Should current CPU (including CPU "all") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
-                       
+
                        /* Yes: Display current CPU stats */
 
                        if (sep) {
                                printf(",\n");
                        }
                        sep = TRUE;
-                       
+
                        if (!i) {
                                /* This is CPU "all" */
                                strcpy(cpuno, "all");
@@ -171,7 +171,7 @@ __print_funct_t json_print_cpu_stats(struct activity *a, int curr, int tab,
                                        g_itv = get_per_cpu_interval(scc, scp);
                                        cpu_offline = FALSE;
                                }
-                               
+
                                if (!g_itv) {
                                        /* Current CPU is offline or tickless */
                                        if (DISPLAY_CPU_DEF(a->opt_flags)) {
@@ -308,17 +308,17 @@ __print_funct_t json_print_irq_stats(struct activity *a, int curr, int tab,
        struct stats_irq *sic, *sip;
        int sep = FALSE;
        char irqno[8];
-       
+
        xprintf(tab++, "\"interrupts\": [");
 
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
 
                sic = (struct stats_irq *) ((char *) a->buf[curr]  + i * a->msize);
                sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
-               
+
                /* Should current interrupt (including int "sum") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
-                       
+
                        /* Yes: Display it */
 
                        if (sep) {
@@ -362,7 +362,7 @@ __print_funct_t json_print_swap_stats(struct activity *a, int curr, int tab,
        struct stats_swap
                *ssc = (struct stats_swap *) a->buf[curr],
                *ssp = (struct stats_swap *) a->buf[!curr];
-       
+
        xprintf0(tab, "\"swap-pages\": {"
                 "\"pswpin\": %.2f, "
                 "\"pswpout\": %.2f}",
@@ -466,7 +466,7 @@ __print_funct_t json_print_memory_stats(struct activity *a, int curr, int tab,
        int sep = FALSE;
 
        xprintf0(tab, "\"memory\": {");
-       
+
        if (DISPLAY_MEM_AMT(a->opt_flags)) {
 
                sep = TRUE;
@@ -525,7 +525,7 @@ __print_funct_t json_print_memory_stats(struct activity *a, int curr, int tab,
                if (sep) {
                        printf(", ");
                }
-               
+
                printf("\"frmpg\": %.2f, "
                       "\"bufpg\": %.2f, "
                       "\"campg\": %.2f",
@@ -556,7 +556,7 @@ __print_funct_t json_print_ktables_stats(struct activity *a, int curr, int tab,
 {
        struct stats_ktables
                *skc = (struct stats_ktables *) a->buf[curr];
-       
+
        xprintf0(tab, "\"kernel\": {"
                 "\"dentunusd\": %u, "
                 "\"file-nr\": %u, "
@@ -584,7 +584,7 @@ __print_funct_t json_print_queue_stats(struct activity *a, int curr, int tab,
 {
        struct stats_queue
                *sqc = (struct stats_queue *) a->buf[curr];
-       
+
        xprintf0(tab, "\"queue\": {"
                 "\"runq-sz\": %lu, "
                 "\"plist-sz\": %u, "
@@ -634,7 +634,7 @@ __print_funct_t json_print_serial_stats(struct activity *a, int curr, int tab,
                                printf(",\n");
                        }
                        sep = TRUE;
-                       
+
                        xprintf0(tab, "{\"line\": %d, "
                                 "\"rcvin\": %.2f, "
                                 "\"xmtin\": %.2f, "
@@ -690,14 +690,14 @@ __print_funct_t json_print_disk_stats(struct activity *a, int curr, int tab,
 
                /* Compute extended statistics values */
                compute_ext_disk_stats(sdc, sdp, itv, &xds);
-               
+
                dev_name = NULL;
                persist_dev_name = NULL;
 
                if (DISPLAY_PERSIST_NAME_S(flags)) {
                        persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
                }
-               
+
                if (persist_dev_name) {
                        dev_name = persist_dev_name;
                }
@@ -711,12 +711,12 @@ __print_funct_t json_print_disk_stats(struct activity *a, int curr, int tab,
                                                       USE_PRETTY_OPTION(flags));
                        }
                }
-               
+
                if (sep) {
                        printf(",\n");
                }
                sep = TRUE;
-               
+
                xprintf0(tab, "{\"disk-device\": \"%s\", "
                         "\"tps\": %.2f, "
                         "\"rd_sec\": %.2f, "
@@ -767,7 +767,7 @@ __print_funct_t json_print_net_dev_stats(struct activity *a, int curr, int tab,
 
        json_markup_network(tab, OPEN_JSON_MARKUP);
        tab++;
-       
+
        xprintf(tab++, "\"net-dev\": [");
 
        for (i = 0; i < a->nr; i++) {
@@ -776,7 +776,7 @@ __print_funct_t json_print_net_dev_stats(struct activity *a, int curr, int tab,
 
                if (!strcmp(sndc->interface, ""))
                        continue;
-               
+
                j = check_net_dev_reg(a, curr, !curr, i);
                sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
 
@@ -784,7 +784,7 @@ __print_funct_t json_print_net_dev_stats(struct activity *a, int curr, int tab,
                        printf(",\n");
                }
                sep = TRUE;
-               
+
                rxkb = S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv);
                txkb = S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv);
                ifutil = compute_ifutil(sndc, rxkb, txkb);
@@ -843,7 +843,7 @@ __print_funct_t json_print_net_edev_stats(struct activity *a, int curr, int tab,
 
        json_markup_network(tab, OPEN_JSON_MARKUP);
        tab++;
-       
+
        xprintf(tab++, "\"net-edev\": [");
 
        for (i = 0; i < a->nr; i++) {
@@ -852,10 +852,10 @@ __print_funct_t json_print_net_edev_stats(struct activity *a, int curr, int tab,
 
                if (!strcmp(snedc->interface, ""))
                        continue;
-               
+
                j = check_net_edev_reg(a, curr, !curr, i);
                snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
-               
+
                if (sep) {
                        printf(",\n");
                }
@@ -911,7 +911,7 @@ __print_funct_t json_print_net_nfs_stats(struct activity *a, int curr, int tab,
        struct stats_net_nfs
                *snnc = (struct stats_net_nfs *) a->buf[curr],
                *snnp = (struct stats_net_nfs *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1010,7 +1010,7 @@ __print_funct_t json_print_net_sock_stats(struct activity *a, int curr, int tab,
 {
        struct stats_net_sock
                *snsc = (struct stats_net_sock *) a->buf[curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1055,7 +1055,7 @@ __print_funct_t json_print_net_ip_stats(struct activity *a, int curr, int tab,
        struct stats_net_ip
                *snic = (struct stats_net_ip *) a->buf[curr],
                *snip = (struct stats_net_ip *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1104,7 +1104,7 @@ __print_funct_t json_print_net_eip_stats(struct activity *a, int curr, int tab,
        struct stats_net_eip
                *sneic = (struct stats_net_eip *) a->buf[curr],
                *sneip = (struct stats_net_eip *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1153,7 +1153,7 @@ __print_funct_t json_print_net_icmp_stats(struct activity *a, int curr, int tab,
        struct stats_net_icmp
                *snic = (struct stats_net_icmp *) a->buf[curr],
                *snip = (struct stats_net_icmp *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1214,7 +1214,7 @@ __print_funct_t json_print_net_eicmp_stats(struct activity *a, int curr, int tab
        struct stats_net_eicmp
                *sneic = (struct stats_net_eicmp *) a->buf[curr],
                *sneip = (struct stats_net_eicmp *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1271,7 +1271,7 @@ __print_funct_t json_print_net_tcp_stats(struct activity *a, int curr, int tab,
        struct stats_net_tcp
                *sntc = (struct stats_net_tcp *) a->buf[curr],
                *sntp = (struct stats_net_tcp *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1312,7 +1312,7 @@ __print_funct_t json_print_net_etcp_stats(struct activity *a, int curr, int tab,
        struct stats_net_etcp
                *snetc = (struct stats_net_etcp *) a->buf[curr],
                *snetp = (struct stats_net_etcp *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1355,7 +1355,7 @@ __print_funct_t json_print_net_udp_stats(struct activity *a, int curr, int tab,
        struct stats_net_udp
                *snuc = (struct stats_net_udp *) a->buf[curr],
                *snup = (struct stats_net_udp *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1395,7 +1395,7 @@ __print_funct_t json_print_net_sock6_stats(struct activity *a, int curr, int tab
 {
        struct stats_net_sock6
                *snsc = (struct stats_net_sock6 *) a->buf[curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1436,7 +1436,7 @@ __print_funct_t json_print_net_ip6_stats(struct activity *a, int curr, int tab,
        struct stats_net_ip6
                *snic = (struct stats_net_ip6 *) a->buf[curr],
                *snip = (struct stats_net_ip6 *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1489,7 +1489,7 @@ __print_funct_t json_print_net_eip6_stats(struct activity *a, int curr, int tab,
        struct stats_net_eip6
                *sneic = (struct stats_net_eip6 *) a->buf[curr],
                *sneip = (struct stats_net_eip6 *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1544,7 +1544,7 @@ __print_funct_t json_print_net_icmp6_stats(struct activity *a, int curr, int tab
        struct stats_net_icmp6
                *snic = (struct stats_net_icmp6 *) a->buf[curr],
                *snip = (struct stats_net_icmp6 *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1611,7 +1611,7 @@ __print_funct_t json_print_net_eicmp6_stats(struct activity *a, int curr, int ta
        struct stats_net_eicmp6
                *sneic = (struct stats_net_eicmp6 *) a->buf[curr],
                *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1666,7 +1666,7 @@ __print_funct_t json_print_net_udp6_stats(struct activity *a, int curr, int tab,
        struct stats_net_udp6
                *snuc = (struct stats_net_udp6 *) a->buf[curr],
                *snup = (struct stats_net_udp6 *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_json_markup;
 
@@ -1716,11 +1716,11 @@ __print_funct_t json_print_pwr_cpufreq_stats(struct activity *a, int curr, int t
        tab++;
 
        xprintf(tab++, "\"cpu-frequency\": [");
-       
+
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
-               
+
                spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr]  + i * a->msize);
-       
+
                /* Should current CPU (including CPU "all") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
 
@@ -1737,14 +1737,14 @@ __print_funct_t json_print_pwr_cpufreq_stats(struct activity *a, int curr, int t
                                printf(",\n");
                        }
                        sep = TRUE;
-                       
+
                        xprintf0(tab, "{\"number\": \"%s\", "
                                 "\"frequency\": %.2f}",
                                 cpuno,
                                 ((double) spc->cpufreq) / 100);
                }
        }
-       
+
        printf("\n");
        xprintf0(--tab, "]");
        tab--;
@@ -1788,7 +1788,7 @@ __print_funct_t json_print_pwr_fan_stats(struct activity *a, int curr, int tab,
                        printf(",\n");
                }
                sep = TRUE;
-               
+
                xprintf0(tab, "{\"number\": %d, "
                         "\"rpm\": %llu, "
                         "\"drpm\": %llu, "
@@ -1842,7 +1842,7 @@ __print_funct_t json_print_pwr_temp_stats(struct activity *a, int curr, int tab,
                        printf(",\n");
                }
                sep = TRUE;
-               
+
                xprintf0(tab, "{\"number\": %d, "
                         "\"degC\": %.2f, "
                         "\"percent-temp\": %.2f, "
@@ -1898,7 +1898,7 @@ __print_funct_t json_print_pwr_in_stats(struct activity *a, int curr, int tab,
                        printf(",\n");
                }
                sep = TRUE;
-               
+
                xprintf0(tab, "{\"number\": %d, "
                         "\"inV\": %.2f, "
                         "\"percent-in\": %.2f, "
@@ -2068,7 +2068,7 @@ __print_funct_t json_print_pwr_usb_stats(struct activity *a, int curr, int tab,
                        printf(",\n");
                }
                sep = TRUE;
-               
+
                xprintf0(tab, "{\"bus_number\": %d, "
                         "\"idvendor\": \"%x\", "
                         "\"idprod\": \"%x\", "
@@ -2124,7 +2124,7 @@ __print_funct_t json_print_filesystem_stats(struct activity *a, int curr, int ta
                        printf(",\n");
                }
                sep = TRUE;
-               
+
                xprintf0(tab, "{\"filesystem\": \"%s\", "
                         "\"MBfsfree\": %.0f, "
                         "\"MBfsused\": %.0f, "
index dad6b86600a016ad7f3806484a354bb5e96e3820..e9eee0a556d4b79146c9f2ca2d1878b43c1cc817 100644 (file)
--- a/mpstat.c
+++ b/mpstat.c
@@ -417,7 +417,7 @@ void write_stats_core(int prev, int curr, int dis,
                        /* Check if we want stats about this proc */
                        if (!(*(cpu_bitmap + (cpu >> 3)) & (1 << (cpu & 0x07))))
                                continue;
-                       
+
                        /*
                         * If the CPU is offline then it is omited from /proc/stat
                         * and the sum of all values is zero.
@@ -442,7 +442,7 @@ void write_stats_core(int prev, int curr, int dis,
 
                        /* Recalculate itv for current proc */
                        pc_itv = get_per_cpu_interval(scc, scp);
-                       
+
                        if (!pc_itv) {
                                /*
                                 * If the CPU is tickless then there is no change in CPU values
@@ -526,7 +526,7 @@ void write_stats_core(int prev, int curr, int dis,
                             scc->cpu_hardirq + scc->cpu_softirq) == 0) {
 
                                /* This is an offline CPU */
-                               
+
                                if (!DISPLAY_ONLINE_CPU(flags)) {
                                        printf("%-11s %4d"
                                               "  %9.2f\n",
@@ -679,11 +679,11 @@ void read_interrupts_stat(char *file, struct stats_irqcpu *st_ic[], int ic_nr, i
                        cp++;
 
                        p = st_ic[curr] + irq;
-                       
+
                        li = line;
                        while (*li == ' ')
                                li++;
-                       
+
                        len = strcspn(li, ":");
                        if (len >= MAX_IRQ_LEN) {
                                len = MAX_IRQ_LEN - 1;
@@ -706,7 +706,7 @@ void read_interrupts_stat(char *file, struct stats_irqcpu *st_ic[], int ic_nr, i
                }
 
                fclose(fp);
-               
+
                free(line);
        }
 
@@ -756,7 +756,7 @@ void rw_mpstat_loop(int dis_hdr, int rows)
                /* Read this file to display int per CPU or total nr of int per CPU */
                read_interrupts_stat(INTERRUPTS, st_irqcpu, irqcpu_nr, 0);
        }
-       
+
        if (DISPLAY_SOFTIRQS(actflags)) {
                read_interrupts_stat(SOFTIRQS, st_softirqcpu, softirqcpu_nr, 0);
        }
@@ -798,7 +798,7 @@ void rw_mpstat_loop(int dis_hdr, int rows)
        sigaction(SIGINT, &int_act, NULL);
 
        pause();
-       
+
        if (sigint_caught)
                /* SIGINT signal caught during first interval: Exit immediately */
                return;
@@ -850,11 +850,11 @@ void rw_mpstat_loop(int dis_hdr, int rows)
                if (count > 0) {
                        count--;
                }
-               
+
                if (count) {
-                       
+
                        pause();
-                       
+
                        if (sigint_caught) {
                                /* SIGINT signal caught => Display average stats */
                                count = 0;
@@ -894,7 +894,7 @@ int main(int argc, char **argv)
 
        /* What is the highest processor number on this machine? */
        cpu_nr = get_cpu_nr(~0, TRUE);
-       
+
        /* Calculate number of interrupts per processor */
        irqcpu_nr = get_irqcpu_nr(INTERRUPTS, NR_IRQS, cpu_nr) +
                    NR_IRQCPU_PREALLOC;
@@ -942,7 +942,7 @@ int main(int argc, char **argv)
                        if (argv[++opt]) {
                                flags |= F_P_OPTION;
                                dis_hdr++;
-                               
+
                                for (t = strtok(argv[opt], ","); t; t = strtok(NULL, ",")) {
                                        if (!strcmp(t, K_ALL) || !strcmp(t, K_ON)) {
                                                if (cpu_nr) {
@@ -989,7 +989,7 @@ int main(int argc, char **argv)
                                        flags |= F_P_OPTION;
                                        memset(cpu_bitmap, 0xff, ((cpu_nr + 1) >> 3) + 1);
                                        break;
-                                       
+
                                case 'u':
                                        /* Display CPU */
                                        actflags |= M_D_CPU;
@@ -1043,7 +1043,7 @@ int main(int argc, char **argv)
        if (count_bits(&actflags, sizeof(unsigned int)) > 1) {
                dis_hdr = 9;
        }
-       
+
        if (!USE_P_OPTION(flags)) {
                /* Option -P not used: Set bit 0 (global stats among all proc) */
                *cpu_bitmap = 1;
index f5f1ab8c04a48b413ab94ed0f8ad41c5f4c32de1..cb49cde786830e9b415ef53620aafe1668600030 100644 (file)
@@ -191,7 +191,7 @@ void free_inactive_entries(void)
 void io_sys_init(void)
 {
        int i;
-       
+
        /* How many processors on this machine? */
        cpu_nr = get_cpu_nr(~0, FALSE);
 
@@ -203,7 +203,7 @@ void io_sys_init(void)
                perror("malloc");
                exit(4);
        }
-       
+
        /* Allocate structures for number of NFS directories found */
        for (i = 0; i < 2; i++) {
                if ((st_ionfs[i] =
@@ -227,7 +227,7 @@ void io_sys_free(void)
        for (i = 0; i < 2; i++) {
                free(st_ionfs[i]);
        }
-       
+
        free(st_hdr_ionfs);
 }
 
@@ -589,7 +589,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime)
 
        /* Don't buffer data if redirected to a pipe */
        setbuf(stdout, NULL);
-       
+
        do {
                if (cpu_nr > 1) {
                        /*
@@ -660,7 +660,7 @@ int main(int argc, char **argv)
                                        /* Display an easy-to-read NFS report */
                                        flags |= I_D_HUMAN_READ;
                                        break;
-       
+
                                case 'k':
                                        if (DISPLAY_MEGABYTES(flags)) {
                                                usage(argv[0]);
@@ -686,7 +686,7 @@ int main(int argc, char **argv)
                                        /* Print version number and exit */
                                        print_version();
                                        break;
-       
+
                                default:
                                        usage(argv[0]);
                                }
index 5dad91ec9ac5ea0e4601aaec83de8c580b48b941..9e88a6f9a1cbb0732fdf40644cf637f055aae0a2 100644 (file)
--- a/pidstat.c
+++ b/pidstat.c
@@ -172,7 +172,7 @@ void salloc_pid(unsigned int len)
 void sfree_pid(void)
 {
        int i;
-       
+
        for (i = 0; i < 3; i++) {
                free(st_pid_list[i]);
        }
@@ -261,7 +261,7 @@ int update_pid_array(unsigned int *pid_array_nr, unsigned int pid)
 void print_comm(struct pid_stats *pst)
 {
        char *p;
-       
+
        if (DISPLAY_CMDLINE(pidflag) && strlen(pst->cmdline)) {
                p = pst->cmdline;
        }
@@ -506,13 +506,13 @@ int read_proc_pid_cmdline(unsigned int pid, struct pid_stats *pst,
                return 1;
 
        memset(line, 0, MAX_CMDLINE_LEN);
-       
+
        if ((len = fread(line, 1, MAX_CMDLINE_LEN - 1, fp)) < 0) {
                /* Nothing to read doesn't mean that process no longer exists */
                fclose(fp);
                return 1;
        }
-       
+
        for (i = 0; i < len; i++) {
                if (line[i] == '\0') {
                        line[i] = ' ';
@@ -625,7 +625,7 @@ int read_proc_pid_fd(unsigned int pid, struct pid_stats *pst,
                pst->flags |= F_NO_PID_FD;
                return 0;
        }
-       
+
        pst->fd_nr = 0;
 
        /* Count number of entries if fd directory */
@@ -670,7 +670,7 @@ int read_pid_stats(unsigned int pid, struct pid_stats *pst,
                if (read_proc_pid_cmdline(pid, pst, tgid))
                        return 1;
        }
-       
+
        if (read_proc_pid_status(pid, pst, tgid))
                return 1;
 
@@ -678,7 +678,7 @@ int read_pid_stats(unsigned int pid, struct pid_stats *pst,
                if (read_proc_pid_smap(pid, pst, tgid))
                        return 1;
        }
-       
+
        if (DISPLAY_KTAB(actflag)) {
                if (read_proc_pid_fd(pid, pst, tgid))
                        return 1;
@@ -905,12 +905,12 @@ void read_stats(int curr)
                        if (drp) {
                                pst = st_pid_list[curr] + p++;
                                pid = atoi(drp->d_name);
-       
+
                                if (read_pid_stats(pid, pst, &thr_nr, 0)) {
                                        /* Process has terminated */
                                        pst->pid = 0;
                                }
-       
+
                                else if (DISPLAY_TID(pidflag)) {
                                        /* Read stats for threads in task subdirectory */
                                        read_task_stats(curr, pid, &p);
@@ -938,7 +938,7 @@ void read_stats(int curr)
                        if (p >= pid_nr)
                                break;
                        pst = st_pid_list[curr] + p++;
-       
+
                        if (pid_array[op]) {
                                /* PID should still exist. So read its stats */
                                if (read_pid_stats(pid_array[op], pst, &thr_nr, 0)) {
@@ -956,7 +956,7 @@ void read_stats(int curr)
                        pst = st_pid_list[curr] + q;
                        pst->pid = 0;
                }
-               
+
        }
        /* else unknown command */
 }
@@ -1005,7 +1005,7 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity,
 
                /* Look for previous stats for same PID */
                q = p;
-       
+
                do {
                        *pstp = st_pid_list[prev] + q;
                        if (((*pstp)->pid == (*pstc)->pid) &&
@@ -1026,7 +1026,7 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity,
 
                if (DISPLAY_ACTIVE_PID(pidflag)) {
                        int isActive = FALSE;
-                       
+
                        /* Check that it's an "active" process */
                        if (DISPLAY_CPU(activity)) {
                                /* User time already includes guest time */
@@ -1048,7 +1048,7 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity,
                                        }
                                }
                        }
-                       
+
                        if (DISPLAY_MEM(activity) && (!isActive)) {
                                if (((*pstc)->minflt != (*pstp)->minflt) ||
                                    ((*pstc)->majflt != (*pstp)->majflt)) {
@@ -1100,7 +1100,7 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity,
                                        isActive = TRUE;
                                }
                        }
-                       
+
                        if (DISPLAY_KTAB(activity) && (!isActive) &&
                                /* /proc/#/fd directory should be readable */
                                !(NO_PID_FD((*pstc)->flags))) {
@@ -1109,13 +1109,13 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity,
                                        isActive = TRUE;
                                }
                        }
-                       
+
                        /* If PID isn't active for any of the activities then return */
                        if (!isActive)
                                return -1;
                }
        }
-       
+
        else if (DISPLAY_PID(pidflag)) {
                *pstp = st_pid_list[prev] + p;
                if (!(*pstp)->pid) {
@@ -1136,7 +1136,7 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity,
                if (regcomp(&regex, commstr, REG_EXTENDED | REG_NOSUB) != 0)
                        /* Error in preparing regex structure */
                        return -1;
-               
+
                rc = regexec(&regex, (*pstc)->comm, 0, NULL, 0);
                regfree(&regex);
 
@@ -1144,7 +1144,7 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity,
                        /* regex pattern not found in command name */
                        return -1;
        }
-       
+
        if (USER_STRING(pidflag)) {
                if ((pwdent = getpwuid((*pstc)->uid)) != NULL) {
                        if (strcmp(pwdent->pw_name, userstr))
@@ -1176,9 +1176,9 @@ void __print_line_id(struct pid_stats *pst, char c)
        else {
                printf(" %5d", pst->uid);
        }
-       
+
        if (DISPLAY_TID(pidflag)) {
-               
+
                if (pst->tgid) {
                        /* This is a TID */
                        sprintf(format, "         %c %%9u", c);
@@ -1207,7 +1207,7 @@ void __print_line_id(struct pid_stats *pst, char c)
 void print_line_id(char *timestamp, struct pid_stats *pst)
 {
        printf("%-11s", timestamp);
-       
+
        __print_line_id(pst, '-');
 }
 
@@ -1337,7 +1337,7 @@ int write_pid_task_all_stats(int prev, int curr, int dis,
                                printf(" %7u", pstc->fd_nr);
                        }
                }
-               
+
                print_comm(pstc);
                again = 1;
        }
@@ -1452,11 +1452,11 @@ int write_pid_task_cpu_stats(int prev, int curr, int dis, int disp_avg,
        }
 
        for (p = 0; p < pid_nr; p++) {
-       
+
                if (get_pid_to_display(prev, curr, p, P_A_CPU, P_TASK,
                                       &pstc, &pstp) <= 0)
                        continue;
-       
+
                print_line_id(curr_string, pstc);
                printf(" %7.2f %7.2f %7.2f %7.2f",
                       (pstc->utime - pstc->gtime) < (pstp->utime - pstp->gtime) ?
@@ -1519,17 +1519,17 @@ int write_pid_child_cpu_stats(int prev, int curr, int dis, int disp_avg,
        }
 
        for (p = 0; p < pid_nr; p++) {
-       
+
                if ((rc = get_pid_to_display(prev, curr, p, P_A_CPU, P_CHILD,
                                             &pstc, &pstp)) == 0)
                        /* PID no longer exists */
                        continue;
-       
+
                /* This will be used to compute average */
                if (!disp_avg) {
                        pstc->uc_asum_count = pstp->uc_asum_count + 1;
                }
-       
+
                if (rc < 0)
                        /* PID should not be displayed */
                        continue;
@@ -1566,7 +1566,7 @@ int write_pid_child_cpu_stats(int prev, int curr, int dis, int disp_avg,
                print_comm(pstc);
                again = 1;
        }
-       
+
        return again;
 }
 
@@ -1604,14 +1604,14 @@ int write_pid_task_memory_stats(int prev, int curr, int dis, int disp_avg,
                PRINT_ID_HDR(prev_string, pidflag);
                printf("  minflt/s  majflt/s     VSZ    RSS   %%MEM  Command\n");
        }
-       
+
        for (p = 0; p < pid_nr; p++) {
-       
+
                if ((rc = get_pid_to_display(prev, curr, p, P_A_MEM, P_TASK,
                                             &pstc, &pstp)) == 0)
                        /* PID no longer exists */
                        continue;
-       
+
                /* This will be used to compute average */
                if (!disp_avg) {
                        pstc->total_vsz = pstp->total_vsz + pstc->vsz;
@@ -1624,7 +1624,7 @@ int write_pid_task_memory_stats(int prev, int curr, int dis, int disp_avg,
                        continue;
 
                print_line_id(curr_string, pstc);
-               
+
                printf(" %9.2f %9.2f ",
                       S_VALUE(pstp->minflt, pstc->minflt, itv),
                       S_VALUE(pstp->majflt, pstc->majflt, itv));
@@ -1643,7 +1643,7 @@ int write_pid_task_memory_stats(int prev, int curr, int dis, int disp_avg,
                               pstc->rss,
                               tlmkb ? SP_VALUE(0, pstc->rss, tlmkb) : 0.0);
                }
-               
+
                print_comm(pstc);
                again = 1;
        }
@@ -1683,9 +1683,9 @@ int write_pid_child_memory_stats(int prev, int curr, int dis, int disp_avg,
                PRINT_ID_HDR(prev_string, pidflag);
                printf(" minflt-nr majflt-nr  Command\n");
        }
-       
+
        for (p = 0; p < pid_nr; p++) {
-       
+
                if ((rc = get_pid_to_display(prev, curr, p, P_A_MEM, P_CHILD,
                                             &pstc, &pstp)) == 0)
                        /* PID no longer exists */
@@ -1695,7 +1695,7 @@ int write_pid_child_memory_stats(int prev, int curr, int dis, int disp_avg,
                if (!disp_avg) {
                        pstc->rc_asum_count = pstp->rc_asum_count + 1;
                }
-       
+
                if (rc < 0)
                        /* PID should not be displayed */
                        continue;
@@ -1754,14 +1754,14 @@ int write_pid_stack_stats(int prev, int curr, int dis, int disp_avg,
                PRINT_ID_HDR(prev_string, pidflag);
                printf(" StkSize  StkRef  Command\n");
        }
-       
+
        for (p = 0; p < pid_nr; p++) {
-       
+
                if ((rc = get_pid_to_display(prev, curr, p, P_A_STACK, P_NULL,
                                             &pstc, &pstp)) == 0)
                        /* PID no longer exists */
                        continue;
-       
+
                /* This will be used to compute average */
                if (!disp_avg) {
                        pstc->total_stack_size = pstp->total_stack_size + pstc->stack_size;
@@ -1774,7 +1774,7 @@ int write_pid_stack_stats(int prev, int curr, int dis, int disp_avg,
                        continue;
 
                print_line_id(curr_string, pstc);
-               
+
                if (disp_avg) {
                        printf(" %7.0f %7.0f",
                               (double) pstc->total_stack_size / pstc->sk_asum_count,
@@ -1834,16 +1834,16 @@ int write_pid_io_stats(int prev, int curr, int dis, int disp_avg,
                                             &pstc, &pstp)) == 0)
                        /* PID no longer exists */
                        continue;
-               
+
                /* This will be used to compute average delays */
                if (!disp_avg) {
                        pstc->delay_asum_count = pstp->delay_asum_count + 1;
                }
-               
+
                if (rc < 0)
                        /* PID should not be displayed */
                        continue;
-       
+
                print_line_id(curr_string, pstc);
                if (!NO_PID_IO(pstc->flags)) {
                        printf(" %9.2f %9.2f %9.2f",
@@ -1865,7 +1865,7 @@ int write_pid_io_stats(int prev, int curr, int dis, int disp_avg,
                else {
                        printf(" %7llu", pstc->blkio_swapin_delays - pstp->blkio_swapin_delays);
                }
-               
+
                print_comm(pstc);
                again = 1;
        }
@@ -1908,11 +1908,11 @@ int write_pid_ctxswitch_stats(int prev, int curr, int dis,
        }
 
        for (p = 0; p < pid_nr; p++) {
-       
+
                if (get_pid_to_display(prev, curr, p, P_A_CTXSW, P_NULL,
                                       &pstc, &pstp) <= 0)
                        continue;
-       
+
                print_line_id(curr_string, pstc);
                printf(" %9.2f %9.2f",
                       S_VALUE(pstp->nvcsw, pstc->nvcsw, itv),
@@ -1959,14 +1959,14 @@ int write_pid_ktab_stats(int prev, int curr, int dis, int disp_avg,
                printf(" threads   fd-nr");
                printf("  Command\n");
        }
-       
+
        for (p = 0; p < pid_nr; p++) {
-       
+
                if ((rc = get_pid_to_display(prev, curr, p, P_A_KTAB, P_NULL,
                                             &pstc, &pstp)) == 0)
                        /* PID no longer exists */
                        continue;
-       
+
                /* This will be used to compute average */
                if (!disp_avg) {
                        pstc->total_threads = pstp->total_threads + pstc->threads;
@@ -2176,7 +2176,7 @@ void rw_pidstat_loop(int dis_hdr, int rows)
 
        /* Don't buffer data if redirected to a pipe */
        setbuf(stdout, NULL);
-       
+
        if (cpu_nr > 1) {
                /*
                 * Read system uptime (only for SMP machines).
@@ -2224,7 +2224,7 @@ void rw_pidstat_loop(int dis_hdr, int rows)
        if (sigint_caught)
                /* SIGINT signal caught during first interval: Exit immediately */
                return;
-       
+
        do {
                /* Get time */
                get_localtime(&ps_tstamp[curr], 0);
@@ -2261,9 +2261,9 @@ void rw_pidstat_loop(int dis_hdr, int rows)
                }
 
                if (count) {
-                       
+
                        pause();
-       
+
                        if (sigint_caught) {
                                /* SIGINT signal caught => Display average stats */
                                count = 0;
@@ -2305,13 +2305,13 @@ int main(int argc, char **argv)
        /* Init National Language Support */
        init_nls();
 #endif
-       
+
        /* Get HZ */
        get_HZ();
 
        /* Compute page shift in kB */
        get_kb_shift();
-       
+
        /* Allocate structures for device list */
        if (argc > 1) {
                salloc_pid_array((argc / 2) + count_csvalues(argc, argv));
@@ -2387,7 +2387,7 @@ int main(int argc, char **argv)
                                usage(argv[0]);
                        }
                }
-               
+
                /* Option used individually. See below for grouped option */
                else if (!strcmp(argv[opt], "-U")) {
                        /* Display username instead of UID */
@@ -2413,7 +2413,7 @@ int main(int argc, char **argv)
                                        actflag |= P_A_IO;
                                        dis_hdr++;
                                        break;
-                                       
+
                                case 'h':
                                        /* Display stats on one line */
                                        pidflag |= P_D_ONELINE;
@@ -2423,24 +2423,24 @@ int main(int argc, char **argv)
                                        /* IRIX mode off */
                                        pidflag |= P_F_IRIX_MODE;
                                        break;
-                                       
+
                                case 'l':
                                        /* Display whole command line */
                                        pidflag |= P_D_CMDLINE;
                                        break;
-       
+
                                case 'r':
                                        /* Display memory usage */
                                        actflag |= P_A_MEM;
                                        dis_hdr++;
                                        break;
-                                       
+
                                case 's':
                                        /* Display stack sizes */
                                        actflag |= P_A_STACK;
                                        dis_hdr++;
                                        break;
-       
+
                                case 't':
                                        /* Display stats for threads */
                                        pidflag |= P_D_TID;
@@ -2450,7 +2450,7 @@ int main(int argc, char **argv)
                                        /* When option is grouped, it cannot take an arg */
                                        pidflag |= P_D_USERNAME;
                                        break;
-                                       
+
                                case 'u':
                                        /* Display CPU usage */
                                        actflag |= P_A_CPU;
@@ -2473,7 +2473,7 @@ int main(int argc, char **argv)
                                        actflag |= P_A_CTXSW;
                                        dis_hdr++;
                                        break;
-       
+
                                default:
                                        usage(argv[0]);
                                }
@@ -2540,7 +2540,7 @@ int main(int argc, char **argv)
 
        /* Main loop */
        rw_pidstat_loop(dis_hdr, rows);
-       
+
        /* Free structures */
        free(pid_array);
        sfree_pid();
index ade2b217c0ec627a2fe7a0b4bcdcd583e0dc1325..6c1064d1cb08fd735f785990dee30122b1a1bb95 100644 (file)
@@ -73,9 +73,9 @@ __print_funct_t print_cpu_stats(struct activity *a, int prev, int curr,
                               timestamp[!curr]);
                }
        }
-       
+
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
-               
+
                /*
                 * The size of a->buf[...] CPU structure may be different from the default
                 * sizeof(struct stats_cpu) value if data have been read from a file!
@@ -92,13 +92,13 @@ __print_funct_t print_cpu_stats(struct activity *a, int prev, int curr,
                 * used by sadc to create a file, and the version of sysstat
                 * used by sar to read it...
                 */
-               
+
                /* Should current CPU (including CPU "all") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
-                       
+
                        /* Yes: Display it */
                        printf("%-11s", timestamp[curr]);
-                       
+
                        if (!i) {
                                /* This is CPU "all" */
                                printf("     all");
@@ -121,12 +121,12 @@ __print_funct_t print_cpu_stats(struct activity *a, int prev, int curr,
                                         * jump from zero when the CPU comes back online.
                                         */
                                        *scc = *scp;
-                                       
+
                                        /* %user, %nice, %system, %iowait, %steal, ..., %idle */
                                        printf("    %6.2f    %6.2f    %6.2f"
                                               "    %6.2f    %6.2f    %6.2f",
                                               0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
-                                       
+
                                        if (DISPLAY_CPU_ALL(a->opt_flags)) {
                                                /*
                                                 * Four additional fields to display:
@@ -138,10 +138,10 @@ __print_funct_t print_cpu_stats(struct activity *a, int prev, int curr,
                                        printf("\n");
                                        continue;
                                }
-                               
+
                                /* Recalculate interval for current proc */
                                g_itv = get_per_cpu_interval(scc, scp);
-                               
+
                                if (!g_itv) {
                                        /*
                                         * If the CPU is tickless then there is no change in CPU values
@@ -166,7 +166,7 @@ __print_funct_t print_cpu_stats(struct activity *a, int prev, int curr,
                                        continue;
                                }
                        }
-                       
+
                        if (DISPLAY_CPU_DEF(a->opt_flags)) {
                                printf("    %6.2f    %6.2f    %6.2f    %6.2f    %6.2f    %6.2f\n",
                                       ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv),
@@ -223,7 +223,7 @@ __print_funct_t print_pcsw_stats(struct activity *a, int prev, int curr,
        struct stats_pcsw
                *spc = (struct stats_pcsw *) a->buf[curr],
                *spp = (struct stats_pcsw *) a->buf[prev];
-       
+
        if (dis) {
                printf("\n%-11s    proc/s   cswch/s\n", timestamp[!curr]);
        }
@@ -249,16 +249,16 @@ __print_funct_t print_irq_stats(struct activity *a, int prev, int curr,
 {
        int i;
        struct stats_irq *sic, *sip;
-       
+
        if (dis) {
                printf("\n%-11s      INTR    intr/s\n", timestamp[!curr]);
        }
-       
+
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
 
                sic = (struct stats_irq *) ((char *) a->buf[curr] + i * a->msize);
                sip = (struct stats_irq *) ((char *) a->buf[prev] + i * a->msize);
-               
+
                /*
                 * Note: a->nr is in [0, NR_IRQS + 1].
                 * Bitmap size is provided for (NR_IRQS + 1) interrupts.
@@ -266,10 +266,10 @@ __print_funct_t print_irq_stats(struct activity *a, int prev, int curr,
                 * used by sadc to create a file, and the version of sysstat
                 * used by sar to read it...
                 */
-               
+
                /* Should current interrupt (including int "sum") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
-                       
+
                        /* Yes: Display it */
                        printf("%-11s", timestamp[curr]);
                        if (!i) {
@@ -303,7 +303,7 @@ __print_funct_t print_swap_stats(struct activity *a, int prev, int curr,
        struct stats_swap
                *ssc = (struct stats_swap *) a->buf[curr],
                *ssp = (struct stats_swap *) a->buf[prev];
-       
+
        if (dis) {
                printf("\n%-11s  pswpin/s pswpout/s\n", timestamp[!curr]);
        }
@@ -416,7 +416,7 @@ void stub_print_memory_stats(struct activity *a, int prev, int curr,
                avg_frskb = 0,
                avg_tlskb = 0,
                avg_caskb = 0;
-       
+
        if (DISPLAY_MEMORY(a->opt_flags)) {
                if (dis) {
                        printf("\n%-11s   frmpg/s   bufpg/s   campg/s\n",
@@ -428,7 +428,7 @@ void stub_print_memory_stats(struct activity *a, int prev, int curr,
                       S_VALUE((double) KB_TO_PG(smp->bufkb), (double) KB_TO_PG(smc->bufkb), itv),
                       S_VALUE((double) KB_TO_PG(smp->camkb), (double) KB_TO_PG(smc->camkb), itv));
        }
-       
+
        if (DISPLAY_MEM_AMT(a->opt_flags)) {
                if (dis) {
                        printf("\n%-11s kbmemfree kbmemused  %%memused kbbuffers  kbcached"
@@ -484,13 +484,13 @@ void stub_print_memory_stats(struct activity *a, int prev, int curr,
                               (double) avg_activekb / avg_count,
                               (double) avg_inactkb / avg_count,
                               (double) avg_dirtykb / avg_count);
-                       
+
                        /* Reset average counters */
                        avg_frmkb = avg_bufkb = avg_camkb = avg_comkb = 0;
                        avg_activekb = avg_inactkb = avg_dirtykb = 0;
                }
        }
-       
+
        if (DISPLAY_SWAP(a->opt_flags)) {
                if (dis) {
                        printf("\n%-11s kbswpfree kbswpused  %%swpused  kbswpcad   %%swpcad\n",
@@ -536,7 +536,7 @@ void stub_print_memory_stats(struct activity *a, int prev, int curr,
                                        ((double) avg_tlskb / avg_count) -
                                        ((double) avg_frskb / avg_count)) :
                               0.0);
-                       
+
                        /* Reset average counters */
                        avg_frskb = avg_tlskb = avg_caskb = 0;
                }
@@ -597,8 +597,8 @@ void stub_print_ktables_stats(struct activity *a, int curr, int dispavg)
                avg_file_used   = 0,
                avg_inode_used  = 0,
                avg_pty_nr      = 0;
-               
-       
+
+
        if (dis) {
                printf("\n%-11s dentunusd   file-nr  inode-nr    pty-nr\n",
                       timestamp[!curr]);
@@ -691,7 +691,7 @@ void stub_print_queue_stats(struct activity *a, int curr, int dispavg)
                avg_load_avg_5    = 0,
                avg_load_avg_15   = 0,
                avg_procs_blocked = 0;
-       
+
        if (dis) {
                printf("\n%-11s   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked\n",
                       timestamp[!curr]);
@@ -851,14 +851,14 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
 
                /* Compute service time, etc. */
                compute_ext_disk_stats(sdc, sdp, itv, &xds);
-               
+
                dev_name = NULL;
                persist_dev_name = NULL;
 
                if (DISPLAY_PERSIST_NAME_S(flags)) {
                        persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
                }
-               
+
                if (persist_dev_name) {
                        dev_name = persist_dev_name;
                }
@@ -872,7 +872,7 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
                                                       USE_PRETTY_OPTION(flags));
                        }
                }
-               
+
                printf("%-11s %9s %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f\n",
                       timestamp[curr],
                       /* Confusion possible here between index and minor numbers */
@@ -918,7 +918,7 @@ __print_funct_t print_net_dev_stats(struct activity *a, int prev, int curr,
 
                if (!strcmp(sndc->interface, ""))
                        continue;
-               
+
                j = check_net_dev_reg(a, curr, prev, i);
                sndp = (struct stats_net_dev *) ((char *) a->buf[prev] + j * a->msize);
 
@@ -926,7 +926,7 @@ __print_funct_t print_net_dev_stats(struct activity *a, int prev, int curr,
 
                rxkb = S_VALUE(sndp->rx_bytes, sndc->rx_bytes, itv);
                txkb = S_VALUE(sndp->tx_bytes, sndc->tx_bytes, itv);
-               
+
                printf(" %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f",
                       S_VALUE(sndp->rx_packets,    sndc->rx_packets,    itv),
                       S_VALUE(sndp->tx_packets,    sndc->tx_packets,    itv),
@@ -935,7 +935,7 @@ __print_funct_t print_net_dev_stats(struct activity *a, int prev, int curr,
                       S_VALUE(sndp->rx_compressed, sndc->rx_compressed, itv),
                       S_VALUE(sndp->tx_compressed, sndc->tx_compressed, itv),
                       S_VALUE(sndp->multicast,     sndc->multicast,     itv));
-               
+
                ifutil = compute_ifutil(sndc, rxkb, txkb);
                printf("    %6.2f\n", ifutil);
        }
@@ -970,7 +970,7 @@ __print_funct_t print_net_edev_stats(struct activity *a, int prev, int curr,
 
                if (!strcmp(snedc->interface, ""))
                        continue;
-               
+
                j = check_net_edev_reg(a, curr, prev, i);
                snedp = (struct stats_net_edev *) ((char *) a->buf[prev] + j * a->msize);
 
@@ -1006,7 +1006,7 @@ __print_funct_t print_net_nfs_stats(struct activity *a, int prev, int curr,
        struct stats_net_nfs
                *snnc = (struct stats_net_nfs *) a->buf[curr],
                *snnp = (struct stats_net_nfs *) a->buf[prev];
-       
+
        if (dis) {
                printf("\n%-11s    call/s retrans/s    read/s   write/s  access/s"
                       "  getatt/s\n", timestamp[!curr]);
@@ -1082,7 +1082,7 @@ void stub_print_net_sock_stats(struct activity *a, int curr, int dispavg)
                avg_raw_inuse  = 0,
                avg_frag_inuse = 0,
                avg_tcp_tw     = 0;
-       
+
        if (dis) {
                printf("\n%-11s    totsck    tcpsck    udpsck    rawsck   ip-frag    tcp-tw\n",
                       timestamp[!curr]);
@@ -1422,7 +1422,7 @@ void stub_print_net_sock6_stats(struct activity *a, int curr, int dispavg)
                avg_udp6_inuse  = 0,
                avg_raw6_inuse  = 0,
                avg_frag6_inuse = 0;
-       
+
        if (dis) {
                printf("\n%-11s   tcp6sck   udp6sck   raw6sck  ip6-frag\n",
                       timestamp[!curr]);
@@ -1699,7 +1699,7 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
        struct stats_pwr_cpufreq *spc;
        static unsigned long long
                *avg_cpufreq = NULL;
-       
+
        if (!avg_cpufreq) {
                /* Allocate array of CPU frequency */
                if ((avg_cpufreq = (unsigned long long *) malloc(sizeof(unsigned long long) * a->nr))
@@ -1709,14 +1709,14 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
                }
                memset(avg_cpufreq, 0, sizeof(unsigned long long) * a->nr);
        }
-       
+
        if (dis) {
                printf("\n%-11s     CPU       MHz\n",
                       timestamp[!curr]);
        }
 
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
-               
+
                /*
                 * The size of a->buf[...] CPU structure may be different from the default
                 * sizeof(struct stats_pwr_cpufreq) value if data have been read from a file!
@@ -1732,13 +1732,13 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
                 * used by sadc to create a file, and the version of sysstat
                 * used by sar to read it...
                 */
-               
+
                /* Should current CPU (including CPU "all") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
 
                        /* Yes: Display it */
                        printf("%-11s", timestamp[curr]);
-                       
+
                        if (!i) {
                                /* This is CPU "all" */
                                printf("     all");
@@ -1746,7 +1746,7 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
                        else {
                                printf("     %3d", i - 1);
                        }
-                       
+
                        if (!dispavg) {
                                /* Display instantaneous values */
                                printf(" %9.2f\n",
@@ -1760,11 +1760,11 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
                        else {
                                /* Display average values */
                                printf(" %9.2f\n",
-                                      (double) avg_cpufreq[i] / (100 * avg_count));                            
+                                      (double) avg_cpufreq[i] / (100 * avg_count));
                        }
                }
        }
-       
+
        if (dispavg) {
                /* Array of CPU frequency no longer needed: Free it! */
                if (avg_cpufreq) {
@@ -1987,7 +1987,7 @@ void stub_print_pwr_temp_stats(struct activity *a, int curr, int dispavg)
                        avg_temp_min[i] = spc->temp_min;
                        avg_temp_max[i] = spc->temp_max;
                }
-               
+
                printf(" %*s\n", MAX_SENSORS_DEV_LEN, spc->device);
        }
 
@@ -2356,14 +2356,14 @@ void stub_print_pwr_usb_stats(struct activity *a, int curr, int dispavg)
                printf(" %*s", MAX_MANUF_LEN - 1, "manufact");
                printf(" %*s\n", MAX_PROD_LEN - 1, "product");
        }
-       
+
        for (i = 0; i < a->nr; i++) {
                suc = (struct stats_pwr_usb *) ((char *) a->buf[curr] + i * a->msize);
 
                if (!suc->bus_nr)
                        /* Bus#0 doesn't exist: We are at the end of the list */
                        break;
-               
+
                printf("%-11s  %6d %9x %9x %9u",
                       (dispavg ? _("Summary") : timestamp[curr]),
                       suc->bus_nr,
@@ -2409,7 +2409,7 @@ void stub_print_pwr_usb_stats(struct activity *a, int curr, int dispavg)
                        }
                }
        }
-}      
+}
 
 /*
  ***************************************************************************
@@ -2461,7 +2461,7 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int curr, int di
        int i, j;
        struct stats_filesystem *sfc, *sfm;
 
-       
+
        if (dis) {
                printf("\n%-11s  MBfsfree  MBfsused   %%fsused  %%ufsused"
                       "     Ifree     Iused    %%Iused FILESYSTEM\n",
@@ -2470,11 +2470,11 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int curr, int di
 
        for (i = 0; i < a->nr; i++) {
                sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
-                       
+
                if (!sfc->f_blocks)
                        /* Size of filesystem is null: We are at the end of the list */
                        break;
-                       
+
                printf("%-11s %9.0f %9.0f    %6.2f    %6.2f"
                       " %9llu %9llu    %6.2f %s\n",
                       (dispavg ? _("Summary") : timestamp[curr]),
@@ -2490,12 +2490,12 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int curr, int di
                       sfc->f_files ? SP_VALUE(sfc->f_ffree, sfc->f_files, sfc->f_files)
                                    : 0.0,
                       sfc->fs_name);
-               
+
                if (!dispavg) {
                        /* Save current filesystem in summary list */
                        for (j = 0; j < a->nr; j++) {
                                sfm = (struct stats_filesystem *) ((char *) a->buf[2] + j * a->msize);
-                               
+
                                if (!strcmp(sfm->fs_name, sfc->fs_name) ||
                                    !sfm->f_blocks) {
                                        /*
index 72209488c941495d85eb9a8e995a6347c7c4b246..384e5be8cf40c86b404bdfa9359c92536a1345c8 100644 (file)
@@ -70,7 +70,7 @@ void read_fan(struct stats_pwr_fan *st_pwr_fan, int nbr)
                                j = 0;
                                st_pwr_fan_i = st_pwr_fan + count;
                                sensors_snprintf_chip_name(st_pwr_fan_i->device, MAX_SENSORS_DEV_LEN, chip);
-                               
+
                                while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
                                        if ((sub->type == SENSORS_SUBFEATURE_FAN_INPUT) &&
                                            (sub->flags & SENSORS_MODE_R)) {
@@ -124,7 +124,7 @@ void read_temp(struct stats_pwr_temp *st_pwr_temp, int nbr)
                                j = 0;
                                st_pwr_temp_i = st_pwr_temp + count;
                                sensors_snprintf_chip_name(st_pwr_temp_i->device, MAX_SENSORS_DEV_LEN, chip);
-                               
+
                                while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
                                        if ((sub->type == SENSORS_SUBFEATURE_TEMP_INPUT) &&
                                                (sub->flags & SENSORS_MODE_R)) {
index 27f77a25fadba486864a60b374d4149c6b253a54..5b8ebda6ed86f396066307530b4403d0b8919579 100644 (file)
@@ -184,7 +184,7 @@ void read_stat_irq(struct stats_irq *st_irq, int nbr)
 
        if ((fp = fopen(STAT, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "intr ", 5)) {
@@ -218,7 +218,7 @@ void read_meminfo(struct stats_memory *st_memory)
 {
        FILE *fp;
        char line[128];
-       
+
        if ((fp = fopen(MEMINFO, "r")) == NULL)
                return;
 
@@ -321,9 +321,9 @@ void oct2chr(char *str)
 {
        int i = 0;
        int j, len;
-       
+
        len = strlen(str);
-       
+
        while (i < len - 3) {
                if ((str[i] == '\\') &&
                    (str[i + 1] >= '0') && (str[i + 1] <= '3') &&
@@ -397,7 +397,7 @@ void read_loadavg(struct stats_queue *st_queue)
 
        if ((fp = fopen(LOADAVG, "r")) == NULL)
                return;
-       
+
        /* Read load averages and queue length */
        fscanf(fp, "%d.%d %d.%d %d.%d %ld/%d %*d\n",
               &load_tmp[0], &st_queue->load_avg_1,
@@ -463,7 +463,7 @@ void read_vmstat_swap(struct stats_swap *st_swap)
                        sscanf(line + 8, "%lu", &st_swap->pswpout);
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -528,7 +528,7 @@ void read_vmstat_paging(struct stats_paging *st_paging)
                        st_paging->pgscan_direct += pgtmp;
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -559,7 +559,7 @@ void read_diskstats_io(struct stats_io *st_io)
                if (sscanf(line, "%u %u %s %lu %*u %lu %*u %lu %*u %lu",
                           &major, &minor, dev_name,
                           &rd_ios, &rd_sec, &wr_ios, &wr_sec) == 7) {
-                       
+
                        if (is_device(dev_name, IGNORE_VIRTUAL_DEVICES)) {
                                /*
                                 * OK: It's a (real) device and not a partition.
@@ -573,7 +573,7 @@ void read_diskstats_io(struct stats_io *st_io)
                        }
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -611,7 +611,7 @@ void read_diskstats_disk(struct stats_disk *st_disk, int nbr, int read_part)
                           &major, &minor, dev_name,
                           &rd_ios, &rd_sec, &rd_ticks, &wr_ios, &wr_sec, &wr_ticks,
                           &tot_ticks, &rq_ticks) == 11) {
-                       
+
                        if (!rd_ios && !wr_ios)
                                /* Unused device: Ignore it */
                                continue;
@@ -686,7 +686,7 @@ void read_tty_driver_serial(struct stats_serial *st_serial, int nbr)
                        if ((p = strstr(line, "oe:")) != NULL) {
                                sscanf(p + 3, "%u", &st_serial_i->overrun);
                        }
-                       
+
                        sl++;
                }
        }
@@ -709,7 +709,7 @@ void read_kernel_tables(struct stats_ktables *st_ktables)
 {
        FILE *fp;
        unsigned int parm;
-       
+
        /* Open /proc/sys/fs/dentry-state file */
        if ((fp = fopen(FDENTRY_STATE, "r")) != NULL) {
                fscanf(fp, "%*d %u",
@@ -775,7 +775,7 @@ int read_net_dev(struct stats_net_dev *st_net_dev, int nbr)
 
        if ((fp = fopen(NET_DEV, "r")) == NULL)
                return 0;
-       
+
        while ((fgets(line, sizeof(line), fp) != NULL) && (dev < nbr)) {
 
                pos = strcspn(line, ":");
@@ -798,7 +798,7 @@ int read_net_dev(struct stats_net_dev *st_net_dev, int nbr)
        }
 
        fclose(fp);
-       
+
        return dev;
 }
 
@@ -820,26 +820,26 @@ void read_if_info(struct stats_net_dev *st_net_dev, int nbr)
        struct stats_net_dev *st_net_dev_i;
        char filename[128], duplex[32];
        int dev, n;
-       
+
        for (dev = 0; dev < nbr; dev++) {
-               
+
                st_net_dev_i = st_net_dev + dev;
-               
+
                /* Read speed info */
                sprintf(filename, IF_DUPLEX, st_net_dev_i->interface);
-               
+
                if ((fp = fopen(filename, "r")) == NULL)
                        /* Cannot read NIC duplex */
                        continue;
-               
+
                n = fscanf(fp, "%s", duplex);
-               
+
                fclose(fp);
-               
+
                if (n != 1)
                        /* Cannot read NIC duplex */
                        continue;
-               
+
                if (!strcmp(duplex, K_DUPLEX_FULL)) {
                        st_net_dev_i->duplex = C_DUPLEX_FULL;
                }
@@ -848,16 +848,16 @@ void read_if_info(struct stats_net_dev *st_net_dev, int nbr)
                }
                else
                        continue;
-               
+
                /* Read speed info */
                sprintf(filename, IF_SPEED, st_net_dev_i->interface);
-               
+
                if ((fp = fopen(filename, "r")) == NULL)
                        /* Cannot read NIC speed */
                        continue;
-               
+
                fscanf(fp, "%u", &st_net_dev_i->speed);
-               
+
                fclose(fp);
        }
 }
@@ -934,7 +934,7 @@ void read_net_nfs(struct stats_net_nfs *st_net_nfs)
                return;
 
        memset(st_net_nfs, 0, STATS_NET_NFS_SIZE);
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "rpc ", 4)) {
@@ -944,7 +944,7 @@ void read_net_nfs(struct stats_net_nfs *st_net_nfs)
                else if (!strncmp(line, "proc3 ", 6)) {
                        sscanf(line + 6, "%*u %*u %u %*u %*u %u %*u %u %u",
                               &getattcnt, &accesscnt, &readcnt, &writecnt);
-                       
+
                        st_net_nfs->nfs_getattcnt += getattcnt;
                        st_net_nfs->nfs_accesscnt += accesscnt;
                        st_net_nfs->nfs_readcnt   += readcnt;
@@ -954,7 +954,7 @@ void read_net_nfs(struct stats_net_nfs *st_net_nfs)
                        sscanf(line + 6, "%*u %*u %u %u "
                               "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u %u",
                               &readcnt, &writecnt, &accesscnt, &getattcnt);
-                       
+
                        st_net_nfs->nfs_getattcnt += getattcnt;
                        st_net_nfs->nfs_accesscnt += accesscnt;
                        st_net_nfs->nfs_readcnt   += readcnt;
@@ -984,7 +984,7 @@ void read_net_nfsd(struct stats_net_nfsd *st_net_nfsd)
 
        if ((fp = fopen(NET_RPC_NFSD, "r")) == NULL)
                return;
-       
+
        memset(st_net_nfsd, 0, STATS_NET_NFSD_SIZE);
 
        while (fgets(line, sizeof(line), fp) != NULL) {
@@ -1010,7 +1010,7 @@ void read_net_nfsd(struct stats_net_nfsd *st_net_nfsd)
                        st_net_nfsd->nfsd_accesscnt += accesscnt;
                        st_net_nfsd->nfsd_readcnt   += readcnt;
                        st_net_nfsd->nfsd_writecnt  += writecnt;
-                       
+
                }
                else if (!strncmp(line, "proc4ops ", 9)) {
                        sscanf(line + 9, "%*u %*u %*u %*u %u "
@@ -1018,7 +1018,7 @@ void read_net_nfsd(struct stats_net_nfsd *st_net_nfsd)
                               "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u "
                               "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %u",
                               &accesscnt, &getattcnt, &readcnt, &writecnt);
-                       
+
                        st_net_nfsd->nfsd_getattcnt += getattcnt;
                        st_net_nfsd->nfsd_accesscnt += accesscnt;
                        st_net_nfsd->nfsd_readcnt   += readcnt;
@@ -1048,7 +1048,7 @@ void read_net_sock(struct stats_net_sock *st_net_sock)
 
        if ((fp = fopen(NET_SOCKSTAT, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "sockets:", 8)) {
@@ -1098,7 +1098,7 @@ void read_net_ip(struct stats_net_ip *st_net_ip)
 
        if ((fp = fopen(NET_SNMP, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "Ip:", 3)) {
@@ -1113,7 +1113,7 @@ void read_net_ip(struct stats_net_ip *st_net_ip)
                                       &st_net_ip->ReasmOKs,
                                       &st_net_ip->FragOKs,
                                       &st_net_ip->FragCreates);
-                               
+
                                break;
                        }
                        else {
@@ -1144,7 +1144,7 @@ void read_net_eip(struct stats_net_eip *st_net_eip)
 
        if ((fp = fopen(NET_SNMP, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "Ip:", 3)) {
@@ -1159,7 +1159,7 @@ void read_net_eip(struct stats_net_eip *st_net_eip)
                                       &st_net_eip->OutNoRoutes,
                                       &st_net_eip->ReasmFails,
                                       &st_net_eip->FragFails);
-                               
+
                                break;
                        }
                        else {
@@ -1190,7 +1190,7 @@ void read_net_icmp(struct stats_net_icmp *st_net_icmp)
 
        if ((fp = fopen(NET_SNMP, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "Icmp:", 5)) {
@@ -1243,7 +1243,7 @@ void read_net_eicmp(struct stats_net_eicmp *st_net_eicmp)
 
        if ((fp = fopen(NET_SNMP, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "Icmp:", 5)) {
@@ -1293,7 +1293,7 @@ void read_net_tcp(struct stats_net_tcp *st_net_tcp)
 
        if ((fp = fopen(NET_SNMP, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "Tcp:", 4)) {
@@ -1335,7 +1335,7 @@ void read_net_etcp(struct stats_net_etcp *st_net_etcp)
 
        if ((fp = fopen(NET_SNMP, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "Tcp:", 4)) {
@@ -1378,7 +1378,7 @@ void read_net_udp(struct stats_net_udp *st_net_udp)
 
        if ((fp = fopen(NET_SNMP, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "Udp:", 4)) {
@@ -1418,7 +1418,7 @@ void read_net_sock6(struct stats_net_sock6 *st_net_sock6)
 
        if ((fp = fopen(NET_SOCKSTAT6, "r")) == NULL)
                return;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
 
                if (!strncmp(line, "TCP6:", 5)) {
@@ -1494,7 +1494,7 @@ void read_net_ip6(struct stats_net_ip6 *st_net_ip6)
                        sscanf(line + 15, "%llu", &st_net_ip6->FragCreates6);
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -1553,7 +1553,7 @@ void read_net_eip6(struct stats_net_eip6 *st_net_eip6)
                        sscanf(line + 19, "%llu", &st_net_eip6->InTruncatedPkts6);
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -1630,7 +1630,7 @@ void read_net_icmp6(struct stats_net_icmp6 *st_net_icmp6)
                        sscanf(line + 31, "%lu", &st_net_icmp6->OutNeighborAdvertisements6);
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -1689,7 +1689,7 @@ void read_net_eicmp6(struct stats_net_eicmp6 *st_net_eicmp6)
                        sscanf(line + 19, "%lu", &st_net_eicmp6->OutPktTooBigs6);
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -1727,7 +1727,7 @@ void read_net_udp6(struct stats_net_udp6 *st_net_udp6)
                        sscanf(line + 13, "%lu", &st_net_udp6->InErrors6);
                }
        }
-       
+
        fclose(fp);
 }
 
@@ -1750,26 +1750,26 @@ void read_cpuinfo(struct stats_pwr_cpufreq *st_pwr_cpufreq, int nbr)
        char line[1024];
        int proc_nb = 0, nr = 0;
        unsigned int ifreq, dfreq;
-       
+
        if ((fp = fopen(CPUINFO, "r")) == NULL)
                return;
-       
+
        st_pwr_cpufreq->cpufreq = 0;
-       
+
        while (fgets(line, sizeof(line), fp) != NULL) {
-               
+
                if (!strncmp(line, "processor\t", 10)) {
                        sscanf(strchr(line, ':') + 1, "%d", &proc_nb);
                }
-               
+
                else if (!strncmp(line, "cpu MHz\t", 8)) {
                        sscanf(strchr(line, ':') + 1, "%u.%u", &ifreq, &dfreq);
-                       
+
                        if (proc_nb < (nbr - 1)) {
                                /* Save current CPU frequency */
                                st_pwr_cpufreq_i = st_pwr_cpufreq + proc_nb + 1;
                                st_pwr_cpufreq_i->cpufreq = ifreq * 100 + dfreq / 10;
-                               
+
                                /* Also save it to compute an average CPU frequency */
                                st_pwr_cpufreq->cpufreq += st_pwr_cpufreq_i->cpufreq;
                                nr++;
@@ -1786,9 +1786,9 @@ void read_cpuinfo(struct stats_pwr_cpufreq *st_pwr_cpufreq, int nbr)
                        }
                }
        }
-       
+
        fclose(fp);
-       
+
        if (nr) {
                /* Compute average CPU frequency for this machine */
                st_pwr_cpufreq->cpufreq /= nr;
@@ -1920,7 +1920,7 @@ void read_usb_stats(struct stats_pwr_usb *st_pwr_usb, char *usb_device)
                       &st_pwr_usb->product_id);
                fclose(fp);
        }
-       
+
        /* Read USB device max power consumption */
        snprintf(filename, MAX_PF_NAME, "%s/%s/%s",
                 SYSFS_USBDEV, usb_device, SYSFS_BMAXPOWER);
@@ -2022,16 +2022,16 @@ void read_filesystem(struct stats_filesystem *st_filesystem, int nbr)
 
        while ((fgets(line, sizeof(line), fp) != NULL) && (fs < nbr)) {
                if (line[0] == '/') {
-                       
+
                        /* Read current filesystem name and mount point */
                        sscanf(line, "%71s %127s", fs_name, mountp);
-                       
+
                        /* Replace octal codes */
                        oct2chr(mountp);
-                       
+
                        if ((statfs(mountp, &buf) < 0) || (!buf.f_blocks))
                                continue;
-                       
+
                        st_filesystem_i = st_filesystem + fs++;
                        st_filesystem_i->f_blocks = buf.f_blocks * buf.f_bsize;
                        st_filesystem_i->f_bfree  = buf.f_bfree * buf.f_bsize;
index 21ab00a5dc1c520f8b3815b6b9706699a46fc5db..ee085f6a73742811894d659dcece2d3635e8f6f7 100644 (file)
@@ -180,13 +180,13 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
 
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
-               
+
                scc = (struct stats_cpu *) ((char *) a->buf[curr]  + i * a->msize);
                scp = (struct stats_cpu *) ((char *) a->buf[!curr] + i * a->msize);
 
                /* Should current CPU (including CPU "all") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
-                       
+
                        if (!i) {
                                /* This is CPU "all" */
                                if (DISPLAY_CPU_DEF(a->opt_flags)) {
@@ -210,7 +210,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                                           g_itv),
                                               NULL);
                                }
-                               
+
                                if (DISPLAY_CPU_DEF(a->opt_flags)) {
                                        render(isdb, pre, PT_NOFLAG,
                                               "all\t%%nice", NULL, NULL,
@@ -228,7 +228,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                                           scc->cpu_nice - scc->cpu_guest_nice,
                                                           g_itv),
                                               NULL);
-                               }                               
+                               }
 
                                if (DISPLAY_CPU_DEF(a->opt_flags)) {
                                        render(isdb, pre, PT_NOFLAG,
@@ -246,7 +246,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                               ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv),
                                               NULL);
                                }
-                               
+
                                render(isdb, pre, PT_NOFLAG,
                                       "all\t%%iowait", NULL, NULL,
                                       NOVAL,
@@ -309,7 +309,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                         * jump from zero when the CPU comes back online.
                                         */
                                        *scc = *scp;
-                                       
+
                                        g_itv = 0;
                                        cpu_offline = TRUE;
                                }
@@ -344,7 +344,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                                           scc->cpu_user - scc->cpu_guest, g_itv),
                                               NULL);
                                }
-                               
+
                                if (DISPLAY_CPU_DEF(a->opt_flags)) {
                                        render(isdb, pre, PT_NOFLAG,
                                               "cpu%d\t%%nice", NULL, cons(iv, i - 1, NOVAL),
@@ -386,7 +386,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                               ll_sp_value(scp->cpu_sys, scc->cpu_sys, g_itv),
                                               NULL);
                                }
-                               
+
                                render(isdb, pre, PT_NOFLAG,
                                       "cpu%d\t%%iowait", NULL, cons(iv, i - 1, NOVAL),
                                       NOVAL,
@@ -419,7 +419,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                               0.0 :
                                               ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv),
                                               NULL);
-                                       
+
                                        render(isdb, pre, PT_NOFLAG,
                                               "cpu%d\t%%guest", NULL, cons(iv, i - 1, NOVAL),
                                               NOVAL,
@@ -436,7 +436,7 @@ __print_funct_t render_cpu_stats(struct activity *a, int isdb, char *pre,
                                               ll_sp_value(scp->cpu_guest_nice, scc->cpu_guest_nice, g_itv),
                                               NULL);
                                }
-                               
+
                                if (!g_itv) {
                                        /* CPU is offline or tickless */
                                        render(isdb, pre, pt_newlin,
@@ -480,7 +480,7 @@ __print_funct_t render_pcsw_stats(struct activity *a, int isdb, char *pre,
                *spp = (struct stats_pcsw *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        /* The first one as an example */
        render(isdb,            /* db/ppc flag */
               pre,             /* the preformatted line leader */
@@ -519,15 +519,15 @@ __print_funct_t render_irq_stats(struct activity *a, int isdb, char *pre,
        struct stats_irq *sic, *sip;
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
 
                sic = (struct stats_irq *) ((char *) a->buf[curr]  + i * a->msize);
                sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
-               
+
                /* Should current interrupt (including int "sum") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
-                       
+
                        /* Yes: Display it */
                        if (!i) {
                                /* This is interrupt "sum" */
@@ -568,7 +568,7 @@ __print_funct_t render_swap_stats(struct activity *a, int isdb, char *pre,
                *ssp = (struct stats_swap *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tpswpin/s", NULL, NULL,
               NOVAL,
@@ -733,7 +733,7 @@ __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre,
                *smp = (struct stats_memory *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-               
+
        if (DISPLAY_MEMORY(a->opt_flags)) {
 
                render(isdb, pre, PT_NOFLAG,
@@ -804,7 +804,7 @@ __print_funct_t render_memory_stats(struct activity *a, int isdb, char *pre,
                       "-\tkbdirty", NULL, NULL,
                       smc->dirtykb, DNOVAL, NULL);
        }
-       
+
        if (DISPLAY_SWAP(a->opt_flags)) {
 
                render(isdb, pre, PT_USEINT,
@@ -852,7 +852,7 @@ __print_funct_t render_ktables_stats(struct activity *a, int isdb, char *pre,
                *skc = (struct stats_ktables *) a->buf[curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_USEINT,
               "-\tdentunusd", NULL, NULL,
               skc->dentry_stat, DNOVAL, NULL);
@@ -889,7 +889,7 @@ __print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre,
                *sqc = (struct stats_queue *) a->buf[curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_USEINT,
               "-\trunq-sz", NULL, NULL,
               sqc->nr_running, DNOVAL, NULL);
@@ -915,7 +915,7 @@ __print_funct_t render_queue_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               (double) sqc->load_avg_15 / 100,
               NULL);
-       
+
        render(isdb, pre, PT_USEINT | pt_newlin,
               "-\tblocked", NULL, NULL,
               sqc->procs_blocked, DNOVAL, NULL);
@@ -1026,7 +1026,7 @@ __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
 
                j = check_disk_reg(a, curr, !curr, i);
                sdp = (struct stats_disk *) ((char *) a->buf[!curr] + j * a->msize);
-               
+
                /* Compute extended stats (service time, etc.) */
                compute_ext_disk_stats(sdc, sdp, itv, &xds);
 
@@ -1036,7 +1036,7 @@ __print_funct_t render_disk_stats(struct activity *a, int isdb, char *pre,
                if (DISPLAY_PERSIST_NAME_S(flags)) {
                        persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
                }
-               
+
                if (persist_dev_name) {
                        dev_name = persist_dev_name;
                }
@@ -1136,7 +1136,7 @@ __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre,
 
                if (!strcmp(sndc->interface, ""))
                        continue;
-               
+
                j = check_net_dev_reg(a, curr, !curr, i);
                sndp = (struct stats_net_dev *) ((char *) a->buf[!curr] + j * a->msize);
 
@@ -1190,7 +1190,7 @@ __print_funct_t render_net_dev_stats(struct activity *a, int isdb, char *pre,
                       NOVAL,
                       S_VALUE(sndp->multicast, sndc->multicast, itv),
                       NULL);
-               
+
                ifutil = compute_ifutil(sndc, rxkb, txkb);
                render(isdb, pre, pt_newlin,
                       "%s\t%%ifutil", NULL,
@@ -1227,7 +1227,7 @@ __print_funct_t render_net_edev_stats(struct activity *a, int isdb, char *pre,
 
                if (!strcmp(snedc->interface, ""))
                        continue;
-               
+
                j = check_net_edev_reg(a, curr, !curr, i);
                snedp = (struct stats_net_edev *) ((char *) a->buf[!curr] + j * a->msize);
 
@@ -1316,7 +1316,7 @@ __print_funct_t render_net_nfs_stats(struct activity *a, int isdb, char *pre,
                *snnp = (struct stats_net_nfs *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tcall/s", NULL, NULL,
               NOVAL,
@@ -1507,7 +1507,7 @@ __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre,
                *snip = (struct stats_net_ip *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tirec/s", NULL, NULL,
               NOVAL,
@@ -1543,7 +1543,7 @@ __print_funct_t render_net_ip_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->ReasmOKs, snic->ReasmOKs, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tfragok/s", NULL, NULL,
               NOVAL,
@@ -1577,7 +1577,7 @@ __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre,
                *sneip = (struct stats_net_eip *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tihdrerr/s", NULL, NULL,
               NOVAL,
@@ -1613,7 +1613,7 @@ __print_funct_t render_net_eip_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(sneip->OutNoRoutes, sneic->OutNoRoutes, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tasmf/s", NULL, NULL,
               NOVAL,
@@ -1647,7 +1647,7 @@ __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
                *snip = (struct stats_net_icmp *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\timsg/s", NULL, NULL,
               NOVAL,
@@ -1659,7 +1659,7 @@ __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->OutMsgs, snic->OutMsgs, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tiech/s", NULL, NULL,
               NOVAL,
@@ -1689,7 +1689,7 @@ __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->InTimestamps, snic->InTimestamps, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\titmr/s", NULL, NULL,
               NOVAL,
@@ -1701,7 +1701,7 @@ __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->OutTimestamps, snic->OutTimestamps, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\totmr/s", NULL, NULL,
               NOVAL,
@@ -1713,19 +1713,19 @@ __print_funct_t render_net_icmp_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->InAddrMasks, snic->InAddrMasks, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tiadrmkr/s", NULL, NULL,
               NOVAL,
               S_VALUE(snip->InAddrMaskReps, snic->InAddrMaskReps, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\toadrmk/s", NULL, NULL,
               NOVAL,
               S_VALUE(snip->OutAddrMasks, snic->OutAddrMasks, itv),
               NULL);
-       
+
        render(isdb, pre, pt_newlin,
               "-\toadrmkr/s", NULL, NULL,
               NOVAL,
@@ -1753,7 +1753,7 @@ __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
                *sneip = (struct stats_net_eicmp *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tierr/s", NULL, NULL,
               NOVAL,
@@ -1765,7 +1765,7 @@ __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(sneip->OutErrors, sneic->OutErrors, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tidstunr/s", NULL, NULL,
               NOVAL,
@@ -1795,7 +1795,7 @@ __print_funct_t render_net_eicmp_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(sneip->InParmProbs, sneic->InParmProbs, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\toparmpb/s", NULL, NULL,
               NOVAL,
@@ -1847,7 +1847,7 @@ __print_funct_t render_net_tcp_stats(struct activity *a, int isdb, char *pre,
                *sntp = (struct stats_net_tcp *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tactive/s", NULL, NULL,
               NOVAL,
@@ -1893,19 +1893,19 @@ __print_funct_t render_net_etcp_stats(struct activity *a, int isdb, char *pre,
                *snetp = (struct stats_net_etcp *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tatmptf/s", NULL, NULL,
               NOVAL,
               S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\testres/s", NULL, NULL,
               NOVAL,
               S_VALUE(snetp->EstabResets, snetc->EstabResets, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tretrans/s", NULL, NULL,
               NOVAL,
@@ -1945,7 +1945,7 @@ __print_funct_t render_net_udp_stats(struct activity *a, int isdb, char *pre,
                *snup = (struct stats_net_udp *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tidgm/s", NULL, NULL,
               NOVAL,
@@ -2028,7 +2028,7 @@ __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre,
                *snip = (struct stats_net_ip6 *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tirec6/s", NULL, NULL,
               NOVAL,
@@ -2076,7 +2076,7 @@ __print_funct_t render_net_ip6_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->OutMcastPkts6, snic->OutMcastPkts6, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tfragok6/s", NULL, NULL,
               NOVAL,
@@ -2110,7 +2110,7 @@ __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
                *sneip = (struct stats_net_eip6 *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tihdrer6/s", NULL, NULL,
               NOVAL,
@@ -2158,7 +2158,7 @@ __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(sneip->OutNoRoutes6, sneic->OutNoRoutes6, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tasmf6/s", NULL, NULL,
               NOVAL,
@@ -2170,7 +2170,7 @@ __print_funct_t render_net_eip6_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(sneip->FragFails6, sneic->FragFails6, itv),
               NULL);
-       
+
        render(isdb, pre, pt_newlin,
               "-\titrpck6/s", NULL, NULL,
               NOVAL,
@@ -2198,7 +2198,7 @@ __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
                *snip = (struct stats_net_icmp6 *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\timsg6/s", NULL, NULL,
               NOVAL,
@@ -2210,7 +2210,7 @@ __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->OutMsgs6, snic->OutMsgs6, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tiech6/s", NULL, NULL,
               NOVAL,
@@ -2270,7 +2270,7 @@ __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->OutRouterSolicits6, snic->OutRouterSolicits6, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tirtad6/s", NULL, NULL,
               NOVAL,
@@ -2288,7 +2288,7 @@ __print_funct_t render_net_icmp6_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(snip->OutNeighborSolicits6, snic->OutNeighborSolicits6, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tinbad6/s", NULL, NULL,
               NOVAL,
@@ -2322,7 +2322,7 @@ __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre,
                *sneip = (struct stats_net_eicmp6 *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tierr6/s", NULL, NULL,
               NOVAL,
@@ -2358,7 +2358,7 @@ __print_funct_t render_net_eicmp6_stats(struct activity *a, int isdb, char *pre,
               NOVAL,
               S_VALUE(sneip->InParmProblems6, sneic->InParmProblems6, itv),
               NULL);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\toprmpb6/s", NULL, NULL,
               NOVAL,
@@ -2410,7 +2410,7 @@ __print_funct_t render_net_udp6_stats(struct activity *a, int isdb, char *pre,
                *snup = (struct stats_net_udp6 *) a->buf[!curr];
        int pt_newlin
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
-       
+
        render(isdb, pre, PT_NOFLAG,
               "-\tidgm6/s", NULL, NULL,
               NOVAL,
@@ -2457,12 +2457,12 @@ __print_funct_t render_pwr_cpufreq_stats(struct activity *a, int isdb, char *pre
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
 
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
-               
+
                spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
 
                /* Should current CPU (including CPU "all") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
-                       
+
                        if (!i) {
                                /* This is CPU "all" */
                                render(isdb, pre, pt_newlin,
@@ -2714,7 +2714,7 @@ __print_funct_t render_pwr_wghfreq_stats(struct activity *a, int isdb, char *pre
                                           (spc_k->time_in_state - spp_k->time_in_state);
                                tis     += (spc_k->time_in_state - spp_k->time_in_state);
                        }
-                       
+
                        if (!i) {
                                /* This is CPU "all" */
                                render(isdb, pre, pt_newlin,
diff --git a/sa.h b/sa.h
index ece80703c16df90e033fb9cf20e6adf49729ae57..bb020acc0dee71389e78c11ec24196b360ee5f79 100644 (file)
--- a/sa.h
+++ b/sa.h
@@ -725,7 +725,7 @@ extern __nr_t
        wrap_get_usb_nr(struct activity *);
 extern __nr_t
        wrap_get_filesystem_nr(struct activity *);
-       
+
 /* Functions used to read activities statistics */
 extern __read_funct_t
        wrap_read_stat_cpu(struct activity *);
index b21dda18005b46d0867f2ce747abcd7b540da190..ffeb989dd6097c63bd094510af2a65ad5d08ca35 100644 (file)
@@ -181,7 +181,7 @@ char *get_devname(unsigned int major, unsigned int minor, int pretty)
        name = get_devname_from_sysfs(major, minor);
        if (name != NULL)
                return (name);
-       
+
        name = ioc_name(major, minor);
        if ((name != NULL) && strcmp(name, K_NODEV))
                return (name);
@@ -1019,7 +1019,7 @@ void copy_structures(struct activity *act[], unsigned int id_seq[],
                    (act[p]->nr < 1) || (act[p]->nr2 < 1)) {
                        PANIC(1);
                }
-               
+
                memcpy(act[p]->buf[dest], act[p]->buf[src], act[p]->msize * act[p]->nr * act[p]->nr2);
        }
 }
@@ -1110,9 +1110,9 @@ void check_file_actlst(int *ifd, char *dfile, struct activity *act[],
        /* Open sa data file */
        if ((*ifd = open(dfile, O_RDONLY)) < 0) {
                int saved_errno = errno;
-               
+
                fprintf(stderr, _("Cannot open %s: %s\n"), dfile, strerror(errno));
-               
+
                if ((saved_errno == ENOENT) && default_file_used) {
                        fprintf(stderr, _("Please check if data collecting is enabled\n"));
                }
@@ -1138,12 +1138,12 @@ void check_file_actlst(int *ifd, char *dfile, struct activity *act[],
        }
 
        SREALLOC(buffer, char, file_magic->header_size);
-       
+
        /* Read sa data file standard header and allocate activity list */
        sa_fread(*ifd, buffer, file_magic->header_size, HARD_SIZE);
        memcpy(file_hdr, buffer, MINIMUM(file_magic->header_size, FILE_HEADER_SIZE));
        free(buffer);
-       
+
        SREALLOC(*file_actlst, struct file_activity, FILE_ACTIVITY_SIZE * file_hdr->sa_act_nr);
        fal = *file_actlst;
 
@@ -1164,7 +1164,7 @@ void check_file_actlst(int *ifd, char *dfile, struct activity *act[],
                if ((p = get_activity_position(act, fal->id)) < 0)
                        /* Unknown activity */
                        continue;
-               
+
                if (act[p]->magic != fal->magic) {
                        /* Bad magical number */
                        if (ignore) {
@@ -1263,17 +1263,17 @@ int reallocate_vol_act_structures(struct activity *act[], unsigned int act_nr,
                                   unsigned int act_id)
 {
        int j, p;
-       
+
        if ((p = get_activity_position(act, act_id)) < 0)
                /* Ignore unknown activity */
                return -1;
-       
+
        act[p]->nr = act_nr;
 
        for (j = 0; j < 3; j++) {
                SREALLOC(act[p]->buf[j], void, act[p]->msize * act[p]->nr * act[p]->nr2);
        }
-       
+
        return 0;
 }
 
@@ -1304,11 +1304,11 @@ __nr_t read_vol_act_structures(int ifd, struct activity *act[], char *file,
        struct file_activity file_act;
        int item_nr = 0;
        int i, rc;
-       
+
        for (i = 0; i < vol_act_nr; i++) {
-               
+
                sa_fread(ifd, &file_act, FILE_ACTIVITY_SIZE, HARD_SIZE);
-               
+
                if (file_act.id) {
                        rc = reallocate_vol_act_structures(act, file_act.nr, file_act.id);
                        if ((rc == 0) && !item_nr) {
@@ -1317,7 +1317,7 @@ __nr_t read_vol_act_structures(int ifd, struct activity *act[], char *file,
                }
                /* else ignore empty structures that may exist */
        }
-       
+
        if (!item_nr) {
                /* All volatile activities structures cannot be empty */
                handle_invalid_sa_file(&ifd, file_magic, file, 0);
@@ -1390,12 +1390,12 @@ int parse_sar_opt(char *argv[], int *opt, struct activity *act[],
                case 'F':
                        SELECT_ACTIVITY(A_FILESYSTEM);
                        break;
-                       
+
                case 'H':
                        p = get_activity_position(act, A_HUGE);
                        act[p]->options   |= AO_SELECTED;
                        break;
-                       
+
                case 'j':
                        if (argv[*opt + 1]) {
                                (*opt)++;
@@ -1420,7 +1420,7 @@ int parse_sar_opt(char *argv[], int *opt, struct activity *act[],
                                return 1;
                        }
                        break;
-                       
+
                case 'p':
                        *flags |= S_F_DEV_PRETTY;
                        break;
@@ -1786,11 +1786,11 @@ int parse_sa_P_opt(char *argv[], int *opt, unsigned int *flags, struct activity
 double compute_ifutil(struct stats_net_dev *st_net_dev, double rx, double tx)
 {
        unsigned long long speed;
-       
+
        if (st_net_dev->speed) {
-               
+
                speed = st_net_dev->speed * 1000000;
-               
+
                if (st_net_dev->duplex == C_DUPLEX_FULL) {
                        /* Full duplex */
                        if (rx > tx) {
@@ -1805,7 +1805,7 @@ double compute_ifutil(struct stats_net_dev *st_net_dev, double rx, double tx)
                        return ((rx + tx) * 800 / speed);
                }
        }
-       
+
        return 0;
 }
 
index 1dc7a15f0702b78c6f48a2f6152fe7cc92f5bc82..b081f5817f522001e77f5bfb431349efbd1dbd78 100644 (file)
--- a/sa_wrap.c
+++ b/sa_wrap.c
@@ -42,10 +42,10 @@ __read_funct_t wrap_read_stat_cpu(struct activity *a)
 {
        struct stats_cpu *st_cpu
                = (struct stats_cpu *) a->_buf0;
-       
+
        /* Read CPU statistics */
        read_stat_cpu(st_cpu, a->nr, &record_hdr.uptime, &record_hdr.uptime0);
-       
+
        return;
 }
 
@@ -67,7 +67,7 @@ __read_funct_t wrap_read_stat_pcsw(struct activity *a)
 
        /* Read process and context switch stats */
        read_stat_pcsw(st_pcsw);
-       
+
        return;
 }
 
@@ -89,7 +89,7 @@ __read_funct_t wrap_read_stat_irq(struct activity *a)
 
        /* Read interrupts stats */
        read_stat_irq(st_irq, a->nr);
-       
+
        return;
 }
 
@@ -111,7 +111,7 @@ __read_funct_t wrap_read_loadavg(struct activity *a)
 
        /* Read queue and load stats */
        read_loadavg(st_queue);
-       
+
        return;
 }
 
@@ -133,7 +133,7 @@ __read_funct_t wrap_read_meminfo(struct activity *a)
 
        /* Read memory stats */
        read_meminfo(st_memory);
-       
+
        return;
 }
 
@@ -155,7 +155,7 @@ __read_funct_t wrap_read_swap(struct activity *a)
 
        /* Read stats from /proc/vmstat */
        read_vmstat_swap(st_swap);
-       
+
        return;
 }
 
@@ -177,7 +177,7 @@ __read_funct_t wrap_read_paging(struct activity *a)
 
        /* Read stats from /proc/vmstat */
        read_vmstat_paging(st_paging);
-       
+
        return;
 }
 
@@ -243,7 +243,7 @@ __read_funct_t wrap_read_tty_driver_serial(struct activity *a)
 
        /* Read serial lines stats */
        read_tty_driver_serial(st_serial, a->nr);
-       
+
        return;
 }
 
@@ -265,7 +265,7 @@ __read_funct_t wrap_read_kernel_tables(struct activity *a)
 
        /* Read kernel tables stats */
        read_kernel_tables(st_ktables);
-       
+
        return;
 }
 
@@ -291,10 +291,10 @@ __read_funct_t wrap_read_net_dev(struct activity *a)
        if (!dev)
                /* No data read. Exit */
                return;
-       
+
        /* Read duplex and speed info for each interface */
        read_if_info(st_net_dev, dev);
-       
+
        return;
 }
 
@@ -316,7 +316,7 @@ __read_funct_t wrap_read_net_edev(struct activity *a)
 
        /* Read network interfaces errors stats */
        read_net_edev(st_net_edev, a->nr);
-       
+
        return;
 }
 
@@ -338,7 +338,7 @@ __read_funct_t wrap_read_net_nfs(struct activity *a)
 
        /* Read NFS client stats */
        read_net_nfs(st_net_nfs);
-       
+
        return;
 }
 
@@ -360,7 +360,7 @@ __read_funct_t wrap_read_net_nfsd(struct activity *a)
 
        /* Read NFS server stats */
        read_net_nfsd(st_net_nfsd);
-       
+
        return;
 }
 
@@ -382,7 +382,7 @@ __read_funct_t wrap_read_net_sock(struct activity *a)
 
        /* Read network sockets stats */
        read_net_sock(st_net_sock);
-       
+
        return;
 }
 
@@ -404,7 +404,7 @@ __read_funct_t wrap_read_net_ip(struct activity *a)
 
        /* Read IP stats */
        read_net_ip(st_net_ip);
-       
+
        return;
 }
 
@@ -426,7 +426,7 @@ __read_funct_t wrap_read_net_eip(struct activity *a)
 
        /* Read IP error stats */
        read_net_eip(st_net_eip);
-       
+
        return;
 }
 
@@ -448,7 +448,7 @@ __read_funct_t wrap_read_net_icmp(struct activity *a)
 
        /* Read ICMP stats */
        read_net_icmp(st_net_icmp);
-       
+
        return;
 }
 
@@ -470,7 +470,7 @@ __read_funct_t wrap_read_net_eicmp(struct activity *a)
 
        /* Read ICMP error stats */
        read_net_eicmp(st_net_eicmp);
-       
+
        return;
 }
 
@@ -492,7 +492,7 @@ __read_funct_t wrap_read_net_tcp(struct activity *a)
 
        /* Read TCP stats */
        read_net_tcp(st_net_tcp);
-       
+
        return;
 }
 
@@ -514,7 +514,7 @@ __read_funct_t wrap_read_net_etcp(struct activity *a)
 
        /* Read TCP error stats */
        read_net_etcp(st_net_etcp);
-       
+
        return;
 }
 
@@ -536,7 +536,7 @@ __read_funct_t wrap_read_net_udp(struct activity *a)
 
        /* Read UDP stats */
        read_net_udp(st_net_udp);
-       
+
        return;
 }
 
@@ -558,7 +558,7 @@ __read_funct_t wrap_read_net_sock6(struct activity *a)
 
        /* Read IPv6 network sockets stats */
        read_net_sock6(st_net_sock6);
-       
+
        return;
 }
 
@@ -580,7 +580,7 @@ __read_funct_t wrap_read_net_ip6(struct activity *a)
 
        /* Read IPv6 stats */
        read_net_ip6(st_net_ip6);
-       
+
        return;
 }
 
@@ -602,7 +602,7 @@ __read_funct_t wrap_read_net_eip6(struct activity *a)
 
        /* Read IPv6 error stats */
        read_net_eip6(st_net_eip6);
-       
+
        return;
 }
 
@@ -624,7 +624,7 @@ __read_funct_t wrap_read_net_icmp6(struct activity *a)
 
        /* Read ICMPv6 stats */
        read_net_icmp6(st_net_icmp6);
-       
+
        return;
 }
 
@@ -646,7 +646,7 @@ __read_funct_t wrap_read_net_eicmp6(struct activity *a)
 
        /* Read ICMPv6 error stats */
        read_net_eicmp6(st_net_eicmp6);
-       
+
        return;
 }
 
@@ -668,7 +668,7 @@ __read_funct_t wrap_read_net_udp6(struct activity *a)
 
        /* Read UDPv6 stats */
        read_net_udp6(st_net_udp6);
-       
+
        return;
 }
 
@@ -690,7 +690,7 @@ __read_funct_t wrap_read_cpuinfo(struct activity *a)
 
        /* Read CPU frequency stats */
        read_cpuinfo(st_pwr_cpufreq, a->nr);
-       
+
        return;
 }
 
@@ -1076,7 +1076,7 @@ __nr_t wrap_get_usb_nr(struct activity *a)
        if ((n = get_usb_nr()) >= 0)
                /* Return a positive number even if no USB devices have been found */
                return n + NR_USB_PREALLOC;
-       
+
        return 0;
 }
 
diff --git a/sadc.c b/sadc.c
index 0186ec2de37cfa8bb87197a540657cb05cba0a51..28bc44da9aca39ae6f80f925b927a5c654c60c33 100644 (file)
--- a/sadc.c
+++ b/sadc.c
@@ -240,7 +240,7 @@ void int_handler(int sig)
                /* sadc hasn't been called by sar */
                exit(1);
        }
-       
+
        /*
         * When starting sar then pressing ctrl/c, SIGINT is received
         * by sadc, not sar. So send SIGINT to sar so that average stats
@@ -304,7 +304,7 @@ void sa_sys_init(void)
                                act[i]->nr2 = (*act[i]->f_count2)(act[i]);
                        }
                        /* else act[i]->nr2 is a constant and doesn't need to be calculated */
-                       
+
                        if (!act[i]->nr2) {
                                act[i]->nr = 0;
                        }
@@ -440,7 +440,7 @@ void fill_magic_header(struct file_magic *file_magic)
        memset(file_magic, 0, FILE_MAGIC_SIZE);
 
        file_magic->header_size = FILE_HEADER_SIZE;
-       
+
        file_magic->sysstat_magic = SYSSTAT_MAGIC;
        file_magic->format_magic  = FORMAT_MAGIC;
        file_magic->sysstat_extraversion = 0;
@@ -504,7 +504,7 @@ void setup_file_hdr(int fd)
        file_hdr.sa_month       = rectime.tm_mon;
        file_hdr.sa_year        = rectime.tm_year;
        file_hdr.sa_sizeof_long = sizeof(long);
-       
+
        /*
         * This is a new file (or stdout): Field sa_last_cpu_nr is set to the number
         * of CPU items of the machine (1 .. CPU_NR + 1).
@@ -550,7 +550,7 @@ void setup_file_hdr(int fd)
                        if ((n = write_all(fd, &file_act, FILE_ACTIVITY_SIZE))
                            != FILE_ACTIVITY_SIZE)
                                goto write_error;
-                       
+
                        /* Create sequence of volatile activities */
                        if (IS_VOLATILE(act[p]->options)) {
                                vol_id_seq[i] = act[p]->id;
@@ -583,7 +583,7 @@ void write_vol_act_structures(int ofd)
 {
        struct file_activity file_act;
        int i, p, n;
-               
+
        memset(&file_act, 0, FILE_ACTIVITY_SIZE);
 
        for (i = 0; i < file_hdr.sa_vol_act_nr; i++) {
@@ -598,7 +598,7 @@ void write_vol_act_structures(int ofd)
                }
                else {
                        p = get_activity_position(act, vol_id_seq[i]);
-               
+
                        /*
                         * All the fields in file_activity structure are not used.
                         * In particular, act[p]->nr2 is left unmodified.
@@ -723,24 +723,24 @@ void write_stats(int ofd)
 void rewrite_file_hdr(int *ofd, off_t fpos, struct file_magic *file_magic)
 {
        int n;
-       
+
        /* Remove O_APPEND status flag */
        if (fcntl(*ofd, F_SETFL, 0) < 0) {
                perror("fcntl");
                exit(2);
        }
-       
+
        /* Now rewrite file's header with its new CPU number value */
        if (lseek(*ofd, fpos, SEEK_SET) < fpos) {
                perror("lseek");
                exit(2);
        }
-       
+
        n = MINIMUM(file_magic->header_size, FILE_HEADER_SIZE);
        if (write_all(*ofd, &file_hdr, n) != n) {
                p_write_error();
        }
-       
+
        /* Restore O_APPEND status flag */
        if (fcntl(*ofd, F_SETFL, O_APPEND) < 0) {
                perror("fcntl");
@@ -831,7 +831,7 @@ void open_ofile(int *ofd, char ofile[], int restart_mark)
 
        if (!ofile[0])
                return;
-       
+
        /* Does file exist? */
        if (access(ofile, F_OK) < 0) {
                /* NO: Create it */
@@ -970,7 +970,7 @@ void open_ofile(int *ofd, char ofile[], int restart_mark)
                        id_seq[i] = file_act[i].id;
                        act[p]->options |= AO_COLLECTED;
                }
-               
+
                while (j < file_hdr.sa_vol_act_nr) {
                        vol_id_seq[j++] = 0;
                }
@@ -1078,7 +1078,7 @@ void rw_sa_stat_loop(long count, struct tm *rectime, int stdfd, int ofd,
        char new_ofile[MAX_FILE_LEN];
 
        new_ofile[0] = '\0';
-       
+
        /* Set a handler for SIGINT */
        memset(&int_act, 0, sizeof(int_act));
        int_act.sa_handler = (void *) int_handler;
@@ -1206,7 +1206,7 @@ int main(int argc, char **argv)
 
        /* Get HZ */
        get_HZ();
-       
+
        /* Compute page shift in kB */
        get_kb_shift();
 
@@ -1219,7 +1219,7 @@ int main(int argc, char **argv)
                fprintf(stderr, "sensors_init: %s\n", sensors_strerror(err));
        }
 #endif /* HAVE_SENSORS */
-       
+
 #ifdef USE_NLS
        /* Init National Language Support */
        init_nls();
@@ -1338,7 +1338,7 @@ int main(int argc, char **argv)
        else {
                restart_mark = FALSE;
        }
-       
+
        /*
         * Open output file then STDOUT. Write header for each of them.
         * NB: Output file must be opened first, because we may change
diff --git a/sadf.c b/sadf.c
index 51e6c38cb2fc591a3cd2173e9c390d40f5e159ff..1d4619cdc391b893257c11f74ab41029aea1656c 100644 (file)
--- a/sadf.c
+++ b/sadf.c
@@ -101,7 +101,7 @@ void usage(char *progname)
 void init_structures(void)
 {
        int i;
-       
+
        for (i = 0; i < 3; i++) {
                memset(&record_hdr[i], 0, RECORD_HEADER_SIZE);
        }
@@ -156,7 +156,7 @@ void check_format_options(void)
 
        /* Get format position in array */
        f_position = get_format_position(fmt, format);
-       
+
        /* Check options consistency wrt output format */
        if (!ACCEPT_HEADER_ONLY(fmt[f_position]->options)) {
                /* Remove option -H */
@@ -216,7 +216,7 @@ void sadf_get_record_timestamp_struct(int curr, struct tm *rectime, struct tm *l
        if (ltm) {
                *rectime = *ltm;
        }
-       
+
        if (PRINT_TRUE_TIME(flags)) {
                /* Option -t */
                rectime->tm_hour = record_hdr[curr].hour;
@@ -438,14 +438,14 @@ void list_fields(unsigned int act_id)
        unsigned int msk;
        char *hl;
        char hline[HEADER_LINE_LEN];
-       
+
        printf("# hostname;interval;timestamp");
-       
+
        for (i = 0; i < NR_ACT; i++) {
-               
+
                if ((act_id != ALL_ACTIVITIES) && (act[i]->id != act_id))
                        continue;
-               
+
                if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) {
                        if (!HAS_MULTIPLE_OUTPUTS(act[i]->options)) {
                                printf(";%s", act[i]->hdr_line);
@@ -494,7 +494,7 @@ void write_mech_stats(int curr, unsigned long dt, unsigned long long itv,
        int i;
        char pre[80], temp[80]; /* Text at beginning of each line */
        int isdb = (format == F_DB_OUTPUT);
-       
+
        /* This substring appears on every output line, preformat it here */
        snprintf(pre, 80, "%s%s%ld%s",
                 file_hdr.sa_nodename, seps[isdb], dt, seps[isdb]);
@@ -514,10 +514,10 @@ void write_mech_stats(int curr, unsigned long dt, unsigned long long itv,
        }
 
        for (i = 0; i < NR_ACT; i++) {
-               
+
                if ((act_id != ALL_ACTIVITIES) && (act[i]->id != act_id))
                        continue;
-               
+
                if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) {
                        (*act[i]->f_render)(act[i], isdb, pre, curr,
                                            NEED_GLOBAL_ITV(act[i]->options) ? g_itv : itv);
@@ -732,7 +732,7 @@ int write_textual_stats(int curr, int use_tm_start, int use_tm_end, int reset,
                        /* JSON output */
                        if (CLOSE_MARKUP(act[i]->options) ||
                            (IS_SELECTED(act[i]->options) && (act[i]->nr > 0))) {
-                               
+
                                if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) {
                                        printf(",");
 
@@ -809,7 +809,7 @@ void sadf_print_special(int curr, int use_tm_start, int use_tm_end, int rtype, i
                /* Don't forget to read the volatile activities structures */
                new_cpu_nr = read_vol_act_structures(ifd, act, file, file_magic,
                                                     file_hdr.sa_vol_act_nr);
-               
+
                if (!dp)
                        return;
 
@@ -877,7 +877,7 @@ void rw_curr_act_stats(int ifd, off_t fpos, int *curr, long *cnt, int *eosaf,
                perror("lseek");
                exit(2);
        }
-       
+
        if (DISPLAY_FIELD_LIST(fmt[f_position]->options)) {
                /* Print field list */
                list_fields(act_id);
@@ -951,7 +951,7 @@ void rw_curr_act_stats(int ifd, off_t fpos, int *curr, long *cnt, int *eosaf,
 void sr_act_nr(__nr_t save_act_nr[], int action)
 {
        int i;
-       
+
        if (action == DO_SAVE) {
                /* Save number of items for all activities */
                for (i = 0; i < NR_ACT; i++) {
@@ -1180,7 +1180,7 @@ void textual_display_loop(int ifd, struct file_activity *file_actlst, char *dfil
                                /* Read new CPU count */
                                new_cpu_nr = read_vol_act_structures(ifd, act, file, file_magic,
                                                                     file_hdr.sa_vol_act_nr);
-                               
+
                                /* Display RESTART records */
                                write_textual_restarts(0, tm_start.use, tm_end.use, tab,
                                                       rectime, loctime, new_cpu_nr);
@@ -1288,7 +1288,7 @@ void main_display_loop(int ifd, struct file_activity *file_actlst, __nr_t cpu_nr
        int eosaf = TRUE, reset = FALSE;
        long cnt = 1;
        off_t fpos;
-       
+
        /* Read system statistics from file */
        do {
                /*
@@ -1345,10 +1345,10 @@ void main_display_loop(int ifd, struct file_activity *file_actlst, __nr_t cpu_nr
                else {
                        /* For each requested activity... */
                        for (i = 0; i < NR_ACT; i++) {
-                               
+
                                if (!id_seq[i])
                                        continue;
-                               
+
                                if ((p = get_activity_position(act, id_seq[i])) < 0) {
                                        /* Should never happen */
                                        PANIC(1);
@@ -1364,13 +1364,13 @@ void main_display_loop(int ifd, struct file_activity *file_actlst, __nr_t cpu_nr
                                }
                                else {
                                        unsigned int optf, msk;
-                                       
+
                                        optf = act[p]->opt_flags;
-                                       
+
                                        for (msk = 1; msk < 0x10; msk <<= 1) {
                                                if (act[p]->opt_flags & msk) {
                                                        act[p]->opt_flags &= msk;
-                                                       
+
                                                        rw_curr_act_stats(ifd, fpos, &curr, &cnt, &eosaf,
                                                                          act[p]->id, &reset, file_actlst,
                                                                          cpu_nr, rectime, loctime, file,
@@ -1461,7 +1461,7 @@ void read_stats_from_file(char dfile[])
        }
 
        close(ifd);
-       
+
        free(file_actlst);
        free_structures(act);
 }
@@ -1492,7 +1492,7 @@ int main(int argc, char **argv)
 #endif
 
        tm_start.use = tm_end.use = FALSE;
-       
+
        /* Allocate and init activity bitmaps */
        allocate_bitmaps(act);
 
@@ -1618,7 +1618,7 @@ int main(int argc, char **argv)
                                        case 't':
                                                flags |= S_F_TRUE_TIME;
                                                break;
-                                       
+
                                        case 'U':
                                                flags |= S_F_SEC_EPOCH;
                                                break;
@@ -1714,7 +1714,7 @@ int main(int argc, char **argv)
            PRINT_SEC_EPOCH(flags)) > 1) {
                usage(argv[0]);
        }
-       
+
        /*
         * Display all the contents of the daily data file if the count parameter
         * was not set on the command line.
index d04bb7c017402b56be89681fd34c896d10f91ea0..c540f4d27cc2ce1bf6f37a6671b1b153c6647e26 100644 (file)
@@ -166,7 +166,7 @@ __printf_funct_t print_json_restart(int *tab, int action, char *cur_date,
                                    unsigned int cpu_nr)
 {
        static int sep = FALSE;
-       
+
        if (action & F_BEGIN) {
                printf(",\n");
                xprintf((*tab)++, "\"restarts\": [");
@@ -322,7 +322,7 @@ __printf_funct_t print_json_comment(int *tab, int action, char *cur_date,
                                    struct file_header *file_hdr)
 {
        static int sep = FALSE;
-       
+
        if (action & F_BEGIN) {
                printf(",\n");
                xprintf((*tab)++, "\"comments\": [");
@@ -385,7 +385,7 @@ __printf_funct_t print_xml_statistics(int *tab, int action)
 __printf_funct_t print_json_statistics(int *tab, int action)
 {
        static int sep = FALSE;
-       
+
        if (action & F_BEGIN) {
                printf(",\n");
                xprintf((*tab)++, "\"statistics\": [");
@@ -499,7 +499,7 @@ __printf_funct_t print_xml_header(int *tab, int action, char *dfile,
                       XML_DTD_VERSION);
                printf("\"http://pagesperso-orange.fr/sebastien.godard/sysstat-%s.dtd\">\n",
                       XML_DTD_VERSION);
-               
+
                xprintf(*tab, "<sysstat>");
 
                xprintf(++(*tab), "<sysdata-version>%s</sysdata-version>",
@@ -576,7 +576,7 @@ __printf_funct_t print_json_header(int *tab, int action, char *dfile,
                get_file_timestamp_struct(flags, &rectime, file_hdr);
                strftime(cur_time, sizeof(cur_time), "%Y-%m-%d", &rectime);
                xprintf0(*tab, "\"file-date\": \"%s\"", cur_time);
-               
+
                if ((loc_t = gmtime((const time_t *) &file_hdr->sa_ust_time)) != NULL) {
                        strftime(cur_time, sizeof(cur_time), "%T", loc_t);
                        printf(",\n");
@@ -632,10 +632,10 @@ __printf_funct_t print_hdr_header(int *tab, int action, char *dfile,
                                 file_hdr->sa_sysname, file_hdr->sa_release,
                                 file_hdr->sa_nodename, file_hdr->sa_machine,
                                 cpu_nr > 1 ? cpu_nr - 1 : 1);
-               
+
                printf(_("Number of CPU for last samples in file: %u\n"),
                       file_hdr->sa_last_cpu_nr > 1 ? file_hdr->sa_last_cpu_nr - 1 : 1);
-               
+
                if ((loc_t = gmtime((const time_t *) &file_hdr->sa_ust_time)) != NULL) {
                        printf(_("File time: "));
                        strftime(cur_time, sizeof(cur_time), "%T", loc_t);
@@ -643,7 +643,7 @@ __printf_funct_t print_hdr_header(int *tab, int action, char *dfile,
                }
 
                printf(_("Size of a long int: %d\n"), file_hdr->sa_sizeof_long);
-               
+
                /* Number of activities (number of volatile activities) in file */
                printf("sa_act_nr (sa_vol_act_nr): %u (%u)\n",
                       file_hdr->sa_act_nr, file_hdr->sa_vol_act_nr);
diff --git a/sar.c b/sar.c
index 587517fd6dab25470c0fe7792f6ad1d62c0deb4c..eed67918b7221456c4a32f4bea77033b852f6c21 100644 (file)
--- a/sar.c
+++ b/sar.c
@@ -202,7 +202,7 @@ void int_handler(int sig)
 void init_structures(void)
 {
        int i;
-       
+
        for (i = 0; i < 3; i++)
                memset(&record_hdr[i], 0, RECORD_HEADER_SIZE);
 }
@@ -250,11 +250,11 @@ void print_read_error(void)
 void reverse_check_act(unsigned int act_nr)
 {
        int i, j;
-       
+
        for (i = 0; i < NR_ACT; i++) {
-               
+
                if (IS_SELECTED(act[i]->options)) {
-                       
+
                        for (j = 0; j < act_nr; j++) {
                                if (id_seq[j] == act[i]->id)
                                        break;
@@ -298,10 +298,10 @@ int sar_get_record_timestamp_struct(int curr)
                         * The rectime structure has NOT been updated.
                         */
                        return 1;
-               
+
                rectime = *ltm;
        }
-       
+
        return 0;
 }
 
@@ -320,7 +320,7 @@ int check_line_hdr(void)
        /* Get number of options entered on the command line */
        if (get_activity_nr(act, AO_SELECTED, COUNT_OUTPUTS) > 1)
                return TRUE;
-       
+
        for (i = 0; i < NR_ACT; i++) {
                if (IS_SELECTED(act[i]->options)) {
                        /* Special processing for activities using a bitmap */
@@ -387,7 +387,7 @@ void write_stats_avg(int curr, int read_from_file, unsigned int act_id)
        int i;
        unsigned long long itv, g_itv;
        static __nr_t cpu_nr = -1;
-       
+
        if (cpu_nr < 0)
                cpu_nr = act[get_activity_position(act, A_CPU)]->nr;
 
@@ -402,15 +402,15 @@ void write_stats_avg(int curr, int read_from_file, unsigned int act_id)
        strncpy(timestamp[curr], _("Average:"), TIMESTAMP_LEN);
        timestamp[curr][TIMESTAMP_LEN - 1] = '\0';
        strcpy(timestamp[!curr], timestamp[curr]);
-       
+
        /* Test stdout */
        TEST_STDOUT(STDOUT_FILENO);
-       
+
        for (i = 0; i < NR_ACT; i++) {
-               
+
                if ((act_id != ALL_ACTIVITIES) && (act[i]->id != act_id))
                        continue;
-               
+
                if (IS_SELECTED(act[i]->options) && (act[i]->nr > 0)) {
                        /* Display current average activity statistics */
                        (*act[i]->f_print_avg)(act[i], 2, curr,
@@ -509,7 +509,7 @@ int write_stats(int curr, int read_from_file, long *cnt, int use_tm_start,
        }
 
        avg_count++;
-       
+
        /* Test stdout */
        TEST_STDOUT(STDOUT_FILENO);
 
@@ -553,12 +553,12 @@ void write_stats_startup(int curr)
                        memset(act[i]->buf[!curr], 0, act[i]->msize * act[i]->nr * act[i]->nr2);
                }
        }
-       
+
        flags |= S_F_SINCE_BOOT;
        dis = TRUE;
-       
+
        write_stats(curr, USE_SADC, &count, NO_TM_START, NO_TM_END, NO_RESET, ALL_ACTIVITIES);
-       
+
        exit(0);
 }
 
@@ -636,7 +636,7 @@ int sar_print_special(int curr, int use_tm_start, int use_tm_end, int rtype,
                /* Don't forget to read the volatile activities structures */
                new_cpu_nr = read_vol_act_structures(ifd, act, file, file_magic,
                                                     file_hdr.sa_vol_act_nr);
-               
+
                if (dp) {
                        printf("\n%-11s       LINUX RESTART\t(%d CPU)\n",
                               cur_time, new_cpu_nr > 1 ? new_cpu_nr - 1 : 1);
@@ -675,9 +675,9 @@ void read_sadc_stat_bunch(int curr)
        if (sa_read(&record_hdr[curr], RECORD_HEADER_SIZE)) {
                print_read_error();
        }
-       
+
        for (i = 0; i < NR_ACT; i++) {
-               
+
                if (!id_seq[i])
                        continue;
                if ((p = get_activity_position(act, id_seq[i])) < 0) {
@@ -851,10 +851,10 @@ void read_header_data(void)
        if (sa_read(&file_hdr, FILE_HEADER_SIZE)) {
                print_read_error();
        }
-       
+
        /* Read activity list */
        for (i = 0; i < file_hdr.sa_act_nr; i++) {
-               
+
                if (sa_read(&file_act, FILE_ACTIVITY_SIZE)) {
                        print_read_error();
                }
@@ -878,7 +878,7 @@ void read_header_data(void)
        while (i < NR_ACT) {
                id_seq[i++] = 0;
        }
-       
+
        /* Check that all selected activties are actually sent by sadc */
        reverse_check_act(file_hdr.sa_act_nr);
 }
@@ -969,14 +969,14 @@ void read_stats_from_file(char from_file[])
 
                        if (!id_seq[i])
                                continue;
-                       
+
                        if ((p = get_activity_position(act, id_seq[i])) < 0) {
                                /* Should never happen */
                                PANIC(1);
                        }
                        if (!IS_SELECTED(act[p]->options))
                                continue;
-                       
+
                        if (!HAS_MULTIPLE_OUTPUTS(act[p]->options)) {
                                handle_curr_act_stats(ifd, fpos, &curr, &cnt, &eosaf, rows,
                                                      act[p]->id, &reset, file_actlst,
@@ -984,13 +984,13 @@ void read_stats_from_file(char from_file[])
                        }
                        else {
                                unsigned int optf, msk;
-                               
+
                                optf = act[p]->opt_flags;
-                               
+
                                for (msk = 1; msk < 0x10; msk <<= 1) {
                                        if (act[p]->opt_flags & msk) {
                                                act[p]->opt_flags &= msk;
-                                               
+
                                                handle_curr_act_stats(ifd, fpos, &curr, &cnt,
                                                                      &eosaf, rows, act[p]->id,
                                                                      &reset, file_actlst,
@@ -1029,7 +1029,7 @@ void read_stats_from_file(char from_file[])
        while (!eosaf);
 
        close(ifd);
-       
+
        free(file_actlst);
 }
 
@@ -1155,7 +1155,7 @@ int main(int argc, char **argv)
 #endif
 
        tm_start.use = tm_end.use = FALSE;
-       
+
        /* Allocate and init activity bitmaps */
        allocate_bitmaps(act);
 
@@ -1260,7 +1260,7 @@ int main(int argc, char **argv)
                                usage(argv[0]);
                        }
                }
-               
+
                else if ((strlen(argv[opt]) > 1) &&
                         (strlen(argv[opt]) < 4) &&
                         !strncmp(argv[opt], "-", 1) &&
@@ -1335,7 +1335,7 @@ int main(int argc, char **argv)
        if (!interval && (from_file[0] || to_file[0])) {
                usage(argv[0]);
        }
-       
+
        /* Cannot enter a day shift with -o option */
        if (to_file[0] && day_offset) {
                usage(argv[0]);
@@ -1344,7 +1344,7 @@ int main(int argc, char **argv)
        if (USE_PRETTY_OPTION(flags)) {
                dm_major = get_devmap_major();
        }
-       
+
        if (!count) {
                /*
                 * count parameter not set: Display all the contents of the file
@@ -1355,7 +1355,7 @@ int main(int argc, char **argv)
 
        /* Default is CPU activity... */
        select_default_activity(act);
-       
+
        /* Reading stats from file: */
        if (from_file[0]) {
                if (interval < 0) {
@@ -1364,7 +1364,7 @@ int main(int argc, char **argv)
 
                /* Read stats from file */
                read_stats_from_file(from_file);
-               
+
                /* Free stuctures and activity bitmaps */
                free_bitmaps(act);
                free_structures(act);
@@ -1420,7 +1420,7 @@ int main(int argc, char **argv)
 
                /* Flags to be passed to sadc */
                salloc(args_idx++, "-z");
-               
+
                /* Writing data to a file (option -o) */
                if (to_file[0]) {
                        /* Collect all possible activities (option -S XALL for sadc) */
@@ -1435,7 +1435,7 @@ int main(int argc, char **argv)
                         * to collect only activities that will be displayed.
                         */
                        int act_id = 0;
-                       
+
                        for (i = 0; i < NR_ACT; i++) {
                                if (IS_SELECTED(act[i]->options)) {
                                        act_id |= act[i]->group;
index 4c9ecf29c9be717af2e6f1f3b183c4c8ad2f21c4..d83b64bb4e87c9738eb3798c21ba19d2fe523680 100644 (file)
@@ -310,7 +310,7 @@ __print_funct_t xml_print_irq_stats(struct activity *a, int curr, int tab,
 
                sic = (struct stats_irq *) ((char *) a->buf[curr]  + i * a->msize);
                sip = (struct stats_irq *) ((char *) a->buf[!curr] + i * a->msize);
-               
+
                /* Should current interrupt (including int "sum") be displayed? */
                if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) {
 
@@ -349,7 +349,7 @@ __print_funct_t xml_print_swap_stats(struct activity *a, int curr, int tab,
        struct stats_swap
                *ssc = (struct stats_swap *) a->buf[curr],
                *ssp = (struct stats_swap *) a->buf[!curr];
-       
+
        xprintf(tab, "<swap-pages per=\"second\" "
                "pswpin=\"%.2f\" "
                "pswpout=\"%.2f\"/>",
@@ -486,7 +486,7 @@ __print_funct_t xml_print_memory_stats(struct activity *a, int curr, int tab,
 
                xprintf(tab, "<inactive>%lu</inactive>",
                        smc->inactkb);
-               
+
                xprintf(tab--, "<dirty>%lu</dirty>",
                        smc->dirtykb);
        }
@@ -547,7 +547,7 @@ __print_funct_t xml_print_ktables_stats(struct activity *a, int curr, int tab,
 {
        struct stats_ktables
                *skc = (struct stats_ktables *) a->buf[curr];
-       
+
        xprintf(tab, "<kernel "
                "dentunusd=\"%u\" "
                "file-nr=\"%u\" "
@@ -575,7 +575,7 @@ __print_funct_t xml_print_queue_stats(struct activity *a, int curr, int tab,
 {
        struct stats_queue
                *sqc = (struct stats_queue *) a->buf[curr];
-       
+
        xprintf(tab, "<queue "
                "runq-sz=\"%lu\" "
                "plist-sz=\"%u\" "
@@ -682,7 +682,7 @@ __print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab,
                if (DISPLAY_PERSIST_NAME_S(flags)) {
                        persist_dev_name = get_persistent_name_from_pretty(get_devname(sdc->major, sdc->minor, TRUE));
                }
-               
+
                if (persist_dev_name) {
                        dev_name = persist_dev_name;
                }
@@ -1267,7 +1267,7 @@ __print_funct_t xml_print_net_etcp_stats(struct activity *a, int curr, int tab,
        struct stats_net_etcp
                *snetc = (struct stats_net_etcp *) a->buf[curr],
                *snetp = (struct stats_net_etcp *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_xml_markup;
 
@@ -1310,7 +1310,7 @@ __print_funct_t xml_print_net_udp_stats(struct activity *a, int curr, int tab,
        struct stats_net_udp
                *snuc = (struct stats_net_udp *) a->buf[curr],
                *snup = (struct stats_net_udp *) a->buf[!curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_xml_markup;
 
@@ -1350,7 +1350,7 @@ __print_funct_t xml_print_net_sock6_stats(struct activity *a, int curr, int tab,
 {
        struct stats_net_sock6
                *snsc = (struct stats_net_sock6 *) a->buf[curr];
-       
+
        if (!IS_SELECTED(a->options) || (a->nr <= 0))
                goto close_xml_markup;
 
@@ -1670,7 +1670,7 @@ __print_funct_t xml_print_pwr_cpufreq_stats(struct activity *a, int curr, int ta
        tab++;
 
        xprintf(tab++, "<cpu-frequency unit=\"MHz\">");
-       
+
        for (i = 0; (i < a->nr) && (i < a->bitmap->b_size + 1); i++) {
 
                spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr]  + i * a->msize);