diff --git a/tools/perf/builtin-periodic.c b/tools/perf/builtin-periodic.c index 70a0e2beb3e..060e9099c3b 100644 --- a/tools/perf/builtin-periodic.c +++ b/tools/perf/builtin-periodic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Code Aurora Forum. All rights reserved. + * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -194,6 +194,8 @@ static int create_perf_counter(struct perf_setup_s *p) if (p == NULL) return PERF_PERIODIC_ERROR; for (cpu = 0; cpu < cpus->nr; cpu++) { + if (((1 << cpu) & cpumask) == 0) + continue; p->perf_fd[cpu] = sys_perf_event_open(p->attr, target_pid, cpu, -1, 0); if (p->perf_fd[cpu] < 0)