vmstat.c (14353) | vmstat.c (23952) |
---|---|
1/* 2 * Copyright (c) 1980, 1986, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 412 unchanged lines hidden (view full) --- 421 if (sysctl(mib, 2, &total, &size, NULL, 0) < 0) { 422 printf("Can't get kerninfo: %s\n", strerror(errno)); 423 bzero(&total, sizeof(total)); 424 } 425 (void)printf("%2d%2d%2d", 426 total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); 427#define pgtok(a) ((a) * sum.v_page_size >> 10) 428#define rate(x) (((x) + halfuptime) / uptime) /* round */ | 1/* 2 * Copyright (c) 1980, 1986, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 412 unchanged lines hidden (view full) --- 421 if (sysctl(mib, 2, &total, &size, NULL, 0) < 0) { 422 printf("Can't get kerninfo: %s\n", strerror(errno)); 423 bzero(&total, sizeof(total)); 424 } 425 (void)printf("%2d%2d%2d", 426 total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); 427#define pgtok(a) ((a) * sum.v_page_size >> 10) 428#define rate(x) (((x) + halfuptime) / uptime) /* round */ |
429 (void)printf("%6ld%6ld ", | 429 (void)printf("%8ld%6ld ", |
430 pgtok(total.t_avm), pgtok(total.t_free)); 431 (void)printf("%4lu ", rate(sum.v_vm_faults - osum.v_vm_faults)); 432 (void)printf("%3lu ", 433 rate(sum.v_reactivated - osum.v_reactivated)); 434 (void)printf("%3lu ", rate(sum.v_swapin + sum.v_vnodein - 435 (osum.v_swapin + osum.v_vnodein))); 436 (void)printf("%3lu ", rate(sum.v_swapout + sum.v_vnodeout - 437 (osum.v_swapout + osum.v_vnodeout))); --- 22 unchanged lines hidden (view full) --- 460 (void)sleep(interval); 461 } 462} 463 464printhdr() 465{ 466 register int i; 467 | 430 pgtok(total.t_avm), pgtok(total.t_free)); 431 (void)printf("%4lu ", rate(sum.v_vm_faults - osum.v_vm_faults)); 432 (void)printf("%3lu ", 433 rate(sum.v_reactivated - osum.v_reactivated)); 434 (void)printf("%3lu ", rate(sum.v_swapin + sum.v_vnodein - 435 (osum.v_swapin + osum.v_vnodein))); 436 (void)printf("%3lu ", rate(sum.v_swapout + sum.v_vnodeout - 437 (osum.v_swapout + osum.v_vnodeout))); --- 22 unchanged lines hidden (view full) --- 460 (void)sleep(interval); 461 } 462} 463 464printhdr() 465{ 466 register int i; 467 |
468 (void)printf(" procs memory page%*s", 20, ""); | 468 (void)printf(" procs memory page%*s", 20, ""); |
469 if (ndrives > 1) 470 (void)printf("disks %*s faults cpu\n", 471 ndrives * 3 - 6, ""); 472 else 473 (void)printf("%*s faults cpu\n", ndrives * 3, ""); | 469 if (ndrives > 1) 470 (void)printf("disks %*s faults cpu\n", 471 ndrives * 3 - 6, ""); 472 else 473 (void)printf("%*s faults cpu\n", ndrives * 3, ""); |
474 (void)printf(" r b w avm fre flt re pi po fr sr "); | 474 (void)printf(" r b w avm fre flt re pi po fr sr "); |
475 for (i = 0; i < dk_ndrive; i++) 476 if (dr_select[i]) 477 (void)printf("%c%c ", dr_name[i][0], 478 dr_name[i][strlen(dr_name[i]) - 1]); 479 (void)printf(" in sy cs us sy id\n"); 480 hdrcnt = winlines - 2; 481} 482 --- 355 unchanged lines hidden --- | 475 for (i = 0; i < dk_ndrive; i++) 476 if (dr_select[i]) 477 (void)printf("%c%c ", dr_name[i][0], 478 dr_name[i][strlen(dr_name[i]) - 1]); 479 (void)printf(" in sy cs us sy id\n"); 480 hdrcnt = winlines - 2; 481} 482 --- 355 unchanged lines hidden --- |