perf record: Ensure space for lost samples
authorIan Rogers <irogers@google.com>
Tue, 11 Jun 2024 05:06:26 +0000 (22:06 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 14 Jun 2024 03:45:31 +0000 (20:45 -0700)
commit6c1785cd75ef55a308701813330a162002ffe192
treeb3c831a422bc3645aacbfce00a6a7b2fc4b60743
parent6828d6929b763499b7a8768c623891f5d4fca258
perf record: Ensure space for lost samples

Previous allocation didn't account for sample ID written after the
lost samples event. Switch from malloc/free to a stack allocation.

Reported-by: Milian Wolff <milian.wolff@kdab.com>
Closes: https://lore.kernel.org/linux-perf-users/23879991.0LEYPuXRzz@milian-workstation/
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240611050626.1223155-1-irogers@google.com
tools/lib/perf/include/perf/event.h
tools/perf/builtin-record.c