diff options
| author | Ian Rogers <irogers@google.com> | 2026-08-09 00:14:54 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-08-09 22:02:42 -0700 |
| commit | 16a12a54e9a1151a37aab74914a51b86f7f58d0e (patch) | |
| tree | 4ca6d096fd0da5843eaafa244a07bc36a494ec94 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 1ec13016ba36f1bf7dc61e054068fe00f2f628c7 (diff) | |
perf synthetic-events: Fix divide by zero in perf_event__synthesize_threads
If scandir() finds no matching tasks in /proc, n is 0. If thread_nr is > 1,
we bypass the single-thread fast path and then clamp thread_nr to n, making
it 0. This results in a divide by zero when calculating num_per_thread.
Handle n <= 1 early to use the single-thread fast path and prevent the
crash.
Fixes: 340b47f510bb ("perf top: Implement multithreading for perf_event__synthesize_threads")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
