mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Ilya Maximets <i.maximets@ovn.org>,
	Matthieu Baerts	 <matttbe@kernel.org>,
	Aaron Conole <aconole@redhat.com>,
	Eelco Chaudron	 <echaudro@redhat.com>,
	dev@openvswitch.org, Adrian Moreno <amorenoz@redhat.com>,
	Antoine Tenart <atenart@kernel.org>
Subject: Re: [PATCH v7 0/4] tracing: improve symbolic printing
Date: Thu, 5 Nov 2026 11:38:57 -0500	[thread overview]
Message-ID: <20261105113857.4737cffb@gandalf.local.home> (raw)
In-Reply-To: <ba474cdb3bb30c3eaf4aafc6534d0e77cfde64d4.camel@sipsolutions.net>

On Thu, 05 Nov 2026 17:26:58 +0100
Johannes Berg <johannes@sipsolutions.net> wrote:

> On Thu, 2026-11-05 at 11:24 -0500, Steven Rostedt wrote:
> > > Any objection to simply converting the __print_symbolic() sample? It
> > > would look something like this:  
> > 
> > Actually, keeping them both would be very useful. That way one can see how
> > to do it the other way. We can say, the old way is being deprecated so
> > please use the new way.  
> 
> What's the point? But OK, sure.

I thought I mentioned the point? "That way one can see how to do it the
other way". Basically, seeing the equivalent way.

> 
> > > +/*
> > > + * Alternatively, you could define a function for the names:
> > > + *
> > > + * The _lookup() function returns the string for the given value.
> > > + *
> > > + * The _show() function must
> > > + *	seq_printf(m, ", { %u, \"%s\" }", value, name);
> > > + * for each value that userspace should be able to parse.
> > > + */
> > > +const char *sample_names2_lookup(unsigned long long value);
> > > +void sample_names2_show(struct seq_file *m);  
> > 
> > Are the above going to be defined somewhere?  
> 
> Well, it's a sample, and I wasn't even using "sample_names2" in the
> below, so I didn't actually define it. I can flesh that out even more,
> but I'm not sure it's worth it?

It is, otherwise it is confusing. If it is in the sample code, people will
think it's required.

> 
> I reckon most users won't even need the dynamic way, but obviously part
> of the reason I'm doing this is that I _do_ need the dynamic way for the
> drop reasons, which are registered/built at runtime.

Right, but if we want to deprecate the old way, we need to have the
simplest sample of it. That is, have one event that shows the simple way to
do this (one that simply replaces the old way), and then have another
example of how to do it in a more complex and featureful way.

Honestly, this is why I asked for this. Your updates use the complex
method, I wasn't sure from the code how to do it for the simple case. That
is, what wasn't needed for just replacing static __print_symbolic() lists.

-- Steve

  reply	other threads:[~2026-11-05 16:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 11:08 Johannes Berg
2026-09-22 11:08 ` [PATCH v7 1/4] tracing: add __print_sym() to replace __print_symbolic() Johannes Berg
2026-09-22 11:08 ` [PATCH v7 2/4] tracing/timer: use __print_sym() Johannes Berg
2026-09-22 11:08 ` [PATCH v7 3/4] net: dropreason: use new __print_sym() in tracing Johannes Berg
2026-09-24 15:31   ` Ilya Maximets
2026-09-28 13:34   ` Aaron Conole
2026-09-22 11:08 ` [PATCH v7 4/4] net: drop_monitor: use drop_reason_lookup() Johannes Berg
2026-11-05 14:12 ` [PATCH v7 0/4] tracing: improve symbolic printing Steven Rostedt
2026-11-05 15:04   ` Johannes Berg
2026-11-05 16:24     ` Steven Rostedt
2026-11-05 16:26       ` Johannes Berg
2026-11-05 16:38         ` Steven Rostedt [this message]
2026-11-05 17:09           ` Johannes Berg

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=20261105113857.4737cffb@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=aconole@redhat.com \
    --cc=amorenoz@redhat.com \
    --cc=atenart@kernel.org \
    --cc=dev@openvswitch.org \
    --cc=echaudro@redhat.com \
    --cc=i.maximets@ovn.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=matttbe@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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®