/linux/tools/lib/perf/ |
H A D | cpumap.c | 18 void perf_cpu_map__set_nr(struct perf_cpu_map *map, int nr_cpus) 20 RC_CHK_ACCESS(map)->nr = nr_cpus; in perf_cpu_map__alloc() 23 struct perf_cpu_map *perf_cpu_map__alloc(int nr_cpus) in perf_cpu_map__alloc() 28 if (nr_cpus == 0) in perf_cpu_map__alloc() 31 cpus = malloc(sizeof(*cpus) + sizeof(struct perf_cpu) * nr_cpus); in perf_cpu_map__new_any_cpu() 33 cpus->nr = nr_cpus; in perf_cpu_map__new_any_cpu() 81 int nr_cpus, nr_cpus_conf; in cpu_map__new_sysconf() 83 nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); in cpu_map__new_sysconf() 84 if (nr_cpus < 0) in cpu_map__new_sysconf() 88 if (nr_cpus ! in cpu_map__new_sysconf() 14 perf_cpu_map__set_nr(struct perf_cpu_map * map,int nr_cpus) perf_cpu_map__set_nr() argument 19 perf_cpu_map__alloc(int nr_cpus) perf_cpu_map__alloc() argument 73 int nr_cpus, nr_cpus_conf; cpu_map__new_sysconf() local 132 cpu_map__trim_new(int nr_cpus,const struct perf_cpu * tmp_cpus) cpu_map__trim_new() argument 160 int nr_cpus = 0; perf_cpu_map__read() local 218 int i, nr_cpus = 0; perf_cpu_map__new() local [all...] |
/linux/tools/testing/selftests/kvm/aarch64/ |
H A D | vgic_lpi_stress.c |
|
/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | map_lookup_percpu_elem.c | 11 int ret, i, nr_cpus = libbpf_num_possible_cpus(); in test_map_lookup_percpu_elem() local 14 buf = malloc(nr_cpus*sizeof(__u64)); in test_map_lookup_percpu_elem() 18 for (i = 0; i < nr_cpus; i++) in test_map_lookup_percpu_elem() 20 sum = (nr_cpus - 1) * nr_cpus / 2; in test_map_lookup_percpu_elem() 27 skel->rodata->nr_cpus = nr_cpus; in test_map_lookup_percpu_elem()
|
H A D | map_init.c | 10 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()
|
H A D | lookup_and_delete.c | 11 static int nr_cpus; variable 29 __u64 key, value[nr_cpus]; in fill_values_percpu() 32 for (i = 0; i < nr_cpus; i++) in fill_values_percpu() 137 __u64 key, val, value[nr_cpus]; in test_lookup_and_delete_percpu_hash() 156 for (i = 0; i < nr_cpus; i++) { in test_lookup_and_delete_percpu_hash() 223 __u64 key, val, value[nr_cpus]; in test_lookup_and_delete_lru_percpu_hash() 242 for (i = 0; i < nr_cpus; i++) in test_lookup_and_delete_lru_percpu_hash() 252 for (i = 0; i < nr_cpus; i++) { in test_lookup_and_delete_lru_percpu_hash() 281 nr_cpus = bpf_num_possible_cpus(); in test_lookup_and_delete()
|
H A D | perf_buffer.c | 48 int err, on_len, nr_on_cpus = 0, nr_cpus, i, j; in serial_test_perf_buffer() local 56 nr_cpus = libbpf_num_possible_cpus(); in serial_test_perf_buffer() 57 if (CHECK(nr_cpus < 0, "nr_cpus", "err %d\n", nr_cpus)) in serial_test_perf_buffer() 94 for (i = 0; i < nr_cpus; i++) { in serial_test_perf_buffer() 117 for (i = 0, j = 0; i < nr_cpus; i++) { in serial_test_perf_buffer()
|
/linux/tools/tracing/rtla/src/ |
H A D | timerlat_u.c | 106 static int timerlat_u_send_kill(pid_t *procs, int nr_cpus) in timerlat_u_send_kill() argument 111 for (i = 0; i < nr_cpus; i++) { in timerlat_u_send_kill() 138 int nr_cpus = sysconf(_SC_NPROCESSORS_CONF); in timerlat_u_dispatcher() local 150 procs = calloc(nr_cpus, sizeof(pid_t)); in timerlat_u_dispatcher() 154 for (i = 0; i < nr_cpus; i++) { in timerlat_u_dispatcher() 177 timerlat_u_send_kill(procs, nr_cpus); in timerlat_u_dispatcher() 190 for (i = 0; i < nr_cpus; i++) { in timerlat_u_dispatcher() 204 timerlat_u_send_kill(procs, nr_cpus); in timerlat_u_dispatcher() 212 for (i = 0; i < nr_cpus; i++) { in timerlat_u_dispatcher()
|
H A D | osnoise_hist.c | 64 int nr_cpus; member 76 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in osnoise_free_histogram() 92 *osnoise_alloc_histogram(int nr_cpus, int entries, int bucket_size) in osnoise_alloc_histogram() argument 103 data->nr_cpus = nr_cpus; in osnoise_alloc_histogram() 105 data->hist = calloc(1, sizeof(*data->hist) * nr_cpus); in osnoise_alloc_histogram() 109 for (cpu = 0; cpu < nr_cpus; cpu++) { in osnoise_alloc_histogram() 116 for (cpu = 0; cpu < nr_cpus; cpu++) in osnoise_alloc_histogram() 276 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in osnoise_hist_header() 307 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in osnoise_print_summary() 321 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in osnoise_print_summary() [all …]
|
H A D | timerlat_hist.c | 87 int nr_cpus; member 99 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in timerlat_free_histogram() 122 *timerlat_alloc_histogram(int nr_cpus, int entries, int bucket_size) in timerlat_alloc_histogram() argument 133 data->nr_cpus = nr_cpus; in timerlat_alloc_histogram() 136 data->hist = calloc(1, sizeof(*data->hist) * nr_cpus); in timerlat_alloc_histogram() 141 for (cpu = 0; cpu < nr_cpus; cpu++) { in timerlat_alloc_histogram() 156 for (cpu = 0; cpu < nr_cpus; cpu++) { in timerlat_alloc_histogram() 261 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in timerlat_hist_header() 315 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in timerlat_print_summary() 339 for (cpu = 0; cpu < data->nr_cpus; cpu++) { in timerlat_print_summary() [all …]
|
H A D | timerlat_top.c | 80 int nr_cpus; member 96 static struct timerlat_top_data *timerlat_alloc_top(int nr_cpus) in timerlat_alloc_top() argument 105 data->nr_cpus = nr_cpus; in timerlat_alloc_top() 108 data->cpu_data = calloc(1, sizeof(*data->cpu_data) * nr_cpus); in timerlat_alloc_top() 113 for (cpu = 0; cpu < nr_cpus; cpu++) { in timerlat_alloc_top() 411 static int nr_cpus = -1; in timerlat_print_stats() local 417 if (nr_cpus == -1) in timerlat_print_stats() 418 nr_cpus = sysconf(_SC_NPROCESSORS_CONF); in timerlat_print_stats() 427 for (i = 0; i < nr_cpus; i++) { in timerlat_print_stats() 882 int nr_cpus; in timerlat_init_top() local [all …]
|
H A D | osnoise_top.c | 69 int nr_cpus; member 85 static struct osnoise_top_data *osnoise_alloc_top(int nr_cpus) in osnoise_alloc_top() argument 93 data->nr_cpus = nr_cpus; in osnoise_alloc_top() 96 data->cpu_data = calloc(1, sizeof(*data->cpu_data) * nr_cpus); in osnoise_alloc_top() 264 static int nr_cpus = -1; in osnoise_print_stats() local 267 if (nr_cpus == -1) in osnoise_print_stats() 268 nr_cpus = sysconf(_SC_NPROCESSORS_CONF); in osnoise_print_stats() 275 for (i = 0; i < nr_cpus; i++) { in osnoise_print_stats() 646 int nr_cpus; in osnoise_init_top() local 648 nr_cpus = sysconf(_SC_NPROCESSORS_CONF); in osnoise_init_top() [all …]
|
/linux/tools/testing/selftests/mm/ |
H A D | uffd-stress.c | 183 pthread_t locking_threads[nr_cpus]; in stress() 184 pthread_t uffd_threads[nr_cpus]; in stress() 185 pthread_t background_threads[nr_cpus]; in stress() 188 for (cpu = 0; cpu < nr_cpus; cpu++) { in stress() 206 for (cpu = 0; cpu < nr_cpus; cpu++) in stress() 222 for (cpu = 0; cpu < nr_cpus; cpu++) in stress() 226 for (cpu = 0; cpu < nr_cpus; cpu++) { in stress() 249 struct uffd_args args[nr_cpus]; in userfaultfd_stress() 253 memset(args, 0, sizeof(struct uffd_args) * nr_cpus); in userfaultfd_stress() 328 uffd_stats_reset(args, nr_cpus); in userfaultfd_stress() [all …]
|
/linux/tools/testing/selftests/bpf/map_tests/ |
H A D | array_map_batch_ops.c | 13 static int nr_cpus; variable 28 cpu_offset = i * nr_cpus; in map_batch_update() 29 for (j = 0; j < nr_cpus; j++) in map_batch_update() 49 cpu_offset = i * nr_cpus; in map_batch_verify() 50 for (j = 0; j < nr_cpus; j++) { in map_batch_verify() 90 value_size *= nr_cpus; in __test_map_lookup_and_update_batch() 158 nr_cpus = libbpf_num_possible_cpus(); in test_array_map_batch_ops() 160 CHECK(nr_cpus < 0, "nr_cpus checking", in test_array_map_batch_ops()
|
/linux/tools/testing/selftests/bpf/ |
H A D | test_lru_map.c | 26 static int nr_cpus; variable 96 unsigned long long value0[nr_cpus], value1[nr_cpus]; in map_subset() 127 while (next < nr_cpus) { in sched_next_online() 151 unsigned long long key, value[nr_cpus]; in test_lru_sanity0() 161 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity0() 242 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity1() 318 unsigned long long key, value[nr_cpus]; in test_lru_sanity2() 425 unsigned long long key, end_key, value[nr_cpus]; in test_lru_sanity3() 490 unsigned long long key, value[nr_cpus]; in test_lru_sanity4() 501 3 * tgt_free * nr_cpus); in test_lru_sanity4() [all …]
|
/linux/samples/bpf/ |
H A D | test_lru_dist.c | 31 static int nr_cpus; variable 222 if (next_to_try == nr_cpus) in sched_next_online() 225 while (next_to_try < nr_cpus) { in sched_next_online() 318 nr_cpus * lru_size); in test_parallel_lru_dist() 334 unsigned long long key, value[nr_cpus]; in test_lru_loss0() 346 map_fd = create_map(map_type, map_flags, 900 * nr_cpus); in test_lru_loss0() 388 unsigned long long key, value[nr_cpus]; in test_lru_loss1() 398 map_fd = create_map(map_type, map_flags, 1000 * nr_cpus); in test_lru_loss1() 426 unsigned long long key, value[nr_cpus]; in do_test_parallel_lru_loss() 475 nr_cpus * (1000 + 200)); in test_parallel_lru_loss() [all …]
|
H A D | xdp_sample_user.c | 317 unsigned int nr_cpus = libbpf_num_possible_cpus(); in alloc_record_per_cpu() local 320 array = calloc(nr_cpus, sizeof(*array)); in alloc_record_per_cpu() 323 nr_cpus); in alloc_record_per_cpu() 343 unsigned int nr_cpus = libbpf_num_possible_cpus(); in map_collect_percpu() local 356 for (i = 0; i < nr_cpus; i++) { in map_collect_percpu() 382 unsigned int nr_cpus = bpf_num_possible_cpus(); in map_collect_percpu_devmap() local 392 values = calloc(count * nr_cpus, sizeof(struct datarec)); in map_collect_percpu_devmap() 414 arr = &values[i * nr_cpus]; in map_collect_percpu_devmap() 650 unsigned int nr_cpus, struct sample_output *out) in stats_get_rx_cnt() argument 660 for (i = 0; i < nr_cpus; i++) { in stats_get_rx_cnt() [all …]
|
H A D | tracex3_user.c | 19 unsigned int nr_cpus = bpf_num_possible_cpus(); in clear_stats() local 20 __u64 values[nr_cpus]; in clear_stats() 76 unsigned int nr_cpus = bpf_num_possible_cpus(); in print_hist() local 78 long values[nr_cpus]; in print_hist() 88 for (i = 0; i < nr_cpus; i++) in print_hist()
|
/linux/drivers/powercap/ |
H A D | dtpm_cpu.c | 48 int i, nr_cpus; in set_pd_power_limit() local 50 nr_cpus = cpumask_weight_and(cpu_online_mask, to_cpumask(pd->cpus)); in set_pd_power_limit() 56 power = table[i].power * nr_cpus; in set_pd_power_limit() 63 power_limit = table[i - 1].power * nr_cpus; in set_pd_power_limit() 124 int nr_cpus; in update_pd_power_uw() local 126 nr_cpus = cpumask_weight_and(cpu_online_mask, to_cpumask(em->cpus)); in update_pd_power_uw() 132 dtpm->power_min *= nr_cpus; in update_pd_power_uw() 135 dtpm->power_max *= nr_cpus; in update_pd_power_uw()
|
/linux/tools/testing/selftests/kvm/lib/aarch64/ |
H A D | gic.c |
|
/linux/tools/perf/util/ |
H A D | bpf_kwork_top.c | 126 int idx, nr_cpus, fd; in setup_filters() local 142 nr_cpus = libbpf_num_possible_cpus(); in setup_filters() 146 if (cpu.cpu >= nr_cpus) { in setup_filters() 270 int i, fd, nr_cpus; in perf_kwork__top_read_bpf() local 280 nr_cpus = libbpf_num_possible_cpus(); in perf_kwork__top_read_bpf() 281 data = calloc(nr_cpus, sizeof(struct work_data)); in perf_kwork__top_read_bpf() 292 for (i = 0; i < nr_cpus; i++) { in perf_kwork__top_read_bpf()
|
H A D | top.c | 31 int nr_cpus; in perf_top__header_snprintf() local 97 nr_cpus = perf_cpu_map__nr(top->evlist->core.user_requested_cpus); in perf_top__header_snprintf() 100 nr_cpus > 1 ? "s" : "", in perf_top__header_snprintf() 107 nr_cpus, nr_cpus > 1 ? "s" : ""); in perf_top__header_snprintf()
|
H A D | svghelper.c | 701 int *pos, int nr_cpus) in scan_thread_topology() 710 for_each_set_bit(thr, cpumask_bits(&t->sib_thr[i]), nr_cpus) in scan_thread_topology() 716 static void scan_core_topology(int *map, struct topology *t, int nr_cpus) in scan_core_topology() 723 for_each_set_bit(cpu, cpumask_bits(&t->sib_core[i]), nr_cpus) in scan_core_topology() 724 scan_thread_topology(map, t, cpu, &pos, nr_cpus); in scan_core_topology() 727 static int str_to_bitmap(char *s, cpumask_t *b, int nr_cpus) in str_to_bitmap() 738 if (cpu.cpu >= nr_cpus) { in str_to_bitmap() 753 int i, nr_cpus; in svg_build_topology_map() 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() 700 scan_thread_topology(int * map,struct topology * t,int cpu,int * pos,int nr_cpus) scan_thread_topology() argument 715 scan_core_topology(int * map,struct topology * t,int nr_cpus) scan_core_topology() argument 726 str_to_bitmap(char * s,cpumask_t * b,int nr_cpus) str_to_bitmap() argument 754 int i, nr_cpus; svg_build_topology_map() local [all...] |
/linux/tools/testing/selftests/bpf/progs/ |
H A D | test_map_lookup_percpu_elem.c | 10 const volatile int nr_cpus; variable 60 bpf_loop(nr_cpus, read_percpu_elem_callback, &map_ctx, 0); in sysenter_getuid() 65 bpf_loop(nr_cpus, read_percpu_elem_callback, &map_ctx, 0); in sysenter_getuid() 70 bpf_loop(nr_cpus, read_percpu_elem_callback, &map_ctx, 0); in sysenter_getuid()
|
/linux/arch/mips/loongson64/ |
H A D | env.c | 148 loongson_sysconf.nr_cpus = ecpu->nr_cpus; in prom_lefi_init_env() 151 if (ecpu->nr_cpus > NR_CPUS || ecpu->nr_cpus == 0) in prom_lefi_init_env() 152 loongson_sysconf.nr_cpus = NR_CPUS; in prom_lefi_init_env() 153 loongson_sysconf.nr_nodes = (loongson_sysconf.nr_cpus + in prom_lefi_init_env()
|
/linux/drivers/pci/controller/ |
H A D | pcie-iproc-msi.c | 98 int nr_cpus; member 197 return (hwirq % msi->nr_cpus); in hwirq_to_cpu() 253 if (msi->nr_cpus > 1 && nr_irqs > 1) in iproc_msi_irq_domain_alloc() 263 order_base_2(msi->nr_cpus * nr_irqs)); in iproc_msi_irq_domain_alloc() 291 order_base_2(msi->nr_cpus * nr_irqs)); in iproc_msi_irq_domain_free() 478 for (i = cpu; i < msi->nr_irqs; i += msi->nr_cpus) { in iproc_msi_irq_free() 490 for (i = cpu; i < msi->nr_irqs; i += msi->nr_cpus) { in iproc_msi_irq_setup() 542 msi->nr_cpus = num_possible_cpus(); in iproc_msi_init() 544 if (msi->nr_cpus == 1) in iproc_msi_init() 559 if (msi->nr_irqs < msi->nr_cpus) { in iproc_msi_init() [all …]
|