• Home
  • Raw
  • Download

Lines Matching +full:cpu +full:- +full:nr

1 // SPDX-License-Identifier: GPL-2.0
25 int err = -1, fd, cpu; in test__openat_syscall_event_on_all_cpus() local
30 struct perf_thread_map *threads = thread_map__new(-1, getpid(), UINT_MAX); in test__openat_syscall_event_on_all_cpus()
36 return -1; in test__openat_syscall_event_on_all_cpus()
61 for (cpu = 0; cpu < cpus->nr; ++cpu) { in test__openat_syscall_event_on_all_cpus()
62 unsigned int ncalls = nr_openat_calls + cpu; in test__openat_syscall_event_on_all_cpus()
67 * a reasonable upper limit tho :-) in test__openat_syscall_event_on_all_cpus()
69 if (cpus->map[cpu] >= CPU_SETSIZE) { in test__openat_syscall_event_on_all_cpus()
70 pr_debug("Ignoring CPU %d\n", cpus->map[cpu]); in test__openat_syscall_event_on_all_cpus()
74 CPU_SET(cpus->map[cpu], &cpu_set); in test__openat_syscall_event_on_all_cpus()
76 pr_debug("sched_setaffinity() failed on CPU %d: %s ", in test__openat_syscall_event_on_all_cpus()
77 cpus->map[cpu], in test__openat_syscall_event_on_all_cpus()
85 CPU_CLR(cpus->map[cpu], &cpu_set); in test__openat_syscall_event_on_all_cpus()
90 * we use the auto allocation it will allocate just for 1 cpu, in test__openat_syscall_event_on_all_cpus()
91 * as we start by cpu 0. in test__openat_syscall_event_on_all_cpus()
93 if (evsel__alloc_counts(evsel, cpus->nr, 1) < 0) { in test__openat_syscall_event_on_all_cpus()
94 pr_debug("evsel__alloc_counts(ncpus=%d)\n", cpus->nr); in test__openat_syscall_event_on_all_cpus()
100 for (cpu = 0; cpu < cpus->nr; ++cpu) { in test__openat_syscall_event_on_all_cpus()
103 if (cpus->map[cpu] >= CPU_SETSIZE) in test__openat_syscall_event_on_all_cpus()
106 if (evsel__read_on_cpu(evsel, cpu, 0) < 0) { in test__openat_syscall_event_on_all_cpus()
108 err = -1; in test__openat_syscall_event_on_all_cpus()
112 expected = nr_openat_calls + cpu; in test__openat_syscall_event_on_all_cpus()
113 if (perf_counts(evsel->counts, cpu, 0)->val != expected) { in test__openat_syscall_event_on_all_cpus()
114 pr_debug("evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n", in test__openat_syscall_event_on_all_cpus()
115 expected, cpus->map[cpu], perf_counts(evsel->counts, cpu, 0)->val); in test__openat_syscall_event_on_all_cpus()
116 err = -1; in test__openat_syscall_event_on_all_cpus()
122 perf_evsel__close_fd(&evsel->core); in test__openat_syscall_event_on_all_cpus()