linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] workqueue: add function in event of workqueue_activate_work
@ 2024-03-08  2:18 Kassey Li
  2024-03-08  2:23 ` Steven Rostedt
  2024-03-25 19:29 ` Tejun Heo
  0 siblings, 2 replies; 5+ messages in thread
From: Kassey Li @ 2024-03-08  2:18 UTC (permalink / raw)
  To: rostedt, mhiramat, mathieu.desnoyers, linux-kernel,
	linux-trace-kernel
  Cc: quic_yingangl

The trace event "workqueue_activate_work" only print work struct.
However, function is the region of interest in a full sequence of work.
Current workqueue_activate_work trace event output:

    workqueue_activate_work: work struct ffffff88b4a0f450

With this change, workqueue_activate_work will print the function name,
align with workqueue_queue_work/execute_start/execute_end event.

    workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update

Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
---
Changelog:
v1: https://lore.kernel.org/all/20240308010929.1955339-1-quic_yingangl@quicinc.com/
v1->v2:
- do not follow checkpatch in TRACE_EVENT() macros
- add sample "workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update"
---
 include/trace/events/workqueue.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index 262d52021c23..6ef5b7254070 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -64,13 +64,15 @@ TRACE_EVENT(workqueue_activate_work,
 
 	TP_STRUCT__entry(
 		__field( void *,	work	)
+		__field( void *,	function)
 	),
 
 	TP_fast_assign(
 		__entry->work		= work;
+		__entry->function	= work->func;
 	),
 
-	TP_printk("work struct %p", __entry->work)
+	TP_printk("work struct %p function=%ps ", __entry->work, __entry->function)
 );
 
 /**
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] workqueue: add function in event of workqueue_activate_work
  2024-03-08  2:18 [PATCH v2] workqueue: add function in event of workqueue_activate_work Kassey Li
@ 2024-03-08  2:23 ` Steven Rostedt
  2024-03-08  6:11   ` Kassey Li
  2024-03-19 23:49   ` kassey li
  2024-03-25 19:29 ` Tejun Heo
  1 sibling, 2 replies; 5+ messages in thread
From: Steven Rostedt @ 2024-03-08  2:23 UTC (permalink / raw)
  To: Kassey Li; +Cc: mhiramat, mathieu.desnoyers, linux-kernel, linux-trace-kernel

On Fri, 8 Mar 2024 10:18:18 +0800
Kassey Li <quic_yingangl@quicinc.com> wrote:

> The trace event "workqueue_activate_work" only print work struct.
> However, function is the region of interest in a full sequence of work.
> Current workqueue_activate_work trace event output:
> 
>     workqueue_activate_work: work struct ffffff88b4a0f450
> 
> With this change, workqueue_activate_work will print the function name,
> align with workqueue_queue_work/execute_start/execute_end event.
> 
>     workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update
> 
> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
> ---
> Changelog:
> v1: https://lore.kernel.org/all/20240308010929.1955339-1-quic_yingangl@quicinc.com/
> v1->v2:
> - do not follow checkpatch in TRACE_EVENT() macros
> - add sample "workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update"

From a tracing POV,

Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

> ---
>  include/trace/events/workqueue.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
> index 262d52021c23..6ef5b7254070 100644
> --- a/include/trace/events/workqueue.h
> +++ b/include/trace/events/workqueue.h
> @@ -64,13 +64,15 @@ TRACE_EVENT(workqueue_activate_work,
>  
>  	TP_STRUCT__entry(
>  		__field( void *,	work	)
> +		__field( void *,	function)
>  	),
>  
>  	TP_fast_assign(
>  		__entry->work		= work;
> +		__entry->function	= work->func;
>  	),
>  
> -	TP_printk("work struct %p", __entry->work)
> +	TP_printk("work struct %p function=%ps ", __entry->work, __entry->function)
>  );
>  
>  /**


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] workqueue: add function in event of workqueue_activate_work
  2024-03-08  2:23 ` Steven Rostedt
@ 2024-03-08  6:11   ` Kassey Li
  2024-03-19 23:49   ` kassey li
  1 sibling, 0 replies; 5+ messages in thread
From: Kassey Li @ 2024-03-08  6:11 UTC (permalink / raw)
  To: Steven Rostedt, Tejun Heo
  Cc: mhiramat, mathieu.desnoyers, linux-kernel, linux-trace-kernel



On 2024/3/8 10:23, Steven Rostedt wrote:
> On Fri, 8 Mar 2024 10:18:18 +0800
> Kassey Li <quic_yingangl@quicinc.com> wrote:
> 
>> The trace event "workqueue_activate_work" only print work struct.
>> However, function is the region of interest in a full sequence of work.
>> Current workqueue_activate_work trace event output:
>>
>>      workqueue_activate_work: work struct ffffff88b4a0f450
>>
>> With this change, workqueue_activate_work will print the function name,
>> align with workqueue_queue_work/execute_start/execute_end event.
>>
>>      workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update
>>
>> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
>> ---
>> Changelog:
>> v1: https://lore.kernel.org/all/20240308010929.1955339-1-quic_yingangl@quicinc.com/
>> v1->v2:
>> - do not follow checkpatch in TRACE_EVENT() macros
>> - add sample "workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update"
> 
>  From a tracing POV,
> 
> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> 
> -- Steve

thank you Steve.

add Tejun to review this change.

> 
>> ---
>>   include/trace/events/workqueue.h | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
>> index 262d52021c23..6ef5b7254070 100644
>> --- a/include/trace/events/workqueue.h
>> +++ b/include/trace/events/workqueue.h
>> @@ -64,13 +64,15 @@ TRACE_EVENT(workqueue_activate_work,
>>   
>>   	TP_STRUCT__entry(
>>   		__field( void *,	work	)
>> +		__field( void *,	function)
>>   	),
>>   
>>   	TP_fast_assign(
>>   		__entry->work		= work;
>> +		__entry->function	= work->func;
>>   	),
>>   
>> -	TP_printk("work struct %p", __entry->work)
>> +	TP_printk("work struct %p function=%ps ", __entry->work, __entry->function)
>>   );
>>   
>>   /**
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] workqueue: add function in event of workqueue_activate_work
  2024-03-08  2:23 ` Steven Rostedt
  2024-03-08  6:11   ` Kassey Li
@ 2024-03-19 23:49   ` kassey li
  1 sibling, 0 replies; 5+ messages in thread
From: kassey li @ 2024-03-19 23:49 UTC (permalink / raw)
  To: tj
  Cc: mhiramat, mathieu.desnoyers, linux-kernel, linux-trace-kernel,
	Kassey Li, Steven Rostedt



on 2024/3/8 10:23, Steven Rostedt wrote:
> On Fri, 8 Mar 2024 10:18:18 +0800
> Kassey Li <quic_yingangl@quicinc.com> wrote:
> 
>> The trace event "workqueue_activate_work" only print work struct.
>> However, function is the region of interest in a full sequence of work.
>> Current workqueue_activate_work trace event output:
>>
>>      workqueue_activate_work: work struct ffffff88b4a0f450
>>
>> With this change, workqueue_activate_work will print the function name,
>> align with workqueue_queue_work/execute_start/execute_end event.
>>
>>      workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update
>>
>> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
>> ---
>> Changelog:
>> v1: https://lore.kernel.org/all/20240308010929.1955339-1-quic_yingangl@quicinc.com/
>> v1->v2:
>> - do not follow checkpatch in TRACE_EVENT() macros
>> - add sample "workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update"
> 
>  From a tracing POV,
> 
> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> 
> -- Steve

hello, Tejun, may you have a chance to review this change ?

> 
>> ---
>>   include/trace/events/workqueue.h | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
>> index 262d52021c23..6ef5b7254070 100644
>> --- a/include/trace/events/workqueue.h
>> +++ b/include/trace/events/workqueue.h
>> @@ -64,13 +64,15 @@ TRACE_EVENT(workqueue_activate_work,
>>   
>>   	TP_STRUCT__entry(
>>   		__field( void *,	work	)
>> +		__field( void *,	function)
>>   	),
>>   
>>   	TP_fast_assign(
>>   		__entry->work		= work;
>> +		__entry->function	= work->func;
>>   	),
>>   
>> -	TP_printk("work struct %p", __entry->work)
>> +	TP_printk("work struct %p function=%ps ", __entry->work, __entry->function)
>>   );
>>   
>>   /**
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] workqueue: add function in event of workqueue_activate_work
  2024-03-08  2:18 [PATCH v2] workqueue: add function in event of workqueue_activate_work Kassey Li
  2024-03-08  2:23 ` Steven Rostedt
@ 2024-03-25 19:29 ` Tejun Heo
  1 sibling, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2024-03-25 19:29 UTC (permalink / raw)
  To: Kassey Li
  Cc: rostedt, mhiramat, mathieu.desnoyers, linux-kernel,
	linux-trace-kernel

On Fri, Mar 08, 2024 at 10:18:18AM +0800, Kassey Li wrote:
> The trace event "workqueue_activate_work" only print work struct.
> However, function is the region of interest in a full sequence of work.
> Current workqueue_activate_work trace event output:
> 
>     workqueue_activate_work: work struct ffffff88b4a0f450
> 
> With this change, workqueue_activate_work will print the function name,
> align with workqueue_queue_work/execute_start/execute_end event.
> 
>     workqueue_activate_work: work struct ffffff80413a78b8 function=vmstat_update
> 
> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>

Applied to wq/for-6.10.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-25 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-08  2:18 [PATCH v2] workqueue: add function in event of workqueue_activate_work Kassey Li
2024-03-08  2:23 ` Steven Rostedt
2024-03-08  6:11   ` Kassey Li
2024-03-19 23:49   ` kassey li
2024-03-25 19:29 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).