]> granicus.if.org Git - sysstat/commitdiff
Define constants for metrics units
authorSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Jun 2017 11:47:04 +0000 (13:47 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Jun 2017 11:47:04 +0000 (13:47 +0200)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
cifsiostat.c
common.c
common.h
iostat.c
mpstat.c
pidstat.c
pr_stats.c
tapestat.c

index 86d9ec3424470ae06236b9f1cc824de2cc2797cb..a3c81d00fef3860725bfb722eaef8959ce8b06e5 100644 (file)
@@ -446,12 +446,12 @@ void write_cifs_stat(int curr, unsigned long long itv, int fctr,
                rbytes /= fctr;
                wbytes /= fctr;
        }
-       cprintf_f(DISPLAY_UNIT(flags) ? 1 : -1, 2, 12, 2,
+       cprintf_f(DISPLAY_UNIT(flags) ? UNIT_BYTE : NO_UNIT, 2, 12, 2,
                  rbytes, wbytes);
-       cprintf_f(-1, 2, 9, 2,
+       cprintf_f(NO_UNIT, 2, 9, 2,
                  S_VALUE(ionj->rd_ops, ioni->rd_ops, itv),
                  S_VALUE(ionj->wr_ops, ioni->wr_ops, itv));
-       cprintf_f(-1, 3, 12, 2,
+       cprintf_f(NO_UNIT, 3, 12, 2,
                  S_VALUE(ionj->fopens, ioni->fopens, itv),
                  S_VALUE(ionj->fcloses, ioni->fcloses, itv),
                  S_VALUE(ionj->fdeletes, ioni->fdeletes, itv));
index a5a180650230a5ea4cd19181bd9290e99b317482..373b0c260a4409034bb65ee771d1195e8304313c 100644 (file)
--- a/common.c
+++ b/common.c
@@ -48,7 +48,6 @@
 
 /* Units (sectors, Bytes, kilobytes, etc.) */
 char units[] = {'s', 'B', 'k', 'M', 'G', 'T', 'P', '?'};
-#define NR_UNITS       8
 
 /* Number of ticks per second */
 unsigned int hz;
index c11531339442cc000786727b220b57e7a9b3a32f..c871dc8676ff1dfbcbd0c27b14772fbea0c626cc 100644 (file)
--- a/common.h
+++ b/common.h
 
 #define DISP_HDR       1
 
+/* Index in units array (see common.c) */
+#define NO_UNIT                -1
+#define UNIT_SECTOR    0
+#define UNIT_BYTE      1
+#define UNIT_KILOBYTE  2
+
+#define NR_UNITS       8
+
+
 /* Timestamp buffer length */
 #define TIMESTAMP_LEN  64
 
index 97a6efadc404d94894b95af7fdb3eecc28be4124..1b7cd7a8cd485d3178c085e58d8a55eff024d365 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -1025,25 +1025,25 @@ void write_plain_ext_stat(unsigned long long itv, int fctr,
 
        if (DISPLAY_SHORT_OUTPUT(flags)) {
                /* tps */
-               cprintf_f(-1, 1, 8, 2,
+               cprintf_f(NO_UNIT, 1, 8, 2,
                          S_VALUE(ioj->rd_ios + ioj->wr_ios, ioi->rd_ios + ioi->wr_ios, itv));
                /* kB/s */
                if (!DISPLAY_UNIT(flags)) {
                        xios->sectors /= fctr;
                }
-               cprintf_f(DISPLAY_UNIT(flags) ? 0 : -1, 1, 9, 2,
+               cprintf_f(DISPLAY_UNIT(flags) ? UNIT_SECTOR : NO_UNIT, 1, 9, 2,
                          xios->sectors);
                /* rqm/s */
-               cprintf_f(-1, 1, 8, 2,
+               cprintf_f(NO_UNIT, 1, 8, 2,
                          S_VALUE(ioj->rd_merges + ioj->wr_merges, ioi->rd_merges + ioi->wr_merges, itv));
                /* await */
-               cprintf_f(-1, 1, 7, 2,
+               cprintf_f(NO_UNIT, 1, 7, 2,
                          xds->await);
                /* aqu-sz */
-               cprintf_f(-1, 1, 6, 2,
+               cprintf_f(NO_UNIT, 1, 6, 2,
                          S_VALUE(ioj->rq_ticks, ioi->rq_ticks, itv) / 1000.0);
                /* areq-sz (in kB, not sectors) */
-               cprintf_f(-1, 1, 8, 2,
+               cprintf_f(NO_UNIT, 1, 8, 2,
                          xds->arqsz / 2);
                /*
                 * %util
@@ -1058,7 +1058,7 @@ void write_plain_ext_stat(unsigned long long itv, int fctr,
        }
        else {
                /* r/s  w/s */
-               cprintf_f(-1, 2, 7, 2,
+               cprintf_f(NO_UNIT, 2, 7, 2,
                          S_VALUE(ioj->rd_ios, ioi->rd_ios, itv),
                          S_VALUE(ioj->wr_ios, ioi->wr_ios, itv));
                /* rkB/s  wkB/s */
@@ -1066,26 +1066,26 @@ void write_plain_ext_stat(unsigned long long itv, int fctr,
                        xios->rsectors /= fctr;
                        xios->wsectors /= fctr;
                }
-               cprintf_f(DISPLAY_UNIT(flags) ? 0 : -1, 2, 9, 2,
+               cprintf_f(DISPLAY_UNIT(flags) ? UNIT_SECTOR : NO_UNIT, 2, 9, 2,
                          xios->rsectors, xios->wsectors);
                /* rrqm/s  wrqm/s */
-               cprintf_f(-1, 2, 8, 2,
+               cprintf_f(NO_UNIT, 2, 8, 2,
                          S_VALUE(ioj->rd_merges, ioi->rd_merges, itv),
                          S_VALUE(ioj->wr_merges, ioi->wr_merges, itv));
                /* %rrqm  %wrqm */
                cprintf_pc(2, 6, 2,
                           xios->rrqm_pc, xios->wrqm_pc);
                /* r_await  w_await */
-               cprintf_f(-1, 2, 7, 2,
+               cprintf_f(NO_UNIT, 2, 7, 2,
                          xios->r_await, xios->w_await);
                /* aqu-sz */
-               cprintf_f(-1, 1, 6, 2,
+               cprintf_f(NO_UNIT, 1, 6, 2,
                          S_VALUE(ioj->rq_ticks, ioi->rq_ticks, itv) / 1000.0);
                /* rareq-sz  wareq-sz (in kB, not sectors) */
-               cprintf_f(-1, 2, 8, 2,
+               cprintf_f(NO_UNIT, 2, 8, 2,
                          xios->rarqsz / 2, xios->warqsz / 2);
                /* svctm - The ticks output is biased to output 1000 ticks per second */
-               cprintf_f(-1, 1, 6, 2, xds->svctm);
+               cprintf_f(NO_UNIT, 1, 6, 2, xds->svctm);
                /*
                 * %util
                 * Again: Ticks in milliseconds.
@@ -1308,7 +1308,7 @@ void write_plain_basic_stat(unsigned long long itv, int fctr,
        else {
                cprintf_in(IS_STR, "%-13s", devname, 0);
        }
-       cprintf_f(-1, 1, 8, 2,
+       cprintf_f(NO_UNIT, 1, 8, 2,
                  S_VALUE(ioj->rd_ios + ioj->wr_ios, ioi->rd_ios + ioi->wr_ios, itv));
        rsectors = S_VALUE(ioj->rd_sectors, ioi->rd_sectors, itv);
        wsectors = S_VALUE(ioj->wr_sectors, ioi->wr_sectors, itv);
@@ -1316,9 +1316,9 @@ void write_plain_basic_stat(unsigned long long itv, int fctr,
                rsectors /= fctr;
                wsectors /= fctr;
        }
-       cprintf_f(DISPLAY_UNIT(flags) ? 0 : -1, 2, 12, 2,
+       cprintf_f(DISPLAY_UNIT(flags) ? UNIT_SECTOR : NO_UNIT, 2, 12, 2,
                  rsectors, wsectors);
-       cprintf_u64(DISPLAY_UNIT(flags) ? 0 : -1, 2, 10,
+       cprintf_u64(DISPLAY_UNIT(flags) ? UNIT_SECTOR : NO_UNIT, 2, 10,
                    DISPLAY_UNIT(flags) ? (unsigned long long) rd_sec
                                        : (unsigned long long) rd_sec / fctr,
                    DISPLAY_UNIT(flags) ? (unsigned long long) wr_sec
index b36e908b4baf64b46ab8492f44fd8c23cf3c174d..3171048a7d360e7a2a31a18922ed2cca8861a933 100644 (file)
--- a/mpstat.c
+++ b/mpstat.c
@@ -1067,7 +1067,7 @@ void write_plain_isumcpu_stats(int dis, unsigned long long itv, int prev, int cu
                printf("%-11s", curr_string);
                cprintf_in(IS_STR, " %s", " all", 0);
                /* Print total number of interrupts among all cpu */
-               cprintf_f(-1, 1, 9, 2,
+               cprintf_f(NO_UNIT, 1, 9, 2,
                          S_VALUE(st_irq[prev]->irq_nr, st_irq[curr]->irq_nr, itv));
                printf("\n");
        }
@@ -1097,7 +1097,7 @@ void write_plain_isumcpu_stats(int dis, unsigned long long itv, int prev, int cu
                                 */
                                printf("%-11s", curr_string);
                                cprintf_in(IS_INT, " %4d", "", cpu - 1);
-                               cprintf_f(-1, 1, 9, 2, 0.0);
+                               cprintf_f(NO_UNIT, 1, 9, 2, 0.0);
                                printf("\n");
                        }
                        continue;
@@ -1111,12 +1111,12 @@ void write_plain_isumcpu_stats(int dis, unsigned long long itv, int prev, int cu
 
                if (!pc_itv) {
                        /* This is a tickless CPU: Value displayed is 0.00 */
-                       cprintf_f(-1, 1, 9, 2, 0.0);
+                       cprintf_f(NO_UNIT, 1, 9, 2, 0.0);
                        printf("\n");
                }
                else {
                        /* Display total number of interrupts for current CPU */
-                       cprintf_f(-1, 1, 9, 2,
+                       cprintf_f(NO_UNIT, 1, 9, 2,
                                  S_VALUE(sip->irq_nr, sic->irq_nr, itv));
                        printf("\n");
                }
@@ -1381,7 +1381,7 @@ void write_plain_irqcpu_stats(struct stats_irqcpu *st_ic[], int ic_nr, int dis,
 
                        if (!strcmp(p0->irq_name, q0->irq_name) || !interval) {
                                q = st_ic[prev] + (cpu - 1) * ic_nr + offset;
-                               cprintf_f(-1, 1, colwidth[j], 2,
+                               cprintf_f(NO_UNIT, 1, colwidth[j], 2,
                                          S_VALUE(q->interrupt, p->interrupt, itv));
                        }
                        else {
@@ -1389,7 +1389,7 @@ void write_plain_irqcpu_stats(struct stats_irqcpu *st_ic[], int ic_nr, int dis,
                                 * Instead of printing "N/A", assume that previous value
                                 * for this new interrupt was zero.
                                 */
-                               cprintf_f(-1, 1, colwidth[j], 2,
+                               cprintf_f(NO_UNIT, 1, colwidth[j], 2,
                                          S_VALUE(0, p->interrupt, itv));
                        }
                }
index 9f8d46b99ce5e13de3c61bb3b0e581a40a1ee12f..24268a1f97acb385a140dfe79e0f1badb3110af7 100644 (file)
--- a/pidstat.c
+++ b/pidstat.c
@@ -1454,10 +1454,10 @@ int write_pid_task_all_stats(int prev, int curr, int dis,
                }
 
                if (DISPLAY_MEM(actflag)) {
-                       cprintf_f(-1, 2, 9, 2,
+                       cprintf_f(NO_UNIT, 2, 9, 2,
                                  S_VALUE(pstp->minflt, pstc->minflt, itv),
                                  S_VALUE(pstp->majflt, pstc->majflt, itv));
-                       cprintf_u64(DISPLAY_UNIT(pidflag) ? 2 : -1, 2, 7,
+                       cprintf_u64(DISPLAY_UNIT(pidflag) ? UNIT_KILOBYTE : NO_UNIT, 2, 7,
                                    (unsigned long long) pstc->vsz,
                                    (unsigned long long) pstc->rss);
                        cprintf_pc(1, 6, 2,
@@ -1465,7 +1465,7 @@ int write_pid_task_all_stats(int prev, int curr, int dis,
                }
 
                if (DISPLAY_STACK(actflag)) {
-                       cprintf_u64(DISPLAY_UNIT(pidflag) ? 2 : -1, 2, 7,
+                       cprintf_u64(DISPLAY_UNIT(pidflag) ? UNIT_KILOBYTE : NO_UNIT, 2, 7,
                                    (unsigned long long) pstc->stack_size,
                                    (unsigned long long) pstc->stack_ref);
                }
@@ -1484,7 +1484,7 @@ int write_pid_task_all_stats(int prev, int curr, int dis,
                                        wbytes /= 1024;
                                        cbytes /= 1024;
                                }
-                               cprintf_f(DISPLAY_UNIT(pidflag) ? 1 : -1, 3, 9, 2,
+                               cprintf_f(DISPLAY_UNIT(pidflag) ? UNIT_BYTE : NO_UNIT, 3, 9, 2,
                                          rbytes, wbytes, cbytes);
                        }
                        else {
@@ -1496,30 +1496,30 @@ int write_pid_task_all_stats(int prev, int curr, int dis,
                                cprintf_s(IS_ZERO, "%s", dstr);
                        }
                        /* I/O delays come from another file (/proc/#/stat) */
-                       cprintf_u64(-1, 1, 7,
+                       cprintf_u64(NO_UNIT, 1, 7,
                                    (unsigned long long) (pstc->blkio_swapin_delays - pstp->blkio_swapin_delays));
                }
 
                if (DISPLAY_CTXSW(actflag)) {
-                       cprintf_f(-1, 2, 9, 2,
+                       cprintf_f(NO_UNIT, 2, 9, 2,
                                  S_VALUE(pstp->nvcsw, pstc->nvcsw, itv),
                                  S_VALUE(pstp->nivcsw, pstc->nivcsw, itv));
                }
 
                if (DISPLAY_KTAB(actflag)) {
-                       cprintf_u64(-1, 1, 7,
+                       cprintf_u64(NO_UNIT, 1, 7,
                                    (unsigned long long) pstc->threads);
                        if (NO_PID_FD(pstc->flags)) {
                                /* /proc/#/fd directory not readable */
                                cprintf_s(IS_ZERO, " %7s", "-1");
                        }
                        else {
-                               cprintf_u64(-1, 1, 7, (unsigned long long) pstc->fd_nr);
+                               cprintf_u64(NO_UNIT, 1, 7, (unsigned long long) pstc->fd_nr);
                        }
                }
 
                if (DISPLAY_RT(actflag)) {
-                       cprintf_u64(-1, 1, 4,
+                       cprintf_u64(NO_UNIT, 1, 4,
                                    (unsigned long long) pstc->priority);
                        cprintf_s(IS_STR, " %6s",
                                  GET_POLICY(pstc->policy));
@@ -1573,7 +1573,7 @@ int write_pid_child_all_stats(int prev, int curr, int dis,
                __print_line_id(pstc, '0');
 
                if (DISPLAY_CPU(actflag)) {
-                       cprintf_f(-1, 3, 9, 0,
+                       cprintf_f(NO_UNIT, 3, 9, 0,
                                  (pstc->utime + pstc->cutime - pstc->gtime - pstc->cgtime) <
                                  (pstp->utime + pstp->cutime - pstp->gtime - pstp->cgtime) ?
                                  0.0 :
@@ -1587,7 +1587,7 @@ int write_pid_child_all_stats(int prev, int curr, int dis,
                }
 
                if (DISPLAY_MEM(actflag)) {
-                       cprintf_u64(-1, 2, 9,
+                       cprintf_u64(NO_UNIT, 2, 9,
                                    (unsigned long long) ((pstc->minflt + pstc->cminflt) - (pstp->minflt + pstp->cminflt)),
                                    (unsigned long long) ((pstc->majflt + pstc->cmajflt) - (pstp->majflt + pstp->cmajflt)));
                }
@@ -1723,7 +1723,7 @@ int write_pid_child_cpu_stats(int prev, int curr, int dis, int disp_avg,
 
                print_line_id(curr_string, pstc);
                if (disp_avg) {
-                       cprintf_f(-1, 3, 9, 0,
+                       cprintf_f(NO_UNIT, 3, 9, 0,
                                  (pstc->utime + pstc->cutime - pstc->gtime - pstc->cgtime) <
                                  (pstp->utime + pstp->cutime - pstp->gtime - pstp->cgtime) ?
                                  0.0 :
@@ -1738,7 +1738,7 @@ int write_pid_child_cpu_stats(int prev, int curr, int dis, int disp_avg,
                                            (HZ * pstc->uc_asum_count) * 1000);
                }
                else {
-                       cprintf_f(-1, 3, 9, 0,
+                       cprintf_f(NO_UNIT, 3, 9, 0,
                                  (pstc->utime + pstc->cutime - pstc->gtime - pstc->cgtime) <
                                  (pstp->utime + pstp->cutime - pstp->gtime - pstp->cgtime) ?
                                  0.0 :
@@ -1812,12 +1812,12 @@ int write_pid_task_memory_stats(int prev, int curr, int dis, int disp_avg,
 
                print_line_id(curr_string, pstc);
 
-               cprintf_f(-1, 2, 9, 2,
+               cprintf_f(NO_UNIT, 2, 9, 2,
                          S_VALUE(pstp->minflt, pstc->minflt, itv),
                          S_VALUE(pstp->majflt, pstc->majflt, itv));
 
                if (disp_avg) {
-                       cprintf_f(DISPLAY_UNIT(pidflag) ? 2 : -1, 2, 7, 0,
+                       cprintf_f(DISPLAY_UNIT(pidflag) ? UNIT_KILOBYTE : NO_UNIT, 2, 7, 0,
                                  (double) pstc->total_vsz / pstc->rt_asum_count,
                                  (double) pstc->total_rss / pstc->rt_asum_count);
 
@@ -1827,7 +1827,7 @@ int write_pid_task_memory_stats(int prev, int curr, int dis, int disp_avg,
                                   : 0.0);
                }
                else {
-                       cprintf_u64(DISPLAY_UNIT(pidflag) ? 2 : -1, 2, 7,
+                       cprintf_u64(DISPLAY_UNIT(pidflag) ? UNIT_KILOBYTE : NO_UNIT, 2, 7,
                                    (unsigned long long) pstc->vsz,
                                    (unsigned long long) pstc->rss);
 
@@ -1893,14 +1893,14 @@ int write_pid_child_memory_stats(int prev, int curr, int dis, int disp_avg,
 
                print_line_id(curr_string, pstc);
                if (disp_avg) {
-                       cprintf_f(-1, 2, 9, 0,
+                       cprintf_f(NO_UNIT, 2, 9, 0,
                                  (double) ((pstc->minflt + pstc->cminflt) -
                                            (pstp->minflt + pstp->cminflt)) / pstc->rc_asum_count,
                                  (double) ((pstc->majflt + pstc->cmajflt) -
                                            (pstp->majflt + pstp->cmajflt)) / pstc->rc_asum_count);
                }
                else {
-                       cprintf_u64(-1, 2, 9,
+                       cprintf_u64(NO_UNIT, 2, 9,
                                    (unsigned long long) ((pstc->minflt + pstc->cminflt) - (pstp->minflt + pstp->cminflt)),
                     (unsigned long long) ((pstc->majflt + pstc->cmajflt) - (pstp->majflt + pstp->cmajflt)));
                }
@@ -1967,12 +1967,12 @@ int write_pid_stack_stats(int prev, int curr, int dis, int disp_avg,
                print_line_id(curr_string, pstc);
 
                if (disp_avg) {
-                       cprintf_f(DISPLAY_UNIT(pidflag) ? 2 : -1, 2, 7, 0,
+                       cprintf_f(DISPLAY_UNIT(pidflag) ? UNIT_KILOBYTE : NO_UNIT, 2, 7, 0,
                                  (double) pstc->total_stack_size / pstc->sk_asum_count,
                                  (double) pstc->total_stack_ref  / pstc->sk_asum_count);
                }
                else {
-                       cprintf_u64(DISPLAY_UNIT(pidflag) ? 2 : -1, 2, 7,
+                       cprintf_u64(DISPLAY_UNIT(pidflag) ? UNIT_KILOBYTE : NO_UNIT, 2, 7,
                                    (unsigned long long) pstc->stack_size,
                                    (unsigned long long) pstc->stack_ref);
                }
@@ -2048,7 +2048,7 @@ int write_pid_io_stats(int prev, int curr, int dis, int disp_avg,
                                wbytes /= 1024;
                                cbytes /= 1024;
                        }
-                       cprintf_f(DISPLAY_UNIT(pidflag) ? 1 : -1, 3, 9, 2,
+                       cprintf_f(DISPLAY_UNIT(pidflag) ? UNIT_BYTE : NO_UNIT, 3, 9, 2,
                                  rbytes, wbytes, cbytes);
                }
                else {
@@ -2058,12 +2058,12 @@ int write_pid_io_stats(int prev, int curr, int dis, int disp_avg,
                }
                /* I/O delays come from another file (/proc/#/stat) */
                if (disp_avg) {
-                       cprintf_f(-1, 1, 7, 0,
+                       cprintf_f(NO_UNIT, 1, 7, 0,
                                  (double) (pstc->blkio_swapin_delays - pstp->blkio_swapin_delays) /
                                            pstc->delay_asum_count);
                }
                else {
-                       cprintf_u64(-1, 1, 7,
+                       cprintf_u64(NO_UNIT, 1, 7,
                                    (unsigned long long) (pstc->blkio_swapin_delays - pstp->blkio_swapin_delays));
                }
 
@@ -2115,7 +2115,7 @@ int write_pid_ctxswitch_stats(int prev, int curr, int dis,
                        continue;
 
                print_line_id(curr_string, pstc);
-               cprintf_f(-1, 2, 9, 2,
+               cprintf_f(NO_UNIT, 2, 9, 2,
                          S_VALUE(pstp->nvcsw, pstc->nvcsw, itv),
                          S_VALUE(pstp->nivcsw, pstc->nivcsw, itv));
                print_comm(pstc);
@@ -2166,7 +2166,7 @@ int write_pid_rt_stats(int prev, int curr, int dis,
                        continue;
 
                print_line_id(curr_string, pstc);
-               cprintf_u64(-1, 1, 4,
+               cprintf_u64(NO_UNIT, 1, 4,
                            (unsigned long long) pstc->priority);
                cprintf_s(IS_STR, " %6s", GET_POLICY(pstc->policy));
                print_comm(pstc);
@@ -2233,20 +2233,20 @@ int write_pid_ktab_stats(int prev, int curr, int dis, int disp_avg,
                print_line_id(curr_string, pstc);
 
                if (disp_avg) {
-                       cprintf_f(-1, 2, 7, 0,
+                       cprintf_f(NO_UNIT, 2, 7, 0,
                                  (double) pstc->total_threads / pstc->tf_asum_count,
                                  NO_PID_FD(pstc->flags) ?
                                  -1.0 :
                                  (double) pstc->total_fd_nr / pstc->tf_asum_count);
                }
                else {
-                       cprintf_u64(-1, 1, 7,
+                       cprintf_u64(NO_UNIT, 1, 7,
                                    (unsigned long long) pstc->threads);
                        if (NO_PID_FD(pstc->flags)) {
                                cprintf_s(IS_ZERO, " %7s", "-1");
                        }
                        else {
-                               cprintf_u64(-1, 1, 7,
+                               cprintf_u64(NO_UNIT, 1, 7,
                                            (unsigned long long) pstc->fd_nr);
                        }
                }
index 50e283093c488f78bd2a6b82f44e0d7f5f219dde..d0b1e37ddc66e9fa5f6e02fa42b79b5aeffebf54 100644 (file)
@@ -285,7 +285,7 @@ __print_funct_t print_pcsw_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 2, 9, 2,
+       cprintf_f(NO_UNIT, 2, 9, 2,
                  S_VALUE(spp->processes,      spc->processes,      itv),
                  S_VALUE(spp->context_switch, spc->context_switch, itv));
        printf("\n");
@@ -338,7 +338,7 @@ __print_funct_t print_irq_stats(struct activity *a, int prev, int curr,
                                cprintf_in(IS_INT, " %9d", "", i -1);
                        }
 
-                       cprintf_f(-1, 1, 9, 2, S_VALUE(sip->irq_nr, sic->irq_nr, itv));
+                       cprintf_f(NO_UNIT, 1, 9, 2, S_VALUE(sip->irq_nr, sic->irq_nr, itv));
                        printf("\n");
                }
        }
@@ -367,7 +367,7 @@ __print_funct_t print_swap_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 2, 9, 2,
+       cprintf_f(NO_UNIT, 2, 9, 2,
                  S_VALUE(ssp->pswpin,  ssc->pswpin,  itv),
                  S_VALUE(ssp->pswpout, ssc->pswpout, itv));
        printf("\n");
@@ -396,7 +396,7 @@ __print_funct_t print_paging_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 8, 9, 2,
+       cprintf_f(NO_UNIT, 8, 9, 2,
                  S_VALUE(spp->pgpgin,        spc->pgpgin,        itv),
                  S_VALUE(spp->pgpgout,       spc->pgpgout,       itv),
                  S_VALUE(spp->pgfault,       spc->pgfault,       itv),
@@ -444,7 +444,7 @@ __print_funct_t print_io_stats(struct activity *a, int prev, int curr,
         * We display 0.0 in this case though we should rather tell
         * the user that the value cannot be calculated here.
         */
-       cprintf_f(-1, 5, 9, 2,
+       cprintf_f(NO_UNIT, 5, 9, 2,
                  sic->dk_drive < sip->dk_drive ? 0.0 :
                  S_VALUE(sip->dk_drive, sic->dk_drive, itv),
                  sic->dk_drive_rio < sip->dk_drive_rio ? 0.0 :
@@ -494,11 +494,11 @@ void stub_print_memory_stats(struct activity *a, int prev, int curr,
                avg_frskb = 0,
                avg_tlskb = 0,
                avg_caskb = 0;
-       int unit = -1;
+       int unit = NO_UNIT;
 
        if (DISPLAY_UNIT(flags)) {
                /* Default values unit is kB */
-               unit = 2;
+               unit = UNIT_KILOBYTE;
        }
 
        if (DISPLAY_MEMORY(a->opt_flags)) {
@@ -728,7 +728,7 @@ void stub_print_ktables_stats(struct activity *a, int curr, int dispavg)
        if (!dispavg) {
                /* Display instantaneous values */
                printf("%-11s", timestamp[curr]);
-               cprintf_u64(-1, 4, 9,
+               cprintf_u64(NO_UNIT, 4, 9,
                            (unsigned long long) skc->dentry_stat,
                            (unsigned long long) skc->file_used,
                            (unsigned long long) skc->inode_used,
@@ -747,7 +747,7 @@ void stub_print_ktables_stats(struct activity *a, int curr, int dispavg)
        else {
                /* Display average values */
                printf("%-11s", timestamp[curr]);
-               cprintf_f(-1, 4, 9, 0,
+               cprintf_f(NO_UNIT, 4, 9, 0,
                          (double) avg_dentry_stat / avg_count,
                          (double) avg_file_used   / avg_count,
                          (double) avg_inode_used  / avg_count,
@@ -823,14 +823,14 @@ void stub_print_queue_stats(struct activity *a, int curr, int dispavg)
        if (!dispavg) {
                /* Display instantaneous values */
                printf("%-11s", timestamp[curr]);
-               cprintf_u64(-1, 2, 9,
+               cprintf_u64(NO_UNIT, 2, 9,
                            (unsigned long long) sqc->nr_running,
                            (unsigned long long) sqc->nr_threads);
-               cprintf_f(-1, 3, 9, 2,
+               cprintf_f(NO_UNIT, 3, 9, 2,
                          (double) sqc->load_avg_1  / 100,
                          (double) sqc->load_avg_5  / 100,
                          (double) sqc->load_avg_15 / 100);
-               cprintf_u64(-1, 1, 9,
+               cprintf_u64(NO_UNIT, 1, 9,
                            (unsigned long long) sqc->procs_blocked);
                printf("\n");
 
@@ -845,14 +845,14 @@ void stub_print_queue_stats(struct activity *a, int curr, int dispavg)
        else {
                /* Display average values */
                printf("%-11s", timestamp[curr]);
-               cprintf_f(-1, 2, 9, 0,
+               cprintf_f(NO_UNIT, 2, 9, 0,
                          (double) avg_nr_running / avg_count,
                          (double) avg_nr_threads / avg_count);
-               cprintf_f(-1, 3, 9, 2,
+               cprintf_f(NO_UNIT, 3, 9, 2,
                          (double) avg_load_avg_1  / (avg_count * 100),
                          (double) avg_load_avg_5  / (avg_count * 100),
                          (double) avg_load_avg_15 / (avg_count * 100));
-               cprintf_f(-1, 1, 9, 0,
+               cprintf_f(NO_UNIT, 1, 9, 0,
                          (double) avg_procs_blocked / avg_count);
                printf("\n");
 
@@ -930,7 +930,7 @@ __print_funct_t print_serial_stats(struct activity *a, int prev, int curr,
                cprintf_in(IS_INT, "       %3d", "", ssc->line - 1);
 
                if ((ssc->line == ssp->line) || WANT_SINCE_BOOT(flags)) {
-                       cprintf_f(-1, 6, 9, 2,
+                       cprintf_f(NO_UNIT, 6, 9, 2,
                                  S_VALUE(ssp->rx,      ssc->rx,      itv),
                                  S_VALUE(ssp->tx,      ssc->tx,      itv),
                                  S_VALUE(ssp->frame,   ssc->frame,   itv),
@@ -964,13 +964,13 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
        struct stats_disk *sdc, *sdp, sdpzero;
        struct ext_disk_stats xds;
        char *dev_name, *persist_dev_name;
-       int unit = -1;
+       int unit = NO_UNIT;
 
        memset(&sdpzero, 0, STATS_DISK_SIZE);
 
        if (DISPLAY_UNIT(flags)) {
                /* Default values unit is kB */
-               unit = 2;
+               unit = UNIT_KILOBYTE;
        }
 
        if (dis) {
@@ -1020,12 +1020,12 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
                printf("%-11s", timestamp[curr]);
 
                cprintf_in(IS_STR, " %9s", dev_name, 0);
-               cprintf_f(-1, 1, 9, 2,
+               cprintf_f(NO_UNIT, 1, 9, 2,
                          S_VALUE(sdp->nr_ios, sdc->nr_ios,  itv));
                cprintf_f(unit, 2, 9, 2,
                          S_VALUE(sdp->rd_sect, sdc->rd_sect, itv) / 2,
                          S_VALUE(sdp->wr_sect, sdc->wr_sect, itv) / 2);
-               cprintf_f(-1, 4, 9, 2,
+               cprintf_f(NO_UNIT, 4, 9, 2,
                          /* See iostat for explanations */
                          xds.arqsz / 2,
                          S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
@@ -1054,13 +1054,13 @@ __print_funct_t print_net_dev_stats(struct activity *a, int prev, int curr,
        int i, j;
        struct stats_net_dev *sndc, *sndp, sndzero;
        double rxkb, txkb, ifutil;
-       int unit = -1;
+       int unit = NO_UNIT;
 
        memset(&sndzero, 0, STATS_NET_DEV_SIZE);
 
        if (DISPLAY_UNIT(flags)) {
                /* Default values unit is bytes */
-               unit = 1;
+               unit = UNIT_BYTE;
        }
 
        if (dis) {
@@ -1089,13 +1089,13 @@ __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);
 
-               cprintf_f(-1, 2, 9, 2,
+               cprintf_f(NO_UNIT, 2, 9, 2,
                          S_VALUE(sndp->rx_packets, sndc->rx_packets, itv),
                          S_VALUE(sndp->tx_packets, sndc->tx_packets, itv));
                cprintf_f(unit, 2, 9, 2,
                          unit < 0 ? rxkb / 1024 : rxkb,
                          unit < 0 ? txkb / 1024 : txkb);
-               cprintf_f(-1, 3, 9, 2,
+               cprintf_f(NO_UNIT, 3, 9, 2,
                          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));
@@ -1147,7 +1147,7 @@ __print_funct_t print_net_edev_stats(struct activity *a, int prev, int curr,
                printf("%-11s", timestamp[curr]);
                cprintf_in(IS_STR, " %9s", snedc->interface, 0);
 
-               cprintf_f(-1, 9, 9, 2,
+               cprintf_f(NO_UNIT, 9, 9, 2,
                          S_VALUE(snedp->rx_errors,         snedc->rx_errors,         itv),
                          S_VALUE(snedp->tx_errors,         snedc->tx_errors,         itv),
                          S_VALUE(snedp->collisions,        snedc->collisions,        itv),
@@ -1184,7 +1184,7 @@ __print_funct_t print_net_nfs_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 6, 9, 2,
+       cprintf_f(NO_UNIT, 6, 9, 2,
                  S_VALUE(snnp->nfs_rpccnt,     snnc->nfs_rpccnt,     itv),
                  S_VALUE(snnp->nfs_rpcretrans, snnc->nfs_rpcretrans, itv),
                  S_VALUE(snnp->nfs_readcnt,    snnc->nfs_readcnt,    itv),
@@ -1217,7 +1217,7 @@ __print_funct_t print_net_nfsd_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 11, 9, 2,
+       cprintf_f(NO_UNIT, 11, 9, 2,
                  S_VALUE(snndp->nfsd_rpccnt,    snndc->nfsd_rpccnt,    itv),
                  S_VALUE(snndp->nfsd_rpcbad,    snndc->nfsd_rpcbad,    itv),
                  S_VALUE(snndp->nfsd_netcnt,    snndc->nfsd_netcnt,    itv),
@@ -1262,7 +1262,7 @@ void stub_print_net_sock_stats(struct activity *a, int curr, int dispavg)
        if (!dispavg) {
                /* Display instantaneous values */
                printf("%-11s", timestamp[curr]);
-               cprintf_u64(-1, 6, 9,
+               cprintf_u64(NO_UNIT, 6, 9,
                            (unsigned long long) snsc->sock_inuse,
                            (unsigned long long) snsc->tcp_inuse,
                            (unsigned long long) snsc->udp_inuse,
@@ -1282,7 +1282,7 @@ void stub_print_net_sock_stats(struct activity *a, int curr, int dispavg)
        else {
                /* Display average values */
                printf("%-11s", timestamp[curr]);
-               cprintf_f(-1, 6, 9, 0,
+               cprintf_f(NO_UNIT, 6, 9, 0,
                          (double) avg_sock_inuse / avg_count,
                          (double) avg_tcp_inuse  / avg_count,
                          (double) avg_udp_inuse  / avg_count,
@@ -1354,7 +1354,7 @@ __print_funct_t print_net_ip_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 8, 9, 2,
+       cprintf_f(NO_UNIT, 8, 9, 2,
                  S_VALUE(snip->InReceives,    snic->InReceives,    itv),
                  S_VALUE(snip->ForwDatagrams, snic->ForwDatagrams, itv),
                  S_VALUE(snip->InDelivers,    snic->InDelivers,    itv),
@@ -1389,7 +1389,7 @@ __print_funct_t print_net_eip_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 8, 9, 2,
+       cprintf_f(NO_UNIT, 8, 9, 2,
                  S_VALUE(sneip->InHdrErrors,     sneic->InHdrErrors,     itv),
                  S_VALUE(sneip->InAddrErrors,    sneic->InAddrErrors,    itv),
                  S_VALUE(sneip->InUnknownProtos, sneic->InUnknownProtos, itv),
@@ -1424,7 +1424,7 @@ __print_funct_t print_net_icmp_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 14, 9, 2,
+       cprintf_f(NO_UNIT, 14, 9, 2,
                  S_VALUE(snip->InMsgs,           snic->InMsgs,           itv),
                  S_VALUE(snip->OutMsgs,          snic->OutMsgs,          itv),
                  S_VALUE(snip->InEchos,          snic->InEchos,          itv),
@@ -1465,7 +1465,7 @@ __print_funct_t print_net_eicmp_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 12, 9, 2,
+       cprintf_f(NO_UNIT, 12, 9, 2,
                  S_VALUE(sneip->InErrors,        sneic->InErrors,        itv),
                  S_VALUE(sneip->OutErrors,       sneic->OutErrors,       itv),
                  S_VALUE(sneip->InDestUnreachs,  sneic->InDestUnreachs,  itv),
@@ -1504,7 +1504,7 @@ __print_funct_t print_net_tcp_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 4, 9, 2,
+       cprintf_f(NO_UNIT, 4, 9, 2,
                  S_VALUE(sntp->ActiveOpens,  sntc->ActiveOpens,  itv),
                  S_VALUE(sntp->PassiveOpens, sntc->PassiveOpens, itv),
                  S_VALUE(sntp->InSegs,       sntc->InSegs,       itv),
@@ -1535,7 +1535,7 @@ __print_funct_t print_net_etcp_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 5, 9, 2,
+       cprintf_f(NO_UNIT, 5, 9, 2,
                  S_VALUE(snetp->AttemptFails, snetc->AttemptFails, itv),
                  S_VALUE(snetp->EstabResets,  snetc->EstabResets,  itv),
                  S_VALUE(snetp->RetransSegs,  snetc->RetransSegs,  itv),
@@ -1567,7 +1567,7 @@ __print_funct_t print_net_udp_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 4, 9, 2,
+       cprintf_f(NO_UNIT, 4, 9, 2,
                  S_VALUE(snup->InDatagrams,  snuc->InDatagrams,  itv),
                  S_VALUE(snup->OutDatagrams, snuc->OutDatagrams, itv),
                  S_VALUE(snup->NoPorts,      snuc->NoPorts,      itv),
@@ -1603,7 +1603,7 @@ void stub_print_net_sock6_stats(struct activity *a, int curr, int dispavg)
        if (!dispavg) {
                /* Display instantaneous values */
                printf("%-11s", timestamp[curr]);
-               cprintf_u64(-1, 4, 9,
+               cprintf_u64(NO_UNIT, 4, 9,
                            (unsigned long long) snsc->tcp6_inuse,
                            (unsigned long long) snsc->udp6_inuse,
                            (unsigned long long) snsc->raw6_inuse,
@@ -1619,7 +1619,7 @@ void stub_print_net_sock6_stats(struct activity *a, int curr, int dispavg)
        else {
                /* Display average values */
                printf("%-11s", timestamp[curr]);
-               cprintf_f(-1, 4, 9, 0,
+               cprintf_f(NO_UNIT, 4, 9, 0,
                          (double) avg_tcp6_inuse  / avg_count,
                          (double) avg_udp6_inuse  / avg_count,
                          (double) avg_raw6_inuse  / avg_count,
@@ -1688,7 +1688,7 @@ __print_funct_t print_net_ip6_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 10, 9, 2,
+       cprintf_f(NO_UNIT, 10, 9, 2,
                  S_VALUE(snip->InReceives6,       snic->InReceives6,       itv),
                  S_VALUE(snip->OutForwDatagrams6, snic->OutForwDatagrams6, itv),
                  S_VALUE(snip->InDelivers6,       snic->InDelivers6,       itv),
@@ -1725,7 +1725,7 @@ __print_funct_t print_net_eip6_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 11, 9, 2,
+       cprintf_f(NO_UNIT, 11, 9, 2,
                  S_VALUE(sneip->InHdrErrors6,     sneic->InHdrErrors6,     itv),
                  S_VALUE(sneip->InAddrErrors6,    sneic->InAddrErrors6,    itv),
                  S_VALUE(sneip->InUnknownProtos6, sneic->InUnknownProtos6, itv),
@@ -1763,7 +1763,7 @@ __print_funct_t print_net_icmp6_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 17, 9, 2,
+       cprintf_f(NO_UNIT, 17, 9, 2,
                  S_VALUE(snip->InMsgs6,                    snic->InMsgs6,                    itv),
                  S_VALUE(snip->OutMsgs6,                   snic->OutMsgs6,                   itv),
                  S_VALUE(snip->InEchos6,                   snic->InEchos6,                   itv),
@@ -1807,7 +1807,7 @@ __print_funct_t print_net_eicmp6_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 11, 9, 2,
+       cprintf_f(NO_UNIT, 11, 9, 2,
                  S_VALUE(sneip->InErrors6,        sneic->InErrors6,        itv),
                  S_VALUE(sneip->InDestUnreachs6,  sneic->InDestUnreachs6,  itv),
                  S_VALUE(sneip->OutDestUnreachs6, sneic->OutDestUnreachs6, itv),
@@ -1845,7 +1845,7 @@ __print_funct_t print_net_udp6_stats(struct activity *a, int prev, int curr,
        }
 
        printf("%-11s", timestamp[curr]);
-       cprintf_f(-1, 4, 9, 2,
+       cprintf_f(NO_UNIT, 4, 9, 2,
                  S_VALUE(snup->InDatagrams6,  snuc->InDatagrams6,  itv),
                  S_VALUE(snup->OutDatagrams6, snuc->OutDatagrams6, itv),
                  S_VALUE(snup->NoPorts6,      snuc->NoPorts6,      itv),
@@ -1919,7 +1919,7 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
 
                        if (!dispavg) {
                                /* Display instantaneous values */
-                               cprintf_f(-1, 1, 9, 2,
+                               cprintf_f(NO_UNIT, 1, 9, 2,
                                          ((double) spc->cpufreq) / 100);
                                printf("\n");
                                /*
@@ -1930,7 +1930,7 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
                        }
                        else {
                                /* Display average values */
-                               cprintf_f(-1, 1, 9, 2,
+                               cprintf_f(NO_UNIT, 1, 9, 2,
                                          (double) avg_cpufreq[i] / (100 * avg_count));
                                printf("\n");
                        }
@@ -2026,13 +2026,13 @@ void stub_print_pwr_fan_stats(struct activity *a, int curr, int dispavg)
 
                if (dispavg) {
                        /* Display average values */
-                       cprintf_f(-1, 2, 9, 2,
+                       cprintf_f(NO_UNIT, 2, 9, 2,
                                  (double) avg_fan[i] / avg_count,
                                  (double) (avg_fan[i] - avg_fan_min[i]) / avg_count);
                }
                else {
                        /* Display instantaneous values */
-                       cprintf_f(-1, 2, 9, 2,
+                       cprintf_f(NO_UNIT, 2, 9, 2,
                                  spc->rpm,
                                  spc->rpm - spc->rpm_min);
                        avg_fan[i]     += spc->rpm;
@@ -2141,7 +2141,7 @@ void stub_print_pwr_temp_stats(struct activity *a, int curr, int dispavg)
 
                if (dispavg) {
                        /* Display average values */
-                       cprintf_f(-1, 1, 9, 2, (double) avg_temp[i] / avg_count);
+                       cprintf_f(NO_UNIT, 1, 9, 2, (double) avg_temp[i] / avg_count);
                        cprintf_pc(1, 9, 2,
                                   (avg_temp_max[i] - avg_temp_min[i]) ?
                                   ((double) (avg_temp[i] / avg_count) - avg_temp_min[i]) / (avg_temp_max[i] - avg_temp_min[i]) * 100
@@ -2149,7 +2149,7 @@ void stub_print_pwr_temp_stats(struct activity *a, int curr, int dispavg)
                }
                else {
                        /* Display instantaneous values */
-                       cprintf_f(-1, 1, 9, 2, spc->temp);
+                       cprintf_f(NO_UNIT, 1, 9, 2, spc->temp);
                        cprintf_pc(1, 9, 2,
                                   (spc->temp_max - spc->temp_min) ?
                                   (spc->temp - spc->temp_min) / (spc->temp_max - spc->temp_min) * 100
@@ -2266,7 +2266,7 @@ void stub_print_pwr_in_stats(struct activity *a, int curr, int dispavg)
 
                if (dispavg) {
                        /* Display average values */
-                       cprintf_f(-1, 1, 9, 2, (double) avg_in[i] / avg_count);
+                       cprintf_f(NO_UNIT, 1, 9, 2, (double) avg_in[i] / avg_count);
                        cprintf_pc(1, 9, 2,
                                   (avg_in_max[i] - avg_in_min[i]) ?
                                   ((double) (avg_in[i] / avg_count) - avg_in_min[i]) / (avg_in_max[i] - avg_in_min[i]) * 100
@@ -2274,7 +2274,7 @@ void stub_print_pwr_in_stats(struct activity *a, int curr, int dispavg)
                }
                else {
                        /* Display instantaneous values */
-                       cprintf_f(-1, 1, 9, 2, spc->in);
+                       cprintf_f(NO_UNIT, 1, 9, 2, spc->in);
                        cprintf_pc(1, 9, 2,
                                   (spc->in_max - spc->in_min) ?
                                   (spc->in - spc->in_min) / (spc->in_max - spc->in_min) * 100
@@ -2356,11 +2356,11 @@ void stub_print_huge_stats(struct activity *a, int curr, int dispavg)
        static unsigned long long
                avg_frhkb = 0,
                avg_tlhkb = 0;
-       int unit = -1;
+       int unit = NO_UNIT;
 
        if (DISPLAY_UNIT(flags)) {
                /* Default values unit is kB */
-               unit = 2;
+               unit = UNIT_KILOBYTE;
        }
 
        if (dis) {
@@ -2507,7 +2507,7 @@ void print_pwr_wghfreq_stats(struct activity *a, int prev, int curr,
                        }
 
                        /* Display weighted frequency for current CPU */
-                       cprintf_f(-1, 1, 9, 2,
+                       cprintf_f(NO_UNIT, 1, 9, 2,
                                  tis ? ((double) tisfreq) / tis : 0.0);
                        printf("\n");
                }
@@ -2550,7 +2550,7 @@ void stub_print_pwr_usb_stats(struct activity *a, int curr, int dispavg)
                cprintf_x(2, 9,
                          suc->vendor_id,
                          suc->product_id);
-               cprintf_u64(-1, 1, 9,
+               cprintf_u64(NO_UNIT, 1, 9,
                            /* bMaxPower is expressed in 2 mA units */
                            (unsigned long long) (suc->bmaxpower << 1));
 
@@ -2644,11 +2644,11 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int curr, int di
 {
        int i, j;
        struct stats_filesystem *sfc, *sfm;
-       int unit = -1;
+       int unit = NO_UNIT;
 
        if (DISPLAY_UNIT(flags)) {
                /* Default values unit is B */
-               unit = 1;
+               unit = UNIT_BYTE;
        }
 
        if (dis) {
@@ -2674,7 +2674,7 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int curr, int di
                           : 0.0,
                           sfc->f_blocks ? SP_VALUE(sfc->f_bavail, sfc->f_blocks, sfc->f_blocks)
                           : 0.0);
-               cprintf_u64(-1, 2, 9,
+               cprintf_u64(NO_UNIT, 2, 9,
                            (unsigned long long) sfc->f_ffree,
                            (unsigned long long) (sfc->f_files - sfc->f_ffree));
                cprintf_pc(1, 9, 2,
@@ -2767,7 +2767,7 @@ __print_funct_t print_fchost_stats(struct activity *a, int prev, int curr,
                        break;
 
                printf("%-11s", timestamp[curr]);
-               cprintf_f(-1, 4, 9, 2,
+               cprintf_f(NO_UNIT, 4, 9, 2,
                          S_VALUE(sfcp->f_rxframes, sfcc->f_rxframes, itv),
                          S_VALUE(sfcp->f_txframes, sfcc->f_txframes, itv),
                          S_VALUE(sfcp->f_rxwords,  sfcc->f_rxwords,  itv),
@@ -2832,7 +2832,7 @@ __print_funct_t print_softnet_stats(struct activity *a, int prev, int curr,
                                cprintf_in(IS_INT, " %7d", "", i - 1);
                        }
 
-                       cprintf_f(-1, 5, 9, 2,
+                       cprintf_f(NO_UNIT, 5, 9, 2,
                                  S_VALUE(ssnp->processed,    ssnc->processed,    itv),
                                  S_VALUE(ssnp->dropped,      ssnc->dropped,      itv),
                                  S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv),
index c1698f1f798cf9d1b4c4212811fdd07f0e6ab507..b03f1b8f0a3446316757912b0f89ed60f983dd87 100644 (file)
@@ -446,10 +446,10 @@ void tape_write_stats(struct calc_stats *tape, int i)
        sprintf(buffer, "st%i        ", i);
        buffer[5] = 0;
        cprintf_in(IS_STR, "%s", buffer, 0);
-       cprintf_u64(-1, 2, 7,
+       cprintf_u64(NO_UNIT, 2, 7,
                    tape->reads_per_second,
                    tape->writes_per_second);
-       cprintf_u64(DISPLAY_UNIT(flags) ? 2 : -1, 2, 11,
+       cprintf_u64(DISPLAY_UNIT(flags) ? UNIT_KILOBYTE : NO_UNIT, 2, 11,
                    DISPLAY_UNIT(flags) ? tape->kbytes_read_per_second
                                        : tape->kbytes_read_per_second / divisor,
                    DISPLAY_UNIT(flags) ? tape->kbytes_written_per_second
@@ -458,7 +458,7 @@ void tape_write_stats(struct calc_stats *tape, int i)
                   (double) tape->read_pct_wait,
                   (double) tape->write_pct_wait,
                   (double) tape->all_pct_wait);
-       cprintf_u64(-1, 2, 7,
+       cprintf_u64(NO_UNIT, 2, 7,
                    tape->resids_per_second,
                    tape->other_per_second);
        printf("\n");