View | Details | Raw Unified | Return to bug 191976 | Differences between
and this patch

Collapse All | Expand All

(-)vmstat.c (-15 / +15 lines)
Lines 768-786 Link Here
768
768
769
		fill_vmmeter(&sum);
769
		fill_vmmeter(&sum);
770
		fill_vmtotal(&total);
770
		fill_vmtotal(&total);
771
		(void)printf("%2d %1d %1d",
771
		(void)printf("%1d %1d %1d",
772
		    total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw);
772
		    total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw);
773
#define vmstat_pgtok(a) ((a) * (sum.v_page_size >> 10))
773
#define vmstat_pgtok(a) ((a) * (sum.v_page_size >> 10))
774
#define	rate(x)	(((x) * rate_adj + halfuptime) / uptime)	/* round */
774
#define	rate(x)	(((x) * rate_adj + halfuptime) / uptime)	/* round */
775
		if (hflag) {
775
		if (hflag) {
776
			printf(" ");
776
			printf(" ");
777
			prthuman(total.t_avm * (u_int64_t)sum.v_page_size, 7);
777
			prthuman(total.t_avm * (u_int64_t)sum.v_page_size, 5);
778
			printf(" ");
778
			printf(" ");
779
			prthuman(total.t_free * (u_int64_t)sum.v_page_size, 6);
779
			prthuman(total.t_free * (u_int64_t)sum.v_page_size, 5);
780
			printf(" ");
780
			printf(" ");
781
		} else {
781
		} else {
782
			printf(" %7d ", vmstat_pgtok(total.t_avm));
782
			printf(" %6d", vmstat_pgtok(total.t_avm));
783
			printf(" %6d ", vmstat_pgtok(total.t_free));
783
			printf(" %5d ", vmstat_pgtok(total.t_free));
784
		}
784
		}
785
		(void)printf("%5lu ",
785
		(void)printf("%5lu ",
786
		    (unsigned long)rate(sum.v_vm_faults - osum.v_vm_faults));
786
		    (unsigned long)rate(sum.v_vm_faults - osum.v_vm_faults));
Lines 794-803 Link Here
794
		    (osum.v_swapout + osum.v_vnodeout)));
794
		    (osum.v_swapout + osum.v_vnodeout)));
795
		(void)printf("%5lu ",
795
		(void)printf("%5lu ",
796
		    (unsigned long)rate(sum.v_tfree - osum.v_tfree));
796
		    (unsigned long)rate(sum.v_tfree - osum.v_tfree));
797
		(void)printf("%3lu ",
797
		(void)printf("%4lu ",
798
		    (unsigned long)rate(sum.v_pdpages - osum.v_pdpages));
798
		    (unsigned long)rate(sum.v_pdpages - osum.v_pdpages));
799
		devstats();
799
		devstats();
800
		(void)printf("%4lu %4lu %4lu",
800
		(void)printf("%4lu %5lu %4lu",
801
		    (unsigned long)rate(sum.v_intr - osum.v_intr),
801
		    (unsigned long)rate(sum.v_intr - osum.v_intr),
802
		    (unsigned long)rate(sum.v_syscall - osum.v_syscall),
802
		    (unsigned long)rate(sum.v_syscall - osum.v_syscall),
803
		    (unsigned long)rate(sum.v_swtch - osum.v_swtch));
803
		    (unsigned long)rate(sum.v_swtch - osum.v_swtch));
Lines 830-850 Link Here
830
	int i, num_shown;
830
	int i, num_shown;
831
831
832
	num_shown = (num_selected < maxshowdevs) ? num_selected : maxshowdevs;
832
	num_shown = (num_selected < maxshowdevs) ? num_selected : maxshowdevs;
833
	(void)printf(" procs      memory      page%*s", 19, "");
833
	(void)printf("procs   memory      page%*s ", 19, "");
834
	if (num_shown > 1)
834
	if (num_shown > 1)
835
		(void)printf(" disks %*s", num_shown * 4 - 7, "");
835
		(void)printf("   disks %*s", num_shown * 4 - 7, "");
836
	else if (num_shown == 1)
836
	else if (num_shown == 1)
837
		(void)printf("disk");
837
		(void)printf("   disk");
838
	(void)printf("   faults         ");
838
	(void)printf("      faults      ");
839
	if (Pflag) {
839
	if (Pflag) {
840
		for (i = 0; i < ncpus; i++) {
840
		for (i = 0; i < ncpus; i++) {
841
			if (cpumask & (1ul << i))
841
			if (cpumask & (1ul << i))
842
				printf("cpu%-2d    ", i);
842
				printf("  cpu%d   ", i);
843
		}
843
		}
844
		printf("\n");
844
		printf("\n");
845
	} else
845
	} else
846
		printf("cpu\n");
846
		printf("  cpu\n");
847
	(void)printf(" r b w     avm    fre   flt  re  pi  po    fr  sr ");
847
	(void)printf("r b w   avm   fre   flt  re  pi  po    fr   sr ");
848
	for (i = 0; i < num_devices; i++)
848
	for (i = 0; i < num_devices; i++)
849
		if ((dev_select[i].selected)
849
		if ((dev_select[i].selected)
850
		 && (dev_select[i].selected <= maxshowdevs))
850
		 && (dev_select[i].selected <= maxshowdevs))
Lines 851-857 Link Here
851
			(void)printf("%c%c%d ", dev_select[i].device_name[0],
851
			(void)printf("%c%c%d ", dev_select[i].device_name[0],
852
				     dev_select[i].device_name[1],
852
				     dev_select[i].device_name[1],
853
				     dev_select[i].unit_number);
853
				     dev_select[i].unit_number);
854
	(void)printf("  in   sy   cs");
854
	(void)printf("  in    sy   cs");
855
	if (Pflag) {
855
	if (Pflag) {
856
		for (i = 0; i < ncpus; i++)
856
		for (i = 0; i < ncpus; i++)
857
			printf(" us sy id");
857
			printf(" us sy id");

Return to bug 191976