diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-lock.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 1e93179c2d30..3b304ed4d2e9 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c | |||
@@ -397,6 +397,11 @@ enum broken_state { | |||
397 | 397 | ||
398 | static int bad_hist[BROKEN_MAX]; | 398 | static int bad_hist[BROKEN_MAX]; |
399 | 399 | ||
400 | enum acquire_flags { | ||
401 | TRY_LOCK = 1, | ||
402 | READ_LOCK = 2, | ||
403 | }; | ||
404 | |||
400 | static void | 405 | static void |
401 | report_lock_acquire_event(struct trace_acquire_event *acquire_event, | 406 | report_lock_acquire_event(struct trace_acquire_event *acquire_event, |
402 | struct event *__event __used, | 407 | struct event *__event __used, |
@@ -421,9 +426,9 @@ report_lock_acquire_event(struct trace_acquire_event *acquire_event, | |||
421 | if (!acquire_event->flag) { | 426 | if (!acquire_event->flag) { |
422 | seq->state = SEQ_STATE_ACQUIRING; | 427 | seq->state = SEQ_STATE_ACQUIRING; |
423 | } else { | 428 | } else { |
424 | if (acquire_event->flag & 1) | 429 | if (acquire_event->flag & TRY_LOCK) |
425 | ls->nr_trylock++; | 430 | ls->nr_trylock++; |
426 | if (acquire_event->flag & 2) | 431 | if (acquire_event->flag & READ_LOCK) |
427 | ls->nr_readlock++; | 432 | ls->nr_readlock++; |
428 | seq->state = SEQ_STATE_READ_ACQUIRED; | 433 | seq->state = SEQ_STATE_READ_ACQUIRED; |
429 | seq->read_count = 1; | 434 | seq->read_count = 1; |
@@ -431,7 +436,7 @@ report_lock_acquire_event(struct trace_acquire_event *acquire_event, | |||
431 | } | 436 | } |
432 | break; | 437 | break; |
433 | case SEQ_STATE_READ_ACQUIRED: | 438 | case SEQ_STATE_READ_ACQUIRED: |
434 | if (acquire_event->flag & 2) { | 439 | if (acquire_event->flag & READ_LOCK) { |
435 | seq->read_count++; | 440 | seq->read_count++; |
436 | ls->nr_acquired++; | 441 | ls->nr_acquired++; |
437 | goto end; | 442 | goto end; |