Home
last modified time | relevance | path

Searched refs:nr_cpus (Results 1 – 25 of 27) sorted by relevance

12

/tools/lib/perf/
Dcpumap.c51 int nr_cpus; in cpu_map__default_new() local
53 nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); in cpu_map__default_new()
54 if (nr_cpus < 0) in cpu_map__default_new()
57 cpus = malloc(sizeof(*cpus) + nr_cpus * sizeof(int)); in cpu_map__default_new()
61 for (i = 0; i < nr_cpus; ++i) in cpu_map__default_new()
64 cpus->nr = nr_cpus; in cpu_map__default_new()
76 static struct perf_cpu_map *cpu_map__trim_new(int nr_cpus, int *tmp_cpus) in cpu_map__trim_new() argument
78 size_t payload_size = nr_cpus * sizeof(int); in cpu_map__trim_new()
84 qsort(cpus->map, nr_cpus, sizeof(int), cmp_int); in cpu_map__trim_new()
87 for (i = 0; i < nr_cpus; i++) { in cpu_map__trim_new()
[all …]
Devlist.c291 int nr_cpus = perf_cpu_map__nr(evlist->cpus); in perf_evlist__alloc_pollfd() local
298 nfds += nr_cpus; in perf_evlist__alloc_pollfd()
300 nfds += nr_cpus * nr_threads; in perf_evlist__alloc_pollfd()
533 int nr_cpus = perf_cpu_map__nr(evlist->cpus); in mmap_per_cpu() local
536 for (cpu = 0; cpu < nr_cpus; cpu++) { in mmap_per_cpu()
/tools/testing/selftests/bpf/prog_tests/
Dmap_init.c10 static int nr_cpus; variable
22 pcpu_map_value_t value[nr_cpus]; in map_populate()
26 for (i = 0; i < nr_cpus; i++) in map_populate()
105 for (i = 0; i < nr_cpus; i++) { in check_values_one_cpu()
131 pcpu_map_value_t value[nr_cpus]; in test_pcpu_map_init()
171 pcpu_map_value_t value[nr_cpus]; in test_pcpu_lru_map_init()
203 nr_cpus = bpf_num_possible_cpus(); in test_map_init()
204 if (nr_cpus <= 1) { in test_map_init()
Dperf_buffer.c48 int err, on_len, nr_on_cpus = 0, nr_cpus, i; in test_perf_buffer() local
56 nr_cpus = libbpf_num_possible_cpus(); in test_perf_buffer()
57 if (CHECK(nr_cpus < 0, "nr_cpus", "err %d\n", nr_cpus)) in test_perf_buffer()
91 for (i = 0; i < nr_cpus; i++) { in test_perf_buffer()
114 for (i = 0; i < nr_cpus; i++) { in test_perf_buffer()
Dxdp_noinline.c8 unsigned int nr_cpus = bpf_num_possible_cpus(); in test_xdp_noinline() local
19 } stats[nr_cpus]; in test_xdp_noinline()
59 for (i = 0; i < nr_cpus; i++) { in test_xdp_noinline()
Dl4lb_all.c7 unsigned int nr_cpus = bpf_num_possible_cpus(); in test_l4lb() local
17 } stats[nr_cpus]; in test_l4lb()
70 for (i = 0; i < nr_cpus; i++) { in test_l4lb()
/tools/testing/selftests/bpf/
Dtest_lru_map.c27 static int nr_cpus; variable
107 unsigned long long value0[nr_cpus], value1[nr_cpus]; in map_subset()
138 while (next < nr_cpus) { in sched_next_online()
161 unsigned long long key, value[nr_cpus]; in test_lru_sanity0()
171 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity0()
250 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity1()
326 unsigned long long key, value[nr_cpus]; in test_lru_sanity2()
434 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity3()
499 unsigned long long key, value[nr_cpus]; in test_lru_sanity4()
510 3 * tgt_free * nr_cpus); in test_lru_sanity4()
[all …]
Dtest_progs.c110 for (i = 0; i < env.nr_cpus; i++) in reset_affinity()
672 env.nr_cpus = libbpf_num_possible_cpus(); in main()
673 if (env.nr_cpus < 0) { in main()
675 env.nr_cpus); in main()
Dtest_maps.c149 unsigned int nr_cpus = bpf_num_possible_cpus(); in test_hashmap_percpu() local
162 for (i = 0; i < nr_cpus; i++) in test_hashmap_percpu()
224 for (i = 0; i < nr_cpus; i++) in test_hashmap_percpu()
402 unsigned int nr_cpus = bpf_num_possible_cpus(); in test_arraymap_percpu() local
413 for (i = 0; i < nr_cpus; i++) in test_arraymap_percpu()
432 bpf_percpu(values, nr_cpus - 1) == 0); in test_arraymap_percpu()
461 unsigned int nr_cpus = bpf_num_possible_cpus(); in test_arraymap_percpu_many_keys() local
477 for (i = 0; i < nr_cpus; i++) in test_arraymap_percpu_many_keys()
484 for (i = 0; i < nr_cpus; i++) in test_arraymap_percpu_many_keys()
489 for (i = 0; i < nr_cpus; i++) in test_arraymap_percpu_many_keys()
Dtest_progs.h77 int nr_cpus; member
/tools/perf/arch/arm/util/
Dauxtrace.c21 int ret, i, nr_cpus = sysconf(_SC_NPROCESSORS_CONF); in find_all_arm_spe_pmus() local
25 arm_spe_pmus = zalloc(sizeof(struct perf_pmu *) * nr_cpus); in find_all_arm_spe_pmus()
32 for (i = 0; i < nr_cpus; i++) { in find_all_arm_spe_pmus()
/tools/testing/selftests/rcutorture/bin/
Dfunctions.sh63 if test "$3" -gt "$nr_cpus"
65 echo $nr_cpus
/tools/perf/util/
Dsvghelper.c700 int *pos, int nr_cpus) in scan_thread_topology() argument
709 for_each_set_bit(thr, cpumask_bits(&t->sib_thr[i]), nr_cpus) in scan_thread_topology()
715 static void scan_core_topology(int *map, struct topology *t, int nr_cpus) in scan_core_topology() argument
722 for_each_set_bit(cpu, cpumask_bits(&t->sib_core[i]), nr_cpus) in scan_core_topology()
723 scan_thread_topology(map, t, cpu, &pos, nr_cpus); in scan_core_topology()
726 static int str_to_bitmap(char *s, cpumask_t *b, int nr_cpus) in str_to_bitmap() argument
739 if (c >= nr_cpus) { in str_to_bitmap()
754 int i, nr_cpus; in svg_build_topology_map() local
758 nr_cpus = min(env->nr_cpus_online, MAX_NR_CPUS); in svg_build_topology_map()
774 if (str_to_bitmap(sib_core, &t.sib_core[i], nr_cpus)) { in svg_build_topology_map()
[all …]
Denv.c257 int cpu, nr_cpus; in perf_env__read_cpu_topology_map() local
265 nr_cpus = env->nr_cpus_avail; in perf_env__read_cpu_topology_map()
266 if (nr_cpus == -1) in perf_env__read_cpu_topology_map()
269 env->cpu = calloc(nr_cpus, sizeof(env->cpu[0])); in perf_env__read_cpu_topology_map()
273 for (cpu = 0; cpu < nr_cpus; ++cpu) { in perf_env__read_cpu_topology_map()
279 env->nr_cpus_avail = nr_cpus; in perf_env__read_cpu_topology_map()
Dmmap.c243 int c, cpu, nr_cpus; in build_node_mask() local
250 nr_cpus = perf_cpu_map__nr(cpu_map); in build_node_mask()
251 for (c = 0; c < nr_cpus; c++) { in build_node_mask()
Devsel.c1580 int nr_cpus, int nr_threads, in perf_evsel__remove_fd() argument
1583 for (int cpu = 0; cpu < nr_cpus; cpu++) in perf_evsel__remove_fd()
1589 int nr_cpus, int cpu_idx, in update_fds() argument
1594 if (cpu_idx >= nr_cpus || thread_idx >= nr_threads) in update_fds()
1598 nr_cpus = pos != evsel ? nr_cpus : cpu_idx; in update_fds()
1600 perf_evsel__remove_fd(pos, nr_cpus, nr_threads, thread_idx); in update_fds()
1613 int nr_cpus, int cpu, in ignore_missing_thread() argument
1638 if (update_fds(evsel, nr_cpus, cpu, threads->nr, thread)) in ignore_missing_thread()
Dmachine.c2979 int nr_cpus = min(machine->env->nr_cpus_avail, MAX_NR_CPUS); in machine__get_current_tid() local
2981 if (cpu < 0 || cpu >= nr_cpus || !machine->current_tid) in machine__get_current_tid()
2991 int nr_cpus = min(machine->env->nr_cpus_avail, MAX_NR_CPUS); in machine__set_current_tid() local
2999 machine->current_tid = calloc(nr_cpus, sizeof(pid_t)); in machine__set_current_tid()
3002 for (i = 0; i < nr_cpus; i++) in machine__set_current_tid()
3006 if (cpu >= nr_cpus) { in machine__set_current_tid()
Devlist.c477 int nr_cpus = perf_cpu_map__nr(evlist->core.cpus); in perf_evlist__enable_event_thread() local
482 for (cpu = 0; cpu < nr_cpus; cpu++) { in perf_evlist__enable_event_thread()
/tools/virtio/virtio-trace/
Dtrace-agent.c31 int nr_cpus = (int)sysconf(_SC_NPROCESSORS_CONF); in get_total_cpus() local
33 if (nr_cpus <= 0) { in get_total_cpus()
36 } else if (nr_cpus > MAX_CPUS) { in get_total_cpus()
41 return nr_cpus; in get_total_cpus()
/tools/testing/selftests/rcutorture/configs/rcu/
DTREE01.boot1 maxcpus=8 nr_cpus=43
/tools/testing/selftests/vm/
Duserfaultfd.c64 static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; variable
382 for (i = 0; i < nr_cpus * 2; ++i) { in uffd_test_ctx_clear()
457 pipefd = malloc(sizeof(int) * nr_cpus * 2); in uffd_test_ctx_init_ext()
460 for (cpu = 0; cpu < nr_cpus; cpu++) in uffd_test_ctx_init_ext()
802 pthread_t locking_threads[nr_cpus]; in stress()
803 pthread_t uffd_threads[nr_cpus]; in stress()
804 pthread_t background_threads[nr_cpus]; in stress()
807 for (cpu = 0; cpu < nr_cpus; cpu++) { in stress()
827 for (cpu = 0; cpu < nr_cpus; cpu++) in stress()
843 for (cpu = 0; cpu < nr_cpus; cpu++) in stress()
[all …]
Drun_vmtests26 nr_cpus=$(nproc)
28 half_ufd_size_MB=$((((nr_cpus * hpgsize_MB + 127) / 128) * 128))
/tools/perf/bench/
Dnuma.c125 int nr_cpus; member
282 for (cpu = 0; cpu < g->p.nr_cpus; cpu++) in bind_to_cpu()
285 BUG_ON(target_cpu < 0 || target_cpu >= g->p.nr_cpus); in bind_to_cpu()
307 for (cpu = 0; cpu < g->p.nr_cpus; cpu++) in bind_to_node()
554 BUG_ON(step <= 0 || step >= g->p.nr_cpus); in parse_setup_cpu_list()
566 BUG_ON(bind_len <= 0 || bind_len > g->p.nr_cpus); in parse_setup_cpu_list()
579 if (bind_cpu_0 >= g->p.nr_cpus || bind_cpu_1 >= g->p.nr_cpus) { in parse_setup_cpu_list()
580 printf("\nTest not applicable, system has only %d CPUs.\n", g->p.nr_cpus); in parse_setup_cpu_list()
609 BUG_ON(cpu < 0 || cpu >= g->p.nr_cpus); in parse_setup_cpu_list()
1240 if (this_cpu < g->p.nr_cpus/2) in worker_thread()
[all …]
/tools/power/cpupower/utils/
Dcpufreq-info.c58 unsigned int cpu, nr_cpus; in proc_cpufreq_output() local
66 nr_cpus = count_cpus(); in proc_cpufreq_output()
67 for (cpu = 0; cpu < nr_cpus; cpu++) { in proc_cpufreq_output()
/tools/perf/Documentation/
Dperf.data-file-format.txt112 struct nr_cpus {

12