Skip to contentSkip to conversation

workqueue: tracing the name of the workqueue instead of it's address

PATCH Applied [email protected] 2 participants 2 messages Jan 4, 2021 – Jan 19, 2021 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: tracing the name of the workqueue instead of it's address

From: Zqiang <[email protected]>

This patch tracing workqueue name instead of it's address, the new format is as follows.

workqueue_queue_work: work struct=0000000084e3df56 function= drm_fb_helper_dirty_work workqueue=events req_cpu=256 cpu=1

This tell us to know which workqueue our work is queued.

---
 include/trace/events/workqueue.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/trace/events/workqueue.h +3 -3
index 9b8ae961acc5..970cc2ea2850 100644
@@ -30,7 +30,7 @@ TRACE_EVENT(workqueue_queue_work,
 	TP_STRUCT__entry(
 		__field( void *,	work	)
 		__field( void *,	function)
-		__field( void *,	workqueue)
+		__field( const char *,	workqueue)
 		__field( unsigned int,	req_cpu	)
 		__field( unsigned int,	cpu	)
 	),
@@ -38,12 +38,12 @@ TRACE_EVENT(workqueue_queue_work,
 	TP_fast_assign(
 		__entry->work		= work;
 		__entry->function	= work->func;
-		__entry->workqueue	= pwq->wq;
+		__entry->workqueue	= pwq->wq->name;
 		__entry->req_cpu	= req_cpu;
 		__entry->cpu		= pwq->pool->cpu;
 	),
 
-	TP_printk("work struct=%p function=%ps workqueue=%p req_cpu=%u cpu=%u",
+	TP_printk("work struct=%p function=%ps workqueue=%s req_cpu=%u cpu=%u",
 		  __entry->work, __entry->function, __entry->workqueue,
 		  __entry->req_cpu, __entry->cpu)
 );
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 11 lines · On Mon, Jan 04, 2021 at 08:43:06PM +0800, [email protected] wrote:

From: Zqiang <[email protected]>

This patch tracing workqueue name instead of it's address, the new format is as follows.

workqueue_queue_work: work struct=0000000084e3df56 function= drm_fb_helper_dirty_work workqueue=events req_cpu=256 cpu=1

This tell us to know which workqueue our work is queued.

Applied to wq/for-5.12.

Thanks.

Signature · 1 line
tejun