summaryrefslogtreecommitdiff
path: root/tools/perf/util/header.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-05-20 16:24:00 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-05-23 10:11:01 -0300
commit237c96b8c1584d4c28d3593e5f52508fbec9ff06 (patch)
tree5c5a638c9f1cd7d565e8be5828d192ce393a5071 /tools/perf/util/header.h
parent1634b5a1f11cf407255d42fcc1d6bf257d16adab (diff)
downloadlwn-237c96b8c1584d4c28d3593e5f52508fbec9ff06.tar.gz
lwn-237c96b8c1584d4c28d3593e5f52508fbec9ff06.zip
perf header: Add ability to keep feature sections
Many feature sections should not be re-written during perf inject. In preparation to support that, add callbacks that a tool can use to copy a feature section from elsewhere. perf inject will use this facility to copy features sections from the input file. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20220520132404.25853-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.h')
-rw-r--r--tools/perf/util/header.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 0eb4bc29a5a4..e76ab02d5541 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -121,6 +121,16 @@ int perf_session__write_header(struct perf_session *session,
int fd, bool at_exit);
int perf_header__write_pipe(int fd);
+/* feat_writer writes a feature section to output */
+struct feat_writer {
+ int (*write)(struct feat_writer *fw, void *buf, size_t sz);
+};
+
+/* feat_copier copies a feature section using feat_writer to output */
+struct feat_copier {
+ int (*copy)(struct feat_copier *fc, int feat, struct feat_writer *fw);
+};
+
void perf_header__set_feat(struct perf_header *header, int feat);
void perf_header__clear_feat(struct perf_header *header, int feat);
bool perf_header__has_feat(const struct perf_header *header, int feat);