fix: workqueue: add worker function to workqueue_execute_end tracepoint (v5.6)
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 11 Feb 2020 20:35:11 +0000 (15:35 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Feb 2020 15:23:57 +0000 (10:23 -0500)
See upstream commit :

  commit 1c5da0ec7f20dfb56030fb93f7f52f48e12deb52
  Author: Daniel Jordan <daniel.m.jordan@oracle.com>
  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 <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/workqueue.h

index 07d6a53d2286c5df018359c9b7c4468d05acc897..0f5b9386f750029dfbeb3723864717d28bf5cc69 100644 (file)
@@ -96,6 +96,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
@@ -108,6 +128,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work, workqueue_execute_end,
 
        TP_ARGS(work)
 )
+#endif
 
 #else
 
This page took 0.026671 seconds and 4 git commands to generate.