diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2010-08-21 16:07:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-21 16:19:37 -0400 |
commit | e36c886a0f9d624377977fa6cae309cfd7f362fa (patch) | |
tree | f75e7c3e50a48c671ed4dff33103f601a2204af9 /kernel/workqueue.c | |
parent | 69b26c7ad00fd5b6129400725e2ffb95134a0e1b (diff) |
workqueue: Add basic tracepoints to track workqueue execution
With the introduction of the new unified work queue thread pools,
we lost one feature: It's no longer possible to know which worker
is causing the CPU to wake out of idle. The result is that PowerTOP
now reports a lot of "kworker/a:b" instead of more readable results.
This patch adds a pair of tracepoints to the new workqueue code,
similar in style to the timer/hrtimer tracepoints.
With this pair of tracepoints, the next PowerTOP can correctly
report which work item caused the wakeup (and how long it took):
Interrupt (43) i915 time 3.51ms wakeups 141
Work ieee80211_iface_work time 0.81ms wakeups 29
Work do_dbs_timer time 0.55ms wakeups 24
Process Xorg time 21.36ms wakeups 4
Timer sched_rt_period_timer time 0.01ms wakeups 1
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 2994a0e3a61..8bd600c020e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -35,6 +35,9 @@ | |||
35 | #include <linux/lockdep.h> | 35 | #include <linux/lockdep.h> |
36 | #include <linux/idr.h> | 36 | #include <linux/idr.h> |
37 | 37 | ||
38 | #define CREATE_TRACE_POINTS | ||
39 | #include <trace/events/workqueue.h> | ||
40 | |||
38 | #include "workqueue_sched.h" | 41 | #include "workqueue_sched.h" |
39 | 42 | ||
40 | enum { | 43 | enum { |
@@ -1790,7 +1793,13 @@ static void process_one_work(struct worker *worker, struct work_struct *work) | |||
1790 | work_clear_pending(work); | 1793 | work_clear_pending(work); |
1791 | lock_map_acquire(&cwq->wq->lockdep_map); | 1794 | lock_map_acquire(&cwq->wq->lockdep_map); |
1792 | lock_map_acquire(&lockdep_map); | 1795 | lock_map_acquire(&lockdep_map); |
1796 | trace_workqueue_execute_start(work); | ||
1793 | f(work); | 1797 | f(work); |
1798 | /* | ||
1799 | * While we must be careful to not use "work" after this, the trace | ||
1800 | * point will only record its address. | ||
1801 | */ | ||
1802 | trace_workqueue_execute_end(work); | ||
1794 | lock_map_release(&lockdep_map); | 1803 | lock_map_release(&lockdep_map); |
1795 | lock_map_release(&cwq->wq->lockdep_map); | 1804 | lock_map_release(&cwq->wq->lockdep_map); |
1796 | 1805 | ||