From: Michael Jeanson Date: Tue, 11 Feb 2020 20:35:11 +0000 (-0500) Subject: fix: workqueue: add worker function to workqueue_execute_end tracepoint (v5.6) X-Git-Tag: v2.12.0-rc2~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=61480a4b07f7269e380967d05738b0e003d11e66;p=lttng-modules.git fix: workqueue: add worker function to workqueue_execute_end tracepoint (v5.6) See upstream commit : commit 1c5da0ec7f20dfb56030fb93f7f52f48e12deb52 Author: Daniel Jordan Date: Mon Jan 13 17:52:39 2020 -0500 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: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/workqueue.h b/instrumentation/events/lttng-module/workqueue.h index e0ef9178..5e269e30 100644 --- a/instrumentation/events/lttng-module/workqueue.h +++ b/instrumentation/events/lttng-module/workqueue.h @@ -92,6 +92,26 @@ LTTNG_TRACEPOINT_EVENT(workqueue_execute_start, ) ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +/** + * 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. + */ +LTTNG_TRACEPOINT_EVENT(workqueue_execute_end, + + TP_PROTO(struct work_struct *work, work_func_t function), + + TP_ARGS(work, function), + + TP_FIELDS( + ctf_integer_hex(void *, work, work) + ctf_integer_hex(void *, function, function) + ) +) +#else /** * workqueue_execute_end - called immediately after the workqueue callback * @work: pointer to struct work_struct @@ -104,6 +124,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work, workqueue_execute_end, TP_ARGS(work) ) +#endif #endif /* LTTNG_TRACE_WORKQUEUE_H */