mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Melo <arnaldo.melo@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@kernel.org>
Subject: Re: perf-trace: improving ioctl details
Date: Fri, 20 Feb 2026 08:33:01 -0700	[thread overview]
Message-ID: <2ee59b89-2766-47e7-8527-3541b5549c05@kernel.org> (raw)
In-Reply-To: <aZdbQYkeAzJlocmU@google.com>

Sorry for the delayed response; my time seems to evaporate these days.

On 2/19/26 11:49 AM, Namhyung Kim wrote:
>>> Questions for you:
>>> 1. is such an open ended design acceptable for perf-trace?
>>
>> Is it lazy, i.e. only when needed this cache/table gets loaded? 
> 
> I think it's ok.  But I'm curious what's the actual usecases.. do you
> want it for testing kernels and drivers?  I guess we can have a default
> table for regular users and provide the option for kernel developers.

The idea is that ioctl is a very open ended and overloaded uapi, and I
wanted better granularity on how that time was spent. The breakdown by
filename and NR is one level; improving human readability of the NR is
another.

For the latter, if you look at tools/perf/trace/beauty/ioctl.c, you can
see how human readability for NRs has been improved for specific
subsystems tty, drm, pcm, kvm, ... (the table in ioctl__scnprintf_cmd),
but that design is not going to scale for all of the devices and
drivers, especially those with dynamic major numbers. Allowing runtime
loading of files seemed like an easy way to accommodate the range of
ioctl users in a flexible way. (though it too has limitations given the
multiplexing on specific NRs)

> 
>>
>>>
>>> 2. if yes, is there any preference on file format (json, yaml,
>>> key-value, ...)?
>>
>> We already have JSON parsing infra, so probably that is better? 

json is used for the PMU files, but it seems to be used only for code
generation (pmu-events/pmu-events.c) at build time, not run time loading
which I was targeting. Hence the question on format.

> 
> JSON should be fine, although it's a bit verbose.  I'm fine with plain
> KEY=VALUE format too if it's really a simple mapping.

key=value format is what I have now. The only awkwardness is a header to
declare the filename it corresponds to and then a further complication
is the need for a wildcard format as there are examples that have
multiple instances (e.g., /dev/infiniband/uverbs*).

> 
>>
>> Great to see you contributing to perf again! 
> 
> +1
> 

Thanks. perf-trace code has changed quite a bit over the past 10 years.


  reply	other threads:[~2026-02-20 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 17:09 David Ahern
2026-02-18 19:34 ` Arnaldo Melo
2026-02-19 18:49   ` Namhyung Kim
2026-02-20 15:33     ` David Ahern [this message]
2026-02-26  1:41       ` Namhyung Kim

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=2ee59b89-2766-47e7-8527-3541b5549c05@kernel.org \
    --to=dsahern@kernel.org \
    --cc=acme@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@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®