aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/perf_counter/builtin-top.c
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2009-05-24 02:35:49 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-24 02:57:08 -0400
commitc2990a2a582d73562d4dcf2502c39892a19a691d (patch)
tree840d7c137214e3dd1885e07b81f7bef35bbd1aa3 /Documentation/perf_counter/builtin-top.c
parent475c55797323b67435083f6e2eb8ee670f6410ec (diff)
perf top: fix segfault
c6eb13 increased stack usage such that perf-top now croaks on startup. Take event_array and mmap_array off the stack to prevent segfault on boxen with smallish ulimit -s setting. Signed-off-by: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: John Kacur <jkacur@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/perf_counter/builtin-top.c')
-rw-r--r--Documentation/perf_counter/builtin-top.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index a3216a6018c4..74021ac90f51 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -1035,10 +1035,11 @@ static void mmap_read(struct mmap_data *md)
1035 md->prev = old; 1035 md->prev = old;
1036} 1036}
1037 1037
1038static struct pollfd event_array[MAX_NR_CPUS * MAX_COUNTERS];
1039static struct mmap_data mmap_array[MAX_NR_CPUS][MAX_COUNTERS];
1040
1038int cmd_top(int argc, char **argv, const char *prefix) 1041int cmd_top(int argc, char **argv, const char *prefix)
1039{ 1042{
1040 struct pollfd event_array[MAX_NR_CPUS * MAX_COUNTERS];
1041 struct mmap_data mmap_array[MAX_NR_CPUS][MAX_COUNTERS];
1042 struct perf_counter_hw_event hw_event; 1043 struct perf_counter_hw_event hw_event;
1043 pthread_t thread; 1044 pthread_t thread;
1044 int i, counter, group_fd, nr_poll = 0; 1045 int i, counter, group_fd, nr_poll = 0;