[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2d1814fe-c44f-4b56-8b4a-039e30ee949a@quicinc.com>
Date: Fri, 8 Mar 2024 10:20:40 +0800
From: Kassey Li <quic_yingangl@...cinc.com>
To: Steven Rostedt <rostedt@...dmis.org>
CC: <mhiramat@...nel.org>, <mathieu.desnoyers@...icios.com>,
<linux-kernel@...r.kernel.org>, <linux-trace-kernel@...r.kernel.org>
Subject: Re: [PATCH] workqueue: add function in event of
workqueue_activate_work
On 2024/3/8 9:50, Steven Rostedt wrote:
> On Fri, 8 Mar 2024 09:09:29 +0800
> Kassey Li <quic_yingangl@...cinc.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.
>>
>> checkpatch.pl will report below error for the space:
>>
>> ERROR: space prohibited after that open parenthesis '('
>> #28: FILE: include/trace/events/workqueue.h:67:
>> + __field( void *, function)
>>
>> total: 1 errors, 0 warnings, 16 lines checked
>>
>> fix this error.
>>
>> Signed-off-by: Kassey Li <quic_yingangl@...cinc.com>
>> ---
>> include/trace/events/workqueue.h | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
>> index 262d52021c23..a42c1a293459 100644
>> --- a/include/trace/events/workqueue.h
>> +++ b/include/trace/events/workqueue.h
>> @@ -63,14 +63,16 @@ TRACE_EVENT(workqueue_activate_work,
>> TP_ARGS(work),
>>
>> TP_STRUCT__entry(
>> - __field( void *, work )
>> + __field(void *, work)
>> + __field(void *, function)
>
> Note, please do not follow checkpatch in TRACE_EVENT() macros. It simply
> doesn't understand it. The above is supposed to be similar to structure
> formatting.
>
> ie:
> struct __entry {
> void *work;
> void *function;
> };
>
> TP_STRUCT__entry(
> __field( void *, work )
> __field( void *, function )
> ),
>
> That looks much better.
>
> -- Steve
>
thanks for the remind.
send out the v2 as your suggest:
https://lore.kernel.org/all/20240308021818.2306176-1-quic_yingangl@quicinc.com/
>
>>
>> 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)
>> );
>>
>> /**
>
Powered by blists - more mailing lists