Skip to content

Commit 0ed149c

Browse files
davem330acmel
authored andcommitted
perf cpu_map: Align cpu map synthesized events properly.
The size of the resulting cpu map can be smaller than a multiple of sizeof(u64), resulting in SIGBUS on cpus like Sparc as the next event will not be aligned properly. Signed-off-by: David S. Miller <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Fixes: 6c87290 ("perf cpu_map: Add cpu_map event synthesize function") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent c458a62 commit 0ed149c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/perf/util/event.c

+1
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max
10811081
}
10821082

10831083
*size += sizeof(struct cpu_map_data);
1084+
*size = PERF_ALIGN(*size, sizeof(u64));
10841085
return zalloc(*size);
10851086
}
10861087

0 commit comments

Comments
 (0)