mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
69b26c7ad0
commit
e36c886a0f
2 changed files with 71 additions and 0 deletions
|
@ -35,6 +35,9 @@
|
|||
#include <linux/lockdep.h>
|
||||
#include <linux/idr.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/workqueue.h>
|
||||
|
||||
#include "workqueue_sched.h"
|
||||
|
||||
enum {
|
||||
|
@ -1790,7 +1793,13 @@ static void process_one_work(struct worker *worker, struct work_struct *work)
|
|||
work_clear_pending(work);
|
||||
lock_map_acquire(&cwq->wq->lockdep_map);
|
||||
lock_map_acquire(&lockdep_map);
|
||||
trace_workqueue_execute_start(work);
|
||||
f(work);
|
||||
/*
|
||||
* While we must be careful to not use "work" after this, the trace
|
||||
* point will only record its address.
|
||||
*/
|
||||
trace_workqueue_execute_end(work);
|
||||
lock_map_release(&lockdep_map);
|
||||
lock_map_release(&cwq->wq->lockdep_map);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue