FreeBSD Bugzilla – Attachment 148344 Details for
Bug 191976
[patch] vmstat(8): fix formatting to fit in 80 cols
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
vmstat.diff
vmstat.diff (text/plain), 4.61 KB, created by
Andy Kosela
on 2014-10-15 16:30:53 UTC
(
hide
)
Description:
vmstat.diff
Filename:
MIME Type:
Creator:
Andy Kosela
Created:
2014-10-15 16:30:53 UTC
Size:
4.61 KB
patch
obsolete
>Index: vmstat.c >=================================================================== >--- vmstat.c (revision 268845) >+++ vmstat.c (working copy) >@@ -768,22 +768,26 @@ > > fill_vmmeter(&sum); > fill_vmtotal(&total); >- (void)printf("%2d %1d %1d", >+ (void)printf("%1d %1d %1d", > total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); > #define vmstat_pgtok(a) ((a) * (sum.v_page_size >> 10)) > #define rate(x) (((x) * rate_adj + halfuptime) / uptime) /* round */ > if (hflag) { >+ printf(""); >+ prthuman(total.t_avm * (u_int64_t)sum.v_page_size, 5); > printf(" "); >- prthuman(total.t_avm * (u_int64_t)sum.v_page_size, 7); >+ prthuman(total.t_free * (u_int64_t)sum.v_page_size, 5); > printf(" "); >- prthuman(total.t_free * (u_int64_t)sum.v_page_size, 6); >- printf(" "); >+ (void)printf("%5lu ", >+ (unsigned long)rate(sum.v_vm_faults - >+ osum.v_vm_faults)); > } else { >- printf(" %7d ", vmstat_pgtok(total.t_avm)); >- printf(" %6d ", vmstat_pgtok(total.t_free)); >+ printf(" %7d", vmstat_pgtok(total.t_avm)); >+ printf(" %7d ", vmstat_pgtok(total.t_free)); >+ (void)printf("%4lu ", >+ (unsigned long)rate(sum.v_vm_faults - >+ osum.v_vm_faults)); > } >- (void)printf("%5lu ", >- (unsigned long)rate(sum.v_vm_faults - osum.v_vm_faults)); > (void)printf("%3lu ", > (unsigned long)rate(sum.v_reactivated - osum.v_reactivated)); > (void)printf("%3lu ", >@@ -794,10 +798,10 @@ > (osum.v_swapout + osum.v_vnodeout))); > (void)printf("%5lu ", > (unsigned long)rate(sum.v_tfree - osum.v_tfree)); >- (void)printf("%3lu ", >+ (void)printf("%4lu ", > (unsigned long)rate(sum.v_pdpages - osum.v_pdpages)); > devstats(); >- (void)printf("%4lu %4lu %4lu", >+ (void)printf("%4lu %5lu %5lu", > (unsigned long)rate(sum.v_intr - osum.v_intr), > (unsigned long)rate(sum.v_syscall - osum.v_syscall), > (unsigned long)rate(sum.v_swtch - osum.v_swtch)); >@@ -830,21 +834,29 @@ > int i, num_shown; > > num_shown = (num_selected < maxshowdevs) ? num_selected : maxshowdevs; >- (void)printf(" procs memory page%*s", 19, ""); >+ if (hflag) { >+ (void)printf("procs memory page%*s ", 19, ""); >+ } else { >+ (void)printf("procs memory page%*s ", 19, ""); >+ } > if (num_shown > 1) >- (void)printf(" disks %*s", num_shown * 4 - 7, ""); >+ (void)printf(" disks %*s", num_shown * 4 - 7, ""); > else if (num_shown == 1) >- (void)printf("disk"); >- (void)printf(" faults "); >+ (void)printf(" disk"); >+ (void)printf(" faults "); > if (Pflag) { > for (i = 0; i < ncpus; i++) { > if (cpumask & (1ul << i)) >- printf("cpu%-2d ", i); >+ printf(" cpu%d ", i); > } > printf("\n"); > } else >- printf("cpu\n"); >- (void)printf(" r b w avm fre flt re pi po fr sr "); >+ printf(" cpu\n"); >+ if (hflag) { >+ (void)printf("r b w avm fre flt re pi po fr sr "); >+ } else { >+ (void)printf("r b w avm fre flt re pi po fr sr "); >+ } > for (i = 0; i < num_devices; i++) > if ((dev_select[i].selected) > && (dev_select[i].selected <= maxshowdevs)) >@@ -851,7 +863,7 @@ > (void)printf("%c%c%d ", dev_select[i].device_name[0], > dev_select[i].device_name[1], > dev_select[i].unit_number); >- (void)printf(" in sy cs"); >+ (void)printf(" in sy cs"); > if (Pflag) { > for (i = 0; i < ncpus; i++) > printf(" us sy id"); >@@ -981,7 +993,8 @@ > (void)printf("%9u intransit blocking page faults\n", sum.v_intrans); > (void)printf("%9u total VM faults taken\n", sum.v_vm_faults); > (void)printf("%9u page faults requiring I/O\n", sum.v_io_faults); >- (void)printf("%9u pages affected by kernel thread creation\n", sum.v_kthreadpages); >+ (void)printf("%9u pages affected by kernel thread creation\n", >+ sum.v_kthreadpages); > (void)printf("%9u pages affected by fork()\n", sum.v_forkpages); > (void)printf("%9u pages affected by vfork()\n", sum.v_vforkpages); > (void)printf("%9u pages affected by rfork()\n", sum.v_rforkpages); >@@ -1123,7 +1136,8 @@ > continue; > for (state = 0; state < CPUSTATES; ++state) { > tmp = cur_cp_times[i * CPUSTATES + state]; >- cur_cp_times[i * CPUSTATES + state] -= last_cp_times[i * CPUSTATES + state]; >+ cur_cp_times[i * CPUSTATES + state] -= last_cp_times[i * >+ CPUSTATES + state]; > last_cp_times[i * CPUSTATES + state] = tmp; > } > } >@@ -1360,7 +1374,7 @@ > usage(void) > { > (void)fprintf(stderr, "%s%s", >- "usage: vmstat [-afHhimPsz] [-c count] [-M core [-N system]] [-w wait]\n", >- " [-n devs] [-p type,if,pass] [disks]\n"); >+ "usage: vmstat [-afHhimPsz] [-c count] [-M core [-N system]] [-w wait]\n", >+ " [-n devs] [-p type,if,pass] [disks]\n"); > exit(1); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 191976
:
144803
|
147490
|
147495
|
147560
|
147697
|
147698
| 148344