diff options
author | 2024-08-29 08:01:51 -0700 | |
---|---|---|
committer | 2024-08-29 16:17:43 -0300 | |
commit | e9a7053da377e19ebc6f1afe55c7f75219aaef79 (patch) | |
tree | 02eb771941d1c04e9991f83d9e7307de9391b303 /tools/perf/util/bpf_lock_contention.c | |
parent | perf header: Fail read if header sections overlap (diff) | |
download | wireguard-linux-e9a7053da377e19ebc6f1afe55c7f75219aaef79.tar.xz wireguard-linux-e9a7053da377e19ebc6f1afe55c7f75219aaef79.zip |
perf header: Allow attributes to be written after data
With a file, to write data an offset needs to be known. Typically data
follows the event attributes in a file.
However, if processing a pipe the number of event attributes may not be
known.
It is convenient in that case to write the attributes after the data.
Expand perf_session__do_write_header() to allow this when the data
offset and size are known.
This approach may be useful for more than just taking a pipe file to
write into a data file, `perf inject --itrace` will reserve and
additional 8kb for attributes, which would be unnecessary if the
attributes were written after the data.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yanteng Si <siyanteng@loongson.cn>
Cc: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20240829150154.37929-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/bpf_lock_contention.c')
0 files changed, 0 insertions, 0 deletions