}
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,
}
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);
}
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 {
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));
__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 :
}
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)));
}
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 :
(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 :
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);
: 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);
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)));
}
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);
}
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 {
}
/* 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));
}
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);
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);
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);
}
}
}
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");
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");
}
}
}
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");
}
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),
* 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 :
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)) {
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,
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,
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");
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");
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),
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) {
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,
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) {
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));
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),
}
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),
}
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),
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,
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,
}
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),
}
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),
}
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),
}
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),
}
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),
}
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),
}
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),
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,
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,
}
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),
}
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),
}
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),
}
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),
}
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),
if (!dispavg) {
/* Display instantaneous values */
- cprintf_f(-1, 1, 9, 2,
+ cprintf_f(NO_UNIT, 1, 9, 2,
((double) spc->cpufreq) / 100);
printf("\n");
/*
}
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");
}
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;
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
}
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
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
}
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
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) {
}
/* 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");
}
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));
{
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) {
: 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,
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),
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),