summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-05-31 09:43:27 +0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-31 18:20:34 +0400
commit114067b69e7b2c691faace0e33db2f04096f668d (patch)
tree68e4e8e56fe448436a0efbdd03cd342768a32f0e /include
parent472606458f3e1ced5fe3cc5f04e90a6b5a4732cf (diff)
downloadlinux-114067b69e7b2c691faace0e33db2f04096f668d.tar.xz
perf tools: Check if callchain is corrupted
We faced segmentation fault on perf top -G at very high sampling rate due to a corrupted callchain. While the root cause was not revealed (I failed to figure it out), this patch tries to protect us from the segfault on such cases. Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sunjin Yang <fan4326@gmail.com> Link: http://lkml.kernel.org/r/1338443007-24857-2-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/perf_event.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index f32578634d9d..1817d4015e5f 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -555,6 +555,8 @@ enum perf_event_type {
PERF_RECORD_MAX, /* non-ABI */
};
+#define PERF_MAX_STACK_DEPTH 255
+
enum perf_callchain_context {
PERF_CONTEXT_HV = (__u64)-32,
PERF_CONTEXT_KERNEL = (__u64)-128,
@@ -609,8 +611,6 @@ struct perf_guest_info_callbacks {
#include <linux/sysfs.h>
#include <asm/local.h>
-#define PERF_MAX_STACK_DEPTH 255
-
struct perf_callchain_entry {
__u64 nr;
__u64 ip[PERF_MAX_STACK_DEPTH];