Files
linux/tools/perf/util
Thomas Falcon 26527bd486 perf header: Write bpf_prog (infos|btfs)_cnt to data file
[ Upstream commit 85c894a80a ]

With commit f0d0f978f3 ("perf header: Don't write empty BPF/BTF
info"), the write_bpf_( prog_info() | btf() ) functions exit without
writing anything if env->bpf_prog.(infos| btfs)_cnt is zero.

process_bpf_( prog_info() | btf() ), however, still expect a "count"
value to exist in the data file. If btf information is empty, for
example, process_bpf_btf will read garbage or some other data as the
number of btf nodes in the data file. As a result, the data file will
not be processed correctly.

Instead, write the count to the data file and exit if it is zero.

Fixes: f0d0f978f3 ("perf header: Don't write empty BPF/BTF info")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-11-24 10:37:37 +01:00
..
2025-06-09 11:18:17 -07:00
2025-06-09 11:18:17 -07:00
2023-03-14 08:29:46 -03:00
2021-04-29 10:30:58 -03:00
2021-08-11 09:35:44 -03:00
2025-07-25 10:37:56 -07:00
2025-07-25 10:37:56 -07:00
2024-08-19 14:52:13 -03:00
2025-07-25 10:37:58 -07:00
2025-07-25 10:37:58 -07:00
2023-01-23 10:00:47 -03:00
2025-07-02 19:01:54 -07:00
2024-08-12 18:05:14 -03:00
2024-08-19 14:51:46 -03:00
2025-07-25 10:37:56 -07:00
2025-07-25 10:37:56 -07:00
2024-02-12 12:35:41 -08:00
2025-05-02 15:36:14 -03:00
2025-02-10 11:46:02 -08:00
2025-07-26 16:31:43 -07:00
2023-04-06 21:40:28 -03:00
2023-09-12 17:47:00 -03:00
2025-03-10 11:31:24 -07:00
2025-03-10 11:31:24 -07:00
2025-07-11 12:36:40 -07:00
2025-07-11 12:36:40 -07:00
2024-12-12 15:53:36 -03:00
2025-06-09 11:18:18 -07:00
2025-06-09 11:18:18 -07:00
2025-07-26 16:31:43 -07:00
2025-07-26 16:31:43 -07:00
2023-04-10 19:20:53 -03:00
2024-09-27 15:38:52 -03:00