aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 77832b807eff..471b0c42db3f 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2240,7 +2240,7 @@ out_delete_evlist:
2240} 2240}
2241 2241
2242int perf_event__synthesize_attr(struct perf_tool *tool, 2242int perf_event__synthesize_attr(struct perf_tool *tool,
2243 struct perf_event_attr *attr, u16 ids, u64 *id, 2243 struct perf_event_attr *attr, u32 ids, u64 *id,
2244 perf_event__handler_t process) 2244 perf_event__handler_t process)
2245{ 2245{
2246 union perf_event *ev; 2246 union perf_event *ev;
@@ -2261,9 +2261,12 @@ int perf_event__synthesize_attr(struct perf_tool *tool,
2261 memcpy(ev->attr.id, id, ids * sizeof(u64)); 2261 memcpy(ev->attr.id, id, ids * sizeof(u64));
2262 2262
2263 ev->attr.header.type = PERF_RECORD_HEADER_ATTR; 2263 ev->attr.header.type = PERF_RECORD_HEADER_ATTR;
2264 ev->attr.header.size = size; 2264 ev->attr.header.size = (u16)size;
2265 2265
2266 err = process(tool, ev, NULL, NULL); 2266 if (ev->attr.header.size == size)
2267 err = process(tool, ev, NULL, NULL);
2268 else
2269 err = -E2BIG;
2267 2270
2268 free(ev); 2271 free(ev);
2269 2272
@@ -2292,7 +2295,7 @@ int perf_event__synthesize_attrs(struct perf_tool *tool,
2292int perf_event__process_attr(union perf_event *event, 2295int perf_event__process_attr(union perf_event *event,
2293 struct perf_evlist **pevlist) 2296 struct perf_evlist **pevlist)
2294{ 2297{
2295 unsigned int i, ids, n_ids; 2298 u32 i, ids, n_ids;
2296 struct perf_evsel *evsel; 2299 struct perf_evsel *evsel;
2297 struct perf_evlist *evlist = *pevlist; 2300 struct perf_evlist *evlist = *pevlist;
2298 2301