]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/workqueue.c
workqueue: Add basic tracepoints to track workqueue execution
[net-next-2.6.git] / kernel / workqueue.c
index 2994a0e3a61cc2cfdeb382936394456875a4c01c..8bd600c020e5cdf5f2454681bc2e89fcc99c47d0 100644 (file)
@@ -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);