aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f573bbb83572..b09d3b27ca14 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -22,6 +22,7 @@
22#include "util/debug.h" 22#include "util/debug.h"
23#include "util/session.h" 23#include "util/session.h"
24#include "util/symbol.h" 24#include "util/symbol.h"
25#include "util/cpumap.h"
25 26
26#include <unistd.h> 27#include <unistd.h>
27#include <sched.h> 28#include <sched.h>
@@ -421,9 +422,6 @@ static int __cmd_record(int argc, const char **argv)
421 char buf; 422 char buf;
422 423
423 page_size = sysconf(_SC_PAGE_SIZE); 424 page_size = sysconf(_SC_PAGE_SIZE);
424 nr_cpus = sysconf(_SC_NPROCESSORS_ONLN);
425 assert(nr_cpus <= MAX_NR_CPUS);
426 assert(nr_cpus >= 0);
427 425
428 atexit(sig_atexit); 426 atexit(sig_atexit);
429 signal(SIGCHLD, sig_handler); 427 signal(SIGCHLD, sig_handler);
@@ -547,8 +545,9 @@ static int __cmd_record(int argc, const char **argv)
547 if ((!system_wide && !inherit) || profile_cpu != -1) { 545 if ((!system_wide && !inherit) || profile_cpu != -1) {
548 open_counters(profile_cpu, target_pid); 546 open_counters(profile_cpu, target_pid);
549 } else { 547 } else {
548 nr_cpus = read_cpu_map();
550 for (i = 0; i < nr_cpus; i++) 549 for (i = 0; i < nr_cpus; i++)
551 open_counters(i, target_pid); 550 open_counters(cpumap[i], target_pid);
552 } 551 }
553 552
554 if (file_new) { 553 if (file_new) {