aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r--tools/perf/builtin-test.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index ed5696198d3d..02958d6a807f 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -380,13 +380,18 @@ static int test__open_syscall_event_on_all_cpus(void)
380 for (cpu = 0; cpu < cpus->nr; ++cpu) { 380 for (cpu = 0; cpu < cpus->nr; ++cpu) {
381 unsigned int ncalls = nr_open_calls + cpu; 381 unsigned int ncalls = nr_open_calls + cpu;
382 382
383 CPU_SET(cpu, cpu_set); 383 CPU_SET_S(cpus->map[cpu], cpu_set_size, cpu_set);
384 sched_setaffinity(0, cpu_set_size, cpu_set); 384 if (sched_setaffinity(0, cpu_set_size, cpu_set) < 0) {
385 pr_debug("sched_setaffinity() failed on CPU %d: %s ",
386 cpus->map[cpu],
387 strerror(errno));
388 goto out_close_fd;
389 }
385 for (i = 0; i < ncalls; ++i) { 390 for (i = 0; i < ncalls; ++i) {
386 fd = open("/etc/passwd", O_RDONLY); 391 fd = open("/etc/passwd", O_RDONLY);
387 close(fd); 392 close(fd);
388 } 393 }
389 CPU_CLR(cpu, cpu_set); 394 CPU_CLR_S(cpus->map[cpu], cpu_set_size, cpu_set);
390 } 395 }
391 396
392 /* 397 /*
@@ -410,7 +415,7 @@ static int test__open_syscall_event_on_all_cpus(void)
410 expected = nr_open_calls + cpu; 415 expected = nr_open_calls + cpu;
411 if (evsel->counts->cpu[cpu].val != expected) { 416 if (evsel->counts->cpu[cpu].val != expected) {
412 pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %Ld\n", 417 pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %Ld\n",
413 expected, cpu, evsel->counts->cpu[cpu].val); 418 expected, cpus->map[cpu], evsel->counts->cpu[cpu].val);
414 goto out_close_fd; 419 goto out_close_fd;
415 } 420 }
416 } 421 }