Skip to content

Commit

Permalink
perf top: Fix SIGBUS on sparc64
Browse files Browse the repository at this point in the history
perf-top is terminating due to SIGBUS on sparc64. git bisect points to:

    commit 8239698
    Author: Arnaldo Carvalho de Melo <acme@redhat.com>
    Date:   Mon Sep 8 13:26:35 2014 -0300

        perf evlist: Refcount mmaps

        We need to know how many fds are using a perf mmap via
        PERF_EVENT_IOC_SET_OUTPUT, so that we can know when to ditch an mmap,
        refcount it.

This commit added 'int refcnt' to struct perf_mmap and the addition makes the
event_copy element no longer 8-byte aligned.

Fix by adding __attribute__((aligned(8))) to the event_copy struct
member.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Link: http://lkml.kernel.org/r/1424304198-92028-1-git-send-email-david.ahern@oracle.com
[ Switched from 'int pad;' to using __attribute__, David tested/acked that ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed Feb 25, 2015
1 parent 48536c9 commit a73b6c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/evlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct perf_mmap {
int mask;
int refcnt;
unsigned int prev;
char event_copy[PERF_SAMPLE_MAX_SIZE];
char event_copy[PERF_SAMPLE_MAX_SIZE] __attribute__((aligned(8)));
};

struct perf_evlist {
Expand Down

0 comments on commit a73b6c1

Please sign in to comment.