Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145989
b: refs/heads/master
c: 2062501
h: refs/heads/master
i:
  145987: af68652
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Apr 10, 2009
1 parent 8b3f1d1 commit 4ad5229
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 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: 1cad1252ed279ea59f3f8d3d3a5817eeb2f7a4d3
refs/heads/master: 2062501ae6505dbc5bff3a792246c2661d114050
23 changes: 18 additions & 5 deletions trunk/include/trace/lockdep_event_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,24 @@ TRACE_FORMAT(lock_contended,
TP_FMT("%s", lock->name)
);

TRACE_FORMAT(lock_acquired,
TP_PROTO(struct lockdep_map *lock, unsigned long ip),
TP_ARGS(lock, ip),
TP_FMT("%s", lock->name)
);
TRACE_EVENT(lock_acquired,
TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),

TP_ARGS(lock, ip, waittime),

TP_STRUCT__entry(
__field(const char *, name)
__field(unsigned long, wait_usec)
__field(unsigned long, wait_nsec_rem)
),
TP_fast_assign(
__entry->name = lock->name;
__entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
__entry->wait_usec = (unsigned long) waittime;
),
TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
__entry->wait_nsec_rem)
);

#endif
#endif
Expand Down
8 changes: 4 additions & 4 deletions trunk/kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -3061,6 +3061,8 @@ __lock_contended(struct lockdep_map *lock, unsigned long ip)
put_lock_stats(stats);
}

DEFINE_TRACE(lock_acquired);

static void
__lock_acquired(struct lockdep_map *lock, unsigned long ip)
{
Expand Down Expand Up @@ -3099,6 +3101,8 @@ __lock_acquired(struct lockdep_map *lock, unsigned long ip)
hlock->holdtime_stamp = now;
}

trace_lock_acquired(lock, ip, waittime);

stats = get_lock_stats(hlock_class(hlock));
if (waittime) {
if (hlock->read)
Expand Down Expand Up @@ -3137,14 +3141,10 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip)
}
EXPORT_SYMBOL_GPL(lock_contended);

DEFINE_TRACE(lock_acquired);

void lock_acquired(struct lockdep_map *lock, unsigned long ip)
{
unsigned long flags;

trace_lock_acquired(lock, ip);

if (unlikely(!lock_stat))
return;

Expand Down

0 comments on commit 4ad5229

Please sign in to comment.