Commit 85c894a
perf header: Write bpf_prog (infos|btfs)_cnt to data file
With commit f0d0f97 ("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: f0d0f97 ("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>1 parent 9b9e437 commit 85c894a
1 file changed
+2
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | 1025 | | |
1029 | 1026 | | |
1030 | | - | |
| 1027 | + | |
1031 | 1028 | | |
1032 | 1029 | | |
1033 | 1030 | | |
| |||
1067 | 1064 | | |
1068 | 1065 | | |
1069 | 1066 | | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | 1067 | | |
1074 | 1068 | | |
1075 | 1069 | | |
1076 | | - | |
| 1070 | + | |
1077 | 1071 | | |
1078 | 1072 | | |
1079 | 1073 | | |
| |||
0 commit comments