aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-lock.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-05-06 20:33:42 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-09 07:45:30 -0400
commit90c0e5fc7b73d2575c7367e1da70ff9521718e5e (patch)
tree555df001b47f27ae0a4339725e9ba06175e94ff1 /tools/perf/builtin-lock.c
parent5efe08cf685f33f562566dc68b6077b6f6a4f706 (diff)
perf lock: Always check min AND max wait time
When a lock is acquired after beeing contended, we update the wait time statistics for the given lock. But if the min wait time is updated, we don't check the max wait time. This is wrong because the first time we update the wait time, we want to update both min and max wait time. Before: Name acquired contended total wait (ns) max wait (ns) min wait (ns) key 8 1 21656 0 21656 After: Name acquired contended total wait (ns) max wait (ns) min wait (ns) key 8 1 21656 21656 21656 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index d7dde9cbbdf4..e549f4547b98 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -496,7 +496,7 @@ report_lock_acquired_event(struct trace_acquired_event *acquired_event,
496 ls->wait_time_total += contended_term; 496 ls->wait_time_total += contended_term;
497 if (contended_term < ls->wait_time_min) 497 if (contended_term < ls->wait_time_min)
498 ls->wait_time_min = contended_term; 498 ls->wait_time_min = contended_term;
499 else if (ls->wait_time_max < contended_term) 499 if (ls->wait_time_max < contended_term)
500 ls->wait_time_max = contended_term; 500 ls->wait_time_max = contended_term;
501 break; 501 break;
502 case SEQ_STATE_RELEASED: 502 case SEQ_STATE_RELEASED: