diff options
author | dds <dds@FreeBSD.org> | 2007-04-07 06:38:19 +0000 |
---|---|---|
committer | dds <dds@FreeBSD.org> | 2007-04-07 06:38:19 +0000 |
commit | 2e74e1223100a0042690317c9088e8f58c9e9fe8 (patch) | |
tree | 4b6d0877543ab5c6e6c085101f618c9efdb55753 | |
parent | 1bfe8ebed6fe77c90cb82473026fd7587731a72e (diff) | |
download | FreeBSD-src-2e74e1223100a0042690317c9088e8f58c9e9fe8.zip FreeBSD-src-2e74e1223100a0042690317c9088e8f58c9e9fe8.tar.gz |
Fix the output of percentage figures, which mistakenly were
the corresponding ratios.
PR: bin/111329
MFC after: 10 days
-rw-r--r-- | usr.sbin/sa/pdb.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/usr.sbin/sa/pdb.c b/usr.sbin/sa/pdb.c index 93dc24c..4dd9d27 100644 --- a/usr.sbin/sa/pdb.c +++ b/usr.sbin/sa/pdb.c @@ -340,8 +340,8 @@ print_ci(const struct cmdinfo *cip, const struct cmdinfo *totalcip) printf("%8ju ", (uintmax_t)cip->ci_calls); if (cflag) { if (cip != totalcip) - printf(" %4.2f%% ", - cip->ci_calls / (double) totalcip->ci_calls); + printf(" %4.1f%% ", cip->ci_calls / + (double)totalcip->ci_calls * 100); else printf(" %4s ", ""); } @@ -352,8 +352,8 @@ print_ci(const struct cmdinfo *cip, const struct cmdinfo *totalcip) printf("%11.2fre ", cip->ci_etime / (60.0 * AHZ)); if (cflag) { if (cip != totalcip) - printf(" %4.2f%% ", - cip->ci_etime / (double) totalcip->ci_etime); + printf(" %4.1f%% ", cip->ci_etime / + (double)totalcip->ci_etime * 100); else printf(" %4s ", ""); } @@ -365,9 +365,10 @@ print_ci(const struct cmdinfo *cip, const struct cmdinfo *totalcip) printf("%11.2fcp ", t / 60.0); if (cflag) { if (cip != totalcip) - printf(" %4.2f%% ", - (cip->ci_utime + cip->ci_stime) / (double) - (totalcip->ci_utime + totalcip->ci_stime)); + printf(" %4.1f%% ", + (double)(cip->ci_utime + cip->ci_stime) / + (totalcip->ci_utime + totalcip->ci_stime) * + 100); else printf(" %4s ", ""); } @@ -378,7 +379,8 @@ print_ci(const struct cmdinfo *cip, const struct cmdinfo *totalcip) printf("%11.2fu ", cip->ci_utime / (60.0 * AHZ)); if (cflag) { if (cip != totalcip) - printf(" %4.2f%% ", cip->ci_utime / (double) totalcip->ci_utime); + printf(" %4.1f%% ", cip->ci_utime / + (double)totalcip->ci_utime * 100); else printf(" %4s ", ""); } @@ -388,7 +390,8 @@ print_ci(const struct cmdinfo *cip, const struct cmdinfo *totalcip) printf("%11.2fs ", cip->ci_stime / (60.0 * AHZ)); if (cflag) { if (cip != totalcip) - printf(" %4.2f%% ", cip->ci_stime / (double) totalcip->ci_stime); + printf(" %4.1f%% ", cip->ci_stime / + (double)totalcip->ci_stime * 100); else printf(" %4s ", ""); } |