mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Rob Clark <robdclark@gmail.com>
Cc: linux-kernel@vger.kernel.org, Rob Clark <robdclark@chromium.org>,
	Ingo Molnar <mingo@redhat.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Phil Auld <pauld@redhat.com>,
	Valentin Schneider <valentin.schneider@arm.com>,
	Thara Gopinath <thara.gopinath@linaro.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Vincent Donnefort <vincent.donnefort@arm.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <axboe@kernel.dk>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Ilias Stamatis <stamatis.iliass@gmail.com>,
	Liang Chen <cl@rock-chips.com>,
	Ben Dooks <ben.dooks@codethink.co.uk>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	"J. Bruce Fields" <bfields@redhat.com>
Subject: Re: [PATCH] kthread: Add kthread_work tracepoints
Date: Mon, 12 Oct 2020 09:59:55 -0400	[thread overview]
Message-ID: <20201012095955.0741313b@gandalf.local.home> (raw)
In-Reply-To: <20201010180323.126634-1-robdclark@gmail.com>

On Sat, 10 Oct 2020 11:03:22 -0700
Rob Clark <robdclark@gmail.com> wrote:

> /**
> + * sched_kthread_work_execute_start - called immediately before the work callback
> + * @work:	pointer to struct kthread_work
> + *
> + * Allows to track kthread work execution.
> + */
> +TRACE_EVENT(sched_kthread_work_execute_start,
> +
> +	TP_PROTO(struct kthread_work *work),
> +
> +	TP_ARGS(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: function %ps", __entry->work, __entry->function)
> +);
> +
> +/**
> + * sched_kthread_work_execute_end - called immediately after the work callback
> + * @work:	pointer to struct work_struct
> + * @function:   pointer to worker function
> + *
> + * Allows to track workqueue execution.
> + */
> +TRACE_EVENT(sched_kthread_work_execute_end,
> +
> +	TP_PROTO(struct kthread_work *work, kthread_work_func_t function),
> +
> +	TP_ARGS(work, function),
> +
> +	TP_STRUCT__entry(
> +		__field( void *,	work	)
> +		__field( void *,	function)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->work		= work;
> +		__entry->function	= function;
> +	),
> +
> +	TP_printk("work struct %p: function %ps", __entry->work, __entry->function)
> +);
> +


Please combine the above into:

DECLARE_EVENT_CLASS(sched_kthread_work_execute_template,

	TP_PROTO(struct kthread_work *work),

	TP_ARGS(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: function %ps", __entry->work, __entry->function)
);

DEFINE_EVENT(sched_kthread_work_execute_template, sched_kthread_work_execute_start,
	TP_PROTO(struct kthread_work *work),
	TP_ARGS(work));

DEFINE_EVENT(sched_kthread_work_execute_template, sched_kthread_work_execute_end,
	TP_PROTO(struct kthread_work *work),
	TP_ARGS(work));

As events are cheap, classes are expensive (size wise), and a TRACE_EVENT()
is really just a CLASS and EVENT for a single instance.

-- Steve

  reply	other threads:[~2020-10-12 14:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10 18:03 Rob Clark
2020-10-12 13:59 ` Steven Rostedt [this message]
2020-10-12 15:14   ` Rob Clark
2020-10-12 15:37     ` Steven Rostedt

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=20201012095955.0741313b@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=ben.dooks@codethink.co.uk \
    --cc=bfields@redhat.com \
    --cc=cl@rock-chips.com \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pauld@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=robdclark@chromium.org \
    --cc=robdclark@gmail.com \
    --cc=stamatis.iliass@gmail.com \
    --cc=thara.gopinath@linaro.org \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.donnefort@arm.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®