mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Kassey Li <quic_yingangl@quicinc.com>
Cc: <mhiramat@kernel.org>, <mathieu.desnoyers@efficios.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH] workqueue: add function in event of workqueue_activate_work
Date: Thu, 7 Mar 2024 20:50:44 -0500	[thread overview]
Message-ID: <20240307205044.1caf9fe2@gandalf.local.home> (raw)
In-Reply-To: <20240308010929.1955339-1-quic_yingangl@quicinc.com>

On Fri, 8 Mar 2024 09:09:29 +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.
> 
> 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@quicinc.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


>  
>  	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)
>  );
>  
>  /**


  reply	other threads:[~2024-03-08  1:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08  1:09 Kassey Li
2024-03-08  1:50 ` Steven Rostedt [this message]
2024-03-08  2:20   ` Kassey Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240307205044.1caf9fe2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=quic_yingangl@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®