Deleted Added
full compact
pdb.c (141638) pdb.c (168456)
1/*
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * 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

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * 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

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/usr.sbin/sa/pdb.c 141638 2005-02-10 12:43:16Z delphij $");
32__FBSDID("$FreeBSD: head/usr.sbin/sa/pdb.c 168456 2007-04-07 06:38:19Z dds $");
33
34#include <sys/types.h>
35#include <sys/acct.h>
36#include <err.h>
37#include <errno.h>
38#include <fcntl.h>
39#include <stdint.h>
40#include <stdio.h>

--- 294 unchanged lines hidden (view full) ---

335 t = 0.01;
336 uflow = 1;
337 } else
338 uflow = 0;
339
340 printf("%8ju ", (uintmax_t)cip->ci_calls);
341 if (cflag) {
342 if (cip != totalcip)
33
34#include <sys/types.h>
35#include <sys/acct.h>
36#include <err.h>
37#include <errno.h>
38#include <fcntl.h>
39#include <stdint.h>
40#include <stdio.h>

--- 294 unchanged lines hidden (view full) ---

335 t = 0.01;
336 uflow = 1;
337 } else
338 uflow = 0;
339
340 printf("%8ju ", (uintmax_t)cip->ci_calls);
341 if (cflag) {
342 if (cip != totalcip)
343 printf(" %4.2f%% ",
344 cip->ci_calls / (double) totalcip->ci_calls);
343 printf(" %4.1f%% ", cip->ci_calls /
344 (double)totalcip->ci_calls * 100);
345 else
346 printf(" %4s ", "");
347 }
348
349 if (jflag)
350 printf("%11.2fre ", cip->ci_etime / (double) (AHZ * c));
351 else
352 printf("%11.2fre ", cip->ci_etime / (60.0 * AHZ));
353 if (cflag) {
354 if (cip != totalcip)
345 else
346 printf(" %4s ", "");
347 }
348
349 if (jflag)
350 printf("%11.2fre ", cip->ci_etime / (double) (AHZ * c));
351 else
352 printf("%11.2fre ", cip->ci_etime / (60.0 * AHZ));
353 if (cflag) {
354 if (cip != totalcip)
355 printf(" %4.2f%% ",
356 cip->ci_etime / (double) totalcip->ci_etime);
355 printf(" %4.1f%% ", cip->ci_etime /
356 (double)totalcip->ci_etime * 100);
357 else
358 printf(" %4s ", "");
359 }
360
361 if (!lflag) {
362 if (jflag)
363 printf("%11.2fcp ", t / (double) cip->ci_calls);
364 else
365 printf("%11.2fcp ", t / 60.0);
366 if (cflag) {
367 if (cip != totalcip)
357 else
358 printf(" %4s ", "");
359 }
360
361 if (!lflag) {
362 if (jflag)
363 printf("%11.2fcp ", t / (double) cip->ci_calls);
364 else
365 printf("%11.2fcp ", t / 60.0);
366 if (cflag) {
367 if (cip != totalcip)
368 printf(" %4.2f%% ",
369 (cip->ci_utime + cip->ci_stime) / (double)
370 (totalcip->ci_utime + totalcip->ci_stime));
368 printf(" %4.1f%% ",
369 (double)(cip->ci_utime + cip->ci_stime) /
370 (totalcip->ci_utime + totalcip->ci_stime) *
371 100);
371 else
372 printf(" %4s ", "");
373 }
374 } else {
375 if (jflag)
376 printf("%11.2fu ", cip->ci_utime / (double) (AHZ * c));
377 else
378 printf("%11.2fu ", cip->ci_utime / (60.0 * AHZ));
379 if (cflag) {
380 if (cip != totalcip)
372 else
373 printf(" %4s ", "");
374 }
375 } else {
376 if (jflag)
377 printf("%11.2fu ", cip->ci_utime / (double) (AHZ * c));
378 else
379 printf("%11.2fu ", cip->ci_utime / (60.0 * AHZ));
380 if (cflag) {
381 if (cip != totalcip)
381 printf(" %4.2f%% ", cip->ci_utime / (double) totalcip->ci_utime);
382 printf(" %4.1f%% ", cip->ci_utime /
383 (double)totalcip->ci_utime * 100);
382 else
383 printf(" %4s ", "");
384 }
385 if (jflag)
386 printf("%11.2fs ", cip->ci_stime / (double) (AHZ * c));
387 else
388 printf("%11.2fs ", cip->ci_stime / (60.0 * AHZ));
389 if (cflag) {
390 if (cip != totalcip)
384 else
385 printf(" %4s ", "");
386 }
387 if (jflag)
388 printf("%11.2fs ", cip->ci_stime / (double) (AHZ * c));
389 else
390 printf("%11.2fs ", cip->ci_stime / (60.0 * AHZ));
391 if (cflag) {
392 if (cip != totalcip)
391 printf(" %4.2f%% ", cip->ci_stime / (double) totalcip->ci_stime);
393 printf(" %4.1f%% ", cip->ci_stime /
394 (double)totalcip->ci_stime * 100);
392 else
393 printf(" %4s ", "");
394 }
395 }
396
397 if (tflag) {
398 if (!uflow)
399 printf("%8.2fre/cp ",

--- 18 unchanged lines hidden ---
395 else
396 printf(" %4s ", "");
397 }
398 }
399
400 if (tflag) {
401 if (!uflow)
402 printf("%8.2fre/cp ",

--- 18 unchanged lines hidden ---