linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Introduce a C extension module to allow libperf usage from python
@ 2025-03-13  7:51 Gautam Menghani
  2025-03-13  7:51 ` [RFC PATCH 1/3] libperf: Introduce wrappers for perf structs to be exposed to python Gautam Menghani
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Gautam Menghani @ 2025-03-13  7:51 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang
  Cc: Gautam Menghani, linux-perf-users, linux-kernel

In this RFC series, we are introducing a C extension module to allow
python programs to call the libperf API functions. Currently libperf can
be used by C programs, but expanding the support to python is beneficial
for python users.

The structure of the patch series is as follows:
1. Patch 1 : Create wrappers for the perf structs which are used by
examples/counting.c

2. Patch 2: Create the C extension module that maps and exposes the
libperf functions to python programs

2. Patch 3: A python variant of counting.c - counting.py to demonstrate
the usage of libperf from python

We have not added support for entire libperf, as we want to get
community feedback on the approach taken in this series.

Gautam Menghani (3):
  libperf: Introduce wrappers for perf structs to be exposed to python
  libperf: Introduce a C extension module for python
  libperf: Add counting.py example to demonstrate libperf usage from
    python

 tools/lib/perf/Build                          |   1 +
 .../perf/Documentation/examples/counting.py   |  74 +++
 tools/lib/perf/Makefile                       |  12 +-
 tools/lib/perf/include/perf/py_perf.h         | 431 ++++++++++++++++++
 tools/lib/perf/libperf.map                    |   1 +
 tools/lib/perf/py_perf.c                      | 262 +++++++++++
 6 files changed, 779 insertions(+), 2 deletions(-)
 create mode 100755 tools/lib/perf/Documentation/examples/counting.py
 create mode 100644 tools/lib/perf/include/perf/py_perf.h
 create mode 100644 tools/lib/perf/py_perf.c

-- 
2.47.0


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

end of thread, other threads:[~2025-03-14  8:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13  7:51 [RFC PATCH 0/3] Introduce a C extension module to allow libperf usage from python Gautam Menghani
2025-03-13  7:51 ` [RFC PATCH 1/3] libperf: Introduce wrappers for perf structs to be exposed to python Gautam Menghani
2025-03-13  7:51 ` [RFC PATCH 2/3] libperf: Introduce a C extension module for python Gautam Menghani
2025-03-13  7:51 ` [RFC PATCH 3/3] libperf: Add counting.py example to demonstrate libperf usage from python Gautam Menghani
2025-03-13 14:12 ` [RFC PATCH 0/3] Introduce a C extension module to allow " John B. Wyatt IV
2025-03-13 16:01   ` Ian Rogers
2025-03-14  8:20     ` Gautam Menghani

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