linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] perf python binding fixes
@ 2025-03-12 20:31 Arnaldo Carvalho de Melo
  2025-03-12 20:31 ` [PATCH 1/6] perf python: Fixup description of sample.id event member Arnaldo Carvalho de Melo
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-03-12 20:31 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Thomas Gleixner, James Clark, Jiri Olsa, Ian Rogers,
	Adrian Hunter, Kan Liang, Clark Williams, linux-kernel,
	linux-perf-users, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Hi Namhyung,

        So this simplifies it greatly, it almost ends up as a one-liner,
but there is an improvement as well to mark the event as consumed to
then parse its sample, because the copy of the whole event was done all
along.

        This is brittle, as the header size can be bigger, than the
space we use and in that case we fail to parse the event by bounds
checking it.

	Supporting larger event payloads can be done on top of this,
possibly by deferring consuming the event in the ring buffer by parsing
it all instead of having pre-allocated space, measurements need to be
made to see whats best. I'd say leave this for when it proves necessary.

        With this series I managed to run it for a long time without
crashes and 'top' says it doesn't seem to be leaking anything, as its
memory usage stays the same for as long as I looked.

        Please consider applying to perf-tools-next,

Best regards

P.S.: In other news, the syscalltbl series from Ian built on all my
containers, I'm now trying to go over it patch by patch.

Arnaldo Carvalho de Melo (6):
  perf python: Fixup description of sample.id event member
  perf python: Remove some unused macros (_PyUnicode_FromString(arg), etc)
  perf python tracepoint.py: Change the COMM using setproctitle if available
  perf python: Decrement the refcount of just created event on failure
  perf python: Don't keep a raw_data pointer to consumed ring buffer space
  perf python: Check if there is space to copy all the event

 tools/perf/python/tracepoint.py |  8 ++++++++
 tools/perf/util/python.c        | 24 ++++++++++++------------
 2 files changed, 20 insertions(+), 12 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-19 20:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12 20:31 [PATCH v2 0/6] perf python binding fixes Arnaldo Carvalho de Melo
2025-03-12 20:31 ` [PATCH 1/6] perf python: Fixup description of sample.id event member Arnaldo Carvalho de Melo
2025-03-12 20:31 ` [PATCH 2/6] perf python: Remove some unused macros (_PyUnicode_FromString(arg), etc) Arnaldo Carvalho de Melo
2025-03-12 20:31 ` [PATCH 3/6] perf python tracepoint.py: Change the COMM using setproctitle if available Arnaldo Carvalho de Melo
2025-03-12 20:31 ` [PATCH 4/6] perf python: Decrement the refcount of just created event on failure Arnaldo Carvalho de Melo
2025-03-12 20:31 ` [PATCH 5/6] perf python: Don't keep a raw_data pointer to consumed ring buffer space Arnaldo Carvalho de Melo
2025-03-12 20:31 ` [PATCH 6/6] perf python: Check if there is space to copy all the event Arnaldo Carvalho de Melo
2025-03-17 17:41 ` [PATCH v2 0/6] perf python binding fixes Ian Rogers
2025-03-17 20:45   ` Arnaldo Carvalho de Melo
2025-03-19 20:13 ` Namhyung Kim

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).