summaryrefslogtreecommitdiff
path: root/tools/perf/python/perf_live.py
AgeCommit message (Collapse)Author
2026-09-26perf python: Allow KeyboardInterrupt to propagate in LiveSessionIan Rogers
LiveSession.run() synchronously blocks while polling evlist for events. When running interactive tools or scripts from the terminal, KeyboardInterrupt exceptions raised via Ctrl-C must propagate so the caller can break out of the polling loop. Previously, LiveSession caught KeyboardInterrupt with an empty pass statement, swallowing the exception and preventing calling scripts from detecting the interrupt cleanly. Remove the empty handler so calling scripts receive KeyboardInterrupt and can perform clean teardown. Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-06-30perf python: Add LiveSession helperIan Rogers
Add LiveSession class in tools/perf/python/perf_live.py to support live event collection using perf.evlist and perf.parse_events, avoiding the need to fork a separate perf record process. Signed-off-by: Ian Rogers <irogers@google.com> Assisted-by: Gemini:gemini-3.1-pro-preview Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alice Rogers <alice.mei.rogers@gmail.com> Cc: Dapeng Mi <dapeng1.mi@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Leo Yan <leo.yan@linux.dev> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>