Skip to content

Commit

Permalink
perf cpu_map: Align cpu map synthesized events properly.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
davem330 authored and acmel committed Oct 16, 2018
1 parent c458a62 commit 0ed149c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max
}

*size += sizeof(struct cpu_map_data);
*size = PERF_ALIGN(*size, sizeof(u64));
return zalloc(*size);
}

Expand Down

0 comments on commit 0ed149c

Please sign in to comment.