aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorDaniel Jordan <daniel.m.jordan@oracle.com>2020-01-13 17:52:39 -0500
committerTejun Heo <tj@kernel.org>2020-01-15 08:02:47 -0800
commit1c5da0ec7f20dfb56030fb93f7f52f48e12deb52 (patch)
tree3d11637160fd144971fd285d6053e81ab77be84e /include/trace
parentMerge tag 'nfs-for-5.5-2' of git://git.linux-nfs.org/projects/anna/linux-nfs (diff)
downloadlinux-dev-1c5da0ec7f20dfb56030fb93f7f52f48e12deb52.tar.xz
linux-dev-1c5da0ec7f20dfb56030fb93f7f52f48e12deb52.zip
workqueue: add worker function to workqueue_execute_end tracepoint
It's surprising that workqueue_execute_end includes only the work when its counterpart workqueue_execute_start has both the work and the worker function. You can't set a tracing filter or trigger based on the function, and postprocessing scripts interested in specific functions are harder to write since they have to remember the work from _start and match it up with the same field in _end. Add the function name, taking care to use the copy stashed in the worker since the work is no longer safe to touch. Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com> Cc: Tejun Heo <tj@kernel.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/workqueue.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index e172549283be..bdfc53e7f82f 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -108,14 +108,27 @@ TRACE_EVENT(workqueue_execute_start,
/**
* workqueue_execute_end - called immediately after the workqueue callback
* @work: pointer to struct work_struct
+ * @function: pointer to worker function
*
* Allows to track workqueue execution.
*/
-DEFINE_EVENT(workqueue_work, workqueue_execute_end,
+TRACE_EVENT(workqueue_execute_end,
- TP_PROTO(struct work_struct *work),
+ TP_PROTO(struct work_struct *work, work_func_t function),
- TP_ARGS(work)
+ TP_ARGS(work, function),
+
+ TP_STRUCT__entry(
+ __field( void *, work )
+ __field( void *, function)
+ ),
+
+ TP_fast_assign(
+ __entry->work = work;
+ __entry->function = function;
+ ),
+
+ TP_printk("work struct %p: function %ps", __entry->work, __entry->function)
);
#endif /* _TRACE_WORKQUEUE_H */