aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/perf_counter/kerneltop.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Documentation/perf_counter/kerneltop.c b/Documentation/perf_counter/kerneltop.c
index ea13e4e67229..7ebde7a336c6 100644
--- a/Documentation/perf_counter/kerneltop.c
+++ b/Documentation/perf_counter/kerneltop.c
@@ -1157,10 +1157,10 @@ static void mmap_read(struct mmap_data *md)
1157 1157
1158int main(int argc, char *argv[]) 1158int main(int argc, char *argv[])
1159{ 1159{
1160 struct pollfd event_array[MAX_NR_CPUS][MAX_COUNTERS]; 1160 struct pollfd event_array[MAX_NR_CPUS * MAX_COUNTERS];
1161 struct mmap_data mmap_array[MAX_NR_CPUS][MAX_COUNTERS]; 1161 struct mmap_data mmap_array[MAX_NR_CPUS][MAX_COUNTERS];
1162 struct perf_counter_hw_event hw_event; 1162 struct perf_counter_hw_event hw_event;
1163 int i, counter, group_fd; 1163 int i, counter, group_fd, nr_poll = 0;
1164 unsigned int cpu; 1164 unsigned int cpu;
1165 int ret; 1165 int ret;
1166 1166
@@ -1214,8 +1214,9 @@ int main(int argc, char *argv[])
1214 if (group && group_fd == -1) 1214 if (group && group_fd == -1)
1215 group_fd = fd[i][counter]; 1215 group_fd = fd[i][counter];
1216 1216
1217 event_array[i][counter].fd = fd[i][counter]; 1217 event_array[nr_poll].fd = fd[i][counter];
1218 event_array[i][counter].events = POLLIN; 1218 event_array[nr_poll].events = POLLIN;
1219 nr_poll++;
1219 1220
1220 mmap_array[i][counter].counter = counter; 1221 mmap_array[i][counter].counter = counter;
1221 mmap_array[i][counter].prev = 0; 1222 mmap_array[i][counter].prev = 0;
@@ -1247,7 +1248,7 @@ int main(int argc, char *argv[])
1247 } 1248 }
1248 1249
1249 if (hits == events) 1250 if (hits == events)
1250 ret = poll(event_array[0], nr_cpus, 1000); 1251 ret = poll(event_array, nr_poll, 1000);
1251 hits = events; 1252 hits = events;
1252 } 1253 }
1253 1254