Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf python tracepoint.py: Change the COMM using setproctitle if available

Otherwise when debugging we see just "python" in perf, top, etc.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250312203141.285263-4-acme@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Arnaldo Carvalho de Melo and committed by
Namhyung Kim
a570da21 1882625c

+8
+8
tools/perf/python/tracepoint.py
··· 5 5 6 6 import perf 7 7 8 + def change_proctitle(): 9 + try: 10 + import setproctitle 11 + setproctitle.setproctitle("tracepoint.py") 12 + except: 13 + print("Install the setproctitle python package to help with top and friends") 14 + 8 15 def main(): 16 + change_proctitle() 9 17 cpus = perf.cpu_map() 10 18 threads = perf.thread_map(-1) 11 19 evlist = perf.parse_events("sched:sched_switch", cpus, threads)