perf: Fix sigbus with perf-top
PATCH 1/1 perf: Fix sigbus with perf-top
perf-top is terminating due to SIGBUS on sparc64. git bisect points to:
commit 82396986032915c1572bfb74b224fcc2e4e8ba7c
Author: Arnaldo Carvalho de Melo <[email protected]>
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 a pad.
--- tools/perf/util/evlist.h | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/evlist.h +1 -0
@@ -28,6 +28,7 @@ struct perf_mmap {int mask;int refcnt;unsigned int prev; +int pad;char event_copy[PERF_SAMPLE_MAX_SIZE ]; };
Signature · 1 line
1.9.3
Arnaldo Carvalho de Melo
maintainerEm Wed, Feb 18, 2015 at 07:03:18PM -0500, David Ahern escreveu:
Quoted 6 lines
perf-top is terminating due to SIGBUS on sparc64. git bisect points to:
commit
82396986032915c1572bfb74b224fcc2e4e8ba7c
Author: Arnaldo Carvalho de Melo <[email protected]>
Date: Mon Sep 8 13:26:35 2014 -0300
Quoted 8 lines
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_mmapand the addition makes theevent_copyelement no longer 8-byte aligned. Fix by adding a pad.
I am applying this, but please consider doing like the kernel and using one of those __aligned_on_foo struct member attributes.
I am adding a comment right after that pad...
- Arnaldo
Quoted 19 lines
Signed-off-by David Ahern <[email protected]>--- tools/perf/util/evlist.h | 1 + 1 file changed, 1 insertion(+)tools/perf/util/evlist.h +1
-0@@ -28,6 +28,7 @@ struct perf_mmap {int mask;int refcnt;unsigned int prev; +int pad;char event_copy[PERF_SAMPLE_MAX_SIZE ]; };Signature · 1 line
1.9.3
tip-bot for David Ahern
merge bot[tip:perf/urgent] perf top: Fix SIGBUS on sparc64
In reply to David Ahernperf top: Fix SIGBUS on sparc64
Commit-ID: a73b6c199a663d64a38198f547d5c5be42163193 Gitweb: http://git.kernel.org/tip/a73b6c199a663d64a38198f547d5c5be42163193 Author: David Ahern <[email protected]> AuthorDate: Wed, 18 Feb 2015 19:03:18 -0500 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 25 Feb 2015 17:37:44 -0300
perf top: Fix SIGBUS on sparc64
perf-top is terminating due to SIGBUS on sparc64. git bisect points to:
commit 82396986032915c1572bfb74b224fcc2e4e8ba7c
Author: Arnaldo Carvalho de Melo <[email protected]>
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.
--- tools/perf/util/evlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evlist.h +1 -1
@@ -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 {