summaryrefslogtreecommitdiff
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-07-18 16:36:11 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-07-18 16:36:11 +0300
commit0698461ad2984892a47582a58eb235488d3aac7f (patch)
tree107cfefee20b50f79cde3ed847f075bdbf50fad0 /tools/perf/util/header.c
parent0d2997f750d1de394231bc22768dab94a5b5db2f (diff)
parentff6992735ade75aae3e35d16b17da1008d753d28 (diff)
downloadlinux-0698461ad2984892a47582a58eb235488d3aac7f.tar.xz
Merge remote-tracking branch 'torvalds/master' into perf/core
To update the perf/core codebase. Fix conflict by moving arch__post_evsel_config(evsel, attr) to the end of evsel__config(), after what was added in: 49c692b7dfc9b6c0 ("perf offcpu: Accept allowed sample types only") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 511478429463..c30c29c51410 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3703,6 +3703,20 @@ int perf_session__write_header(struct perf_session *session,
return perf_session__do_write_header(session, evlist, fd, at_exit, NULL);
}
+size_t perf_session__data_offset(const struct evlist *evlist)
+{
+ struct evsel *evsel;
+ size_t data_offset;
+
+ data_offset = sizeof(struct perf_file_header);
+ evlist__for_each_entry(evlist, evsel) {
+ data_offset += evsel->core.ids * sizeof(u64);
+ }
+ data_offset += evlist->core.nr_entries * sizeof(struct perf_file_attr);
+
+ return data_offset;
+}
+
int perf_session__inject_header(struct perf_session *session,
struct evlist *evlist,
int fd,