aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-09-20 12:14:00 -0400
committerIngo Molnar <mingo@kernel.org>2019-09-20 12:16:42 -0400
commit351a1f5c8afa13ea5cfcdae543f6596ef8ebdbd9 (patch)
tree6d039ac0d47666bd6de701911a283c51bea7105e /tools/perf/util/header.h
parent7f2444d38f6bbfa12bc15e2533d8f9daa85ca02b (diff)
parent2bff2b828502b5e5d5ea5a52643d3542053df03f (diff)
Merge tag 'perf-core-for-mingo-5.4-20190920-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: perf stat: Srikar Dronamraju: - Fix a segmentation fault when using repeat forever. - Reset previous counts on repeat with interval. aarch64: James Clark: - Add PMU event JSON files for Cortex-A76 and Neoverse N1. PowerPC: Anju T Sudhakar: - Make 'trace_cycles' the default event for 'perf kvm record' in PowerPC. S/390: - Link libjvmti to tools/lib/string.o to have a weak strlcpy() implementation, providing previously unresolved symbol on s/390. perf test: Jiri Olsa: - Add libperf automated tests to 'make -C tools/perf build-test'. Colin Ian King: - Fix spelling mistake. Tree wide: Arnaldo Carvalho de Melo: - Some more header file sanitization. libperf: Jiri Olsa: - Add dependency on libperf for python.so binding. libtraceevent: Sakari Ailus: - Convert remaining %p[fF] users to %p[sS]. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/header.h')
-rw-r--r--tools/perf/util/header.h60
1 files changed, 21 insertions, 39 deletions
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 3e48ae3c49b1..ca53a929e9fd 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -5,10 +5,10 @@
5#include <linux/stddef.h> 5#include <linux/stddef.h>
6#include <linux/perf_event.h> 6#include <linux/perf_event.h>
7#include <sys/types.h> 7#include <sys/types.h>
8#include <stdio.h> // FILE
8#include <stdbool.h> 9#include <stdbool.h>
9#include <linux/bitmap.h> 10#include <linux/bitmap.h>
10#include <linux/types.h> 11#include <linux/types.h>
11#include "event.h"
12#include "env.h" 12#include "env.h"
13#include "pmu.h" 13#include "pmu.h"
14 14
@@ -92,8 +92,28 @@ struct perf_header {
92 struct perf_env env; 92 struct perf_env env;
93}; 93};
94 94
95struct feat_fd {
96 struct perf_header *ph;
97 int fd;
98 void *buf; /* Either buf != NULL or fd >= 0 */
99 ssize_t offset;
100 size_t size;
101 struct evsel *events;
102};
103
104struct perf_header_feature_ops {
105 int (*write)(struct feat_fd *ff, struct evlist *evlist);
106 void (*print)(struct feat_fd *ff, FILE *fp);
107 int (*process)(struct feat_fd *ff, void *data);
108 const char *name;
109 bool full_only;
110 bool synthesize;
111};
112
95struct evlist; 113struct evlist;
96struct perf_session; 114struct perf_session;
115struct perf_tool;
116union perf_event;
97 117
98int perf_session__read_header(struct perf_session *session); 118int perf_session__read_header(struct perf_session *session);
99int perf_session__write_header(struct perf_session *session, 119int perf_session__write_header(struct perf_session *session,
@@ -115,54 +135,16 @@ int perf_header__process_sections(struct perf_header *header, int fd,
115 135
116int perf_header__fprintf_info(struct perf_session *s, FILE *fp, bool full); 136int perf_header__fprintf_info(struct perf_session *s, FILE *fp, bool full);
117 137
118int perf_event__synthesize_features(struct perf_tool *tool,
119 struct perf_session *session,
120 struct evlist *evlist,
121 perf_event__handler_t process);
122
123int perf_event__synthesize_extra_attr(struct perf_tool *tool,
124 struct evlist *evsel_list,
125 perf_event__handler_t process,
126 bool is_pipe);
127
128int perf_event__process_feature(struct perf_session *session, 138int perf_event__process_feature(struct perf_session *session,
129 union perf_event *event); 139 union perf_event *event);
130
131int perf_event__synthesize_attr(struct perf_tool *tool,
132 struct perf_event_attr *attr, u32 ids, u64 *id,
133 perf_event__handler_t process);
134int perf_event__synthesize_attrs(struct perf_tool *tool,
135 struct evlist *evlist,
136 perf_event__handler_t process);
137int perf_event__synthesize_event_update_unit(struct perf_tool *tool,
138 struct evsel *evsel,
139 perf_event__handler_t process);
140int perf_event__synthesize_event_update_scale(struct perf_tool *tool,
141 struct evsel *evsel,
142 perf_event__handler_t process);
143int perf_event__synthesize_event_update_name(struct perf_tool *tool,
144 struct evsel *evsel,
145 perf_event__handler_t process);
146int perf_event__synthesize_event_update_cpus(struct perf_tool *tool,
147 struct evsel *evsel,
148 perf_event__handler_t process);
149int perf_event__process_attr(struct perf_tool *tool, union perf_event *event, 140int perf_event__process_attr(struct perf_tool *tool, union perf_event *event,
150 struct evlist **pevlist); 141 struct evlist **pevlist);
151int perf_event__process_event_update(struct perf_tool *tool, 142int perf_event__process_event_update(struct perf_tool *tool,
152 union perf_event *event, 143 union perf_event *event,
153 struct evlist **pevlist); 144 struct evlist **pevlist);
154size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp); 145size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp);
155
156int perf_event__synthesize_tracing_data(struct perf_tool *tool,
157 int fd, struct evlist *evlist,
158 perf_event__handler_t process);
159int perf_event__process_tracing_data(struct perf_session *session, 146int perf_event__process_tracing_data(struct perf_session *session,
160 union perf_event *event); 147 union perf_event *event);
161
162int perf_event__synthesize_build_id(struct perf_tool *tool,
163 struct dso *pos, u16 misc,
164 perf_event__handler_t process,
165 struct machine *machine);
166int perf_event__process_build_id(struct perf_session *session, 148int perf_event__process_build_id(struct perf_session *session,
167 union perf_event *event); 149 union perf_event *event);
168bool is_perf_magic(u64 magic); 150bool is_perf_magic(u64 magic);