diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-05 22:55:22 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-09 07:45:29 -0400 |
commit | 5efe08cf685f33f562566dc68b6077b6f6a4f706 (patch) | |
tree | ae792d0ba092caed622825a39fec84eb6c67174c /tools/perf/builtin-lock.c | |
parent | 84c7a21791eb2e962a27e19bab5b77d5d9e13a34 (diff) |
perf: Fix perf lock bad rate
Fix the cast made to get the bad rate. It is made in the result
instead of the operands. We need the operands to be cast in double,
otherwise the result will always be zero.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Diffstat (limited to 'tools/perf/builtin-lock.c')
-rw-r--r-- | tools/perf/builtin-lock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 3b304ed4d2e9..d7dde9cbbdf4 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c | |||
@@ -733,8 +733,8 @@ static void print_bad_events(int bad, int total) | |||
733 | { "acquire", "acquired", "contended", "release" }; | 733 | { "acquire", "acquired", "contended", "release" }; |
734 | 734 | ||
735 | pr_info("\n=== output for debug===\n\n"); | 735 | pr_info("\n=== output for debug===\n\n"); |
736 | pr_info("bad:%d, total:%d\n", bad, total); | 736 | pr_info("bad: %d, total: %d\n", bad, total); |
737 | pr_info("bad rate:%f\n", (double)(bad / total)); | 737 | pr_info("bad rate: %f %%\n", (double)bad / (double)total * 100); |
738 | pr_info("histogram of events caused bad sequence\n"); | 738 | pr_info("histogram of events caused bad sequence\n"); |
739 | for (i = 0; i < BROKEN_MAX; i++) | 739 | for (i = 0; i < BROKEN_MAX; i++) |
740 | pr_info(" %10s: %d\n", name[i], bad_hist[i]); | 740 | pr_info(" %10s: %d\n", name[i], bad_hist[i]); |