From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Gautam Menghani <gautam@linux.ibm.com>,
peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org,
mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, adrian.hunter@intel.com,
kan.liang@linux.intel.com, maddy@linux.ibm.com,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] perf python: Add an example for sampling
Date: Wed, 17 Sep 2025 13:41:55 -0300 [thread overview]
Message-ID: <aMrk03gigBlGcYLK@x1> (raw)
In-Reply-To: <CAP-5=fXnM15Zj5mCYcsd9usUMtHoPOd3Wz8-L1N5UaB-YvKuHQ@mail.gmail.com>
On Wed, Sep 17, 2025 at 08:29:24AM -0700, Ian Rogers wrote:
> On Wed, Sep 17, 2025 at 5:37 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > And make:
> > perf script rwtop
> > Just call 'python PATH_TO_PYTHON_SCRIPTS/rwtop.py' transparently?
> Yeah, that's it. The perf script libpython stuff is just providing
> trace_begin, process_event and trace_end. Using the sampling
> mechanism, as shown in Gautum's patches, it is pretty easy to migrate
> them to being stand alone bits of python.
> > That looks interesting indeed, that way we would stop linking with
> > libpython, etc.
> > I wonder if there are out of tree scripts using the current tools/perf/util/scripting-engines/trace-event-python.c
> > mechanism...
> > But even that can fallback to a python based mechanism, right?
> I think so. Like I said about the use of a Dict for process_event, we
> may want to streamline things so there is a tension with what the API
> should be and compatibility. We can always have 2 APIs and try to
> deprecate one of them.
> > Import the script, if it has a given structure, use the new way, if not,
> > call a glue that reads the events and feed to the old style code.
> > Seems doable and would save code on the main perf binary and headaches
> > with the libpython and libperl build processes.
> So I see this for libpython, and I think it'd be pretty cool if we
> could have things work like this for say "perf script ilist" and
I think we could even try to, not having a builtin-ilist.c convert
'perf ilist' to 'perf script ilist' automagically.
> Alice's textual flamegraph work. I worry what the work for libperl
> would be like and whether it is worth it (hence sending the patch to
> at least start to make it opt-in rather than opt-out).
Maybe we should be a tad more cautious and start with emitting a warning
that "libperl is deprecated (holler if you disagree if you use it!)" and
then make it opt-in, and then remove it.
> Do you need my tags for these changes or wdyt about making the
> kwlist/API surface smaller?
Lemme look at the original post...
- Arnaldo
next prev parent reply other threads:[~2025-09-17 16:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 5:59 [PATCH 0/2] perf python: Add an example for sampling Gautam Menghani
2025-07-28 5:59 ` [PATCH 1/2] perf python: Add support for record_opts struct Gautam Menghani
2025-07-28 5:59 ` [PATCH 2/2] perf python: Add sampling.py as example for sampling Gautam Menghani
2025-08-12 5:22 ` [PATCH 0/2] perf python: Add an " Gautam Menghani
2025-08-26 7:07 ` Gautam Menghani
2025-09-16 13:30 ` Gautam Menghani
2025-09-16 19:25 ` Arnaldo Carvalho de Melo
2025-09-16 20:07 ` Ian Rogers
2025-09-17 12:37 ` Arnaldo Carvalho de Melo
2025-09-17 15:29 ` Ian Rogers
2025-09-17 16:41 ` Arnaldo Carvalho de Melo [this message]
2025-09-17 17:26 ` Ian Rogers
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=aMrk03gigBlGcYLK@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=gautam@linux.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).