Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191321
b: refs/heads/master
c: 84c7a21
h: refs/heads/master
i:
  191319: 41143c9
v: v3
  • Loading branch information
Frederic Weisbecker committed May 9, 2010
1 parent 669362f commit 03a7e68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10350ec362b48f79f3df8447c25813790075e27c
refs/heads/master: 84c7a21791eb2e962a27e19bab5b77d5d9e13a34
11 changes: 8 additions & 3 deletions trunk/tools/perf/builtin-lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ enum broken_state {

static int bad_hist[BROKEN_MAX];

enum acquire_flags {
TRY_LOCK = 1,
READ_LOCK = 2,
};

static void
report_lock_acquire_event(struct trace_acquire_event *acquire_event,
struct event *__event __used,
Expand All @@ -421,17 +426,17 @@ report_lock_acquire_event(struct trace_acquire_event *acquire_event,
if (!acquire_event->flag) {
seq->state = SEQ_STATE_ACQUIRING;
} else {
if (acquire_event->flag & 1)
if (acquire_event->flag & TRY_LOCK)
ls->nr_trylock++;
if (acquire_event->flag & 2)
if (acquire_event->flag & READ_LOCK)
ls->nr_readlock++;
seq->state = SEQ_STATE_READ_ACQUIRED;
seq->read_count = 1;
ls->nr_acquired++;
}
break;
case SEQ_STATE_READ_ACQUIRED:
if (acquire_event->flag & 2) {
if (acquire_event->flag & READ_LOCK) {
seq->read_count++;
ls->nr_acquired++;
goto end;
Expand Down

0 comments on commit 03a7e68

Please sign in to comment.