public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: Changwoo Min <changwoo@igalia.com>,
	void@manifault.com, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] sched_ext: Add trace point to track sched_ext core events
Date: Tue, 4 Mar 2025 08:08:29 -1000	[thread overview]
Message-ID: <Z8dBnf66Opy8IseT@slm.duckdns.org> (raw)
In-Reply-To: <Z8bwAdeAuNQgJCR2@gpd3>

On Tue, Mar 04, 2025 at 01:20:17PM +0100, Andrea Righi wrote:
> On Tue, Mar 04, 2025 at 07:49:00PM +0900, Changwoo Min wrote:
> > Add tracing support to track sched_ext core events
> > (/sched_ext/sched_ext_event). This may be useful for debugging sched_ext
> > schedulers that trigger a particular event.
> > 
> > The trace point can be used as other trace points, so it can be used in,
> > for example, `perf trace` and BPF programs, as follows:
> > 
> > ======
> > $> sudo perf trace -e sched_ext:sched_ext_event --filter 'name == "SCX_EV_ENQ_SLICE_DFL"'
> > ======
> > 
> > ======
> > struct tp_sched_ext_event {
> > 	struct trace_entry ent;
> > 	u32 __data_loc_name;
> > 	s64 delta;
> > };
> > 
> > SEC("tracepoint/sched_ext/sched_ext_event")
> > int rtp_add_event(struct tp_sched_ext_event *ctx)
> > {
> > 	char event_name[128];
> > 	unsigned short offset = ctx->__data_loc_name & 0xFFFF;
> >         bpf_probe_read_str((void *)event_name, 128, (char *)ctx + offset);
> > 
> > 	bpf_printk("name %s   delta %lld", event_name, ctx->delta);
> > 	return 0;
> > }
> > ======
> > 
> > Signed-off-by: Changwoo Min <changwoo@igalia.com>
> > ---
> >  include/trace/events/sched_ext.h | 19 +++++++++++++++++++
> >  kernel/sched/ext.c               |  2 ++
> >  2 files changed, 21 insertions(+)
> > 
> > diff --git a/include/trace/events/sched_ext.h b/include/trace/events/sched_ext.h
> > index fe19da7315a9..50e4b712735a 100644
> > --- a/include/trace/events/sched_ext.h
> > +++ b/include/trace/events/sched_ext.h
> > @@ -26,6 +26,25 @@ TRACE_EVENT(sched_ext_dump,
> >  	)
> >  );
> >  
> > +TRACE_EVENT(sched_ext_event,
> > +	    TP_PROTO(const char *name, __s64 delta),
> > +	    TP_ARGS(name, delta),
> > +
> > +	TP_STRUCT__entry(
> > +		__string(name, name)
> > +		__field(	__s64,		delta		)
> 
> nit: there's an extra space/tab after delta.

I think it's one of common formatting styles for tp definitions. If we don't
like it, we can just them in the future.

> But apart than that LGTM.
> 
> Acked-by: Andrea Righi <arighi@nvidia.com>

Applied to sched_ext/for-6.15.

Thanks.

-- 
tejun

      reply	other threads:[~2025-03-04 18:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 10:48 [PATCH v4 0/2] sched_ext: Add trace point to sched_ext core events Changwoo Min
2025-03-04 10:48 ` [PATCH v4 1/2] sched_ext: Change the event type from u64 to s64 Changwoo Min
2025-03-04 18:05   ` Tejun Heo
2025-03-04 10:49 ` [PATCH v4 2/2] sched_ext: Add trace point to track sched_ext core events Changwoo Min
2025-03-04 12:20   ` Andrea Righi
2025-03-04 18:08     ` Tejun Heo [this message]

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=Z8dBnf66Opy8IseT@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=void@manifault.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