/samples/bpf/ |
D | lathist_user.c | 25 int i; in stars() local 27 for (i = 0; i < (width * val / max) - 1 && i < width - 1; i++) in stars() 28 str[i] = '*'; in stars() 30 str[i - 1] = '+'; in stars() 31 str[i] = '\0'; in stars() 38 int i, j; in print_hist() local 52 for (i = 1; i <= MAX_ENTRIES; i++) { in print_hist() 53 stars(starstr, hist->data[i - 1], hist->max, MAX_STARS); in print_hist() 55 (1l << i) >> 1, (1l << i) - 1, in print_hist() 56 hist->data[i - 1], MAX_STARS, starstr); in print_hist() [all …]
|
D | lwt_len_hist_user.c | 20 int i; in stars() local 22 for (i = 0; i < (width * val / max) - 1 && i < width - 1; i++) in stars() 23 str[i] = '*'; in stars() 25 str[i - 1] = '+'; in stars() 26 str[i] = '\0'; in stars() 36 int i, map_fd; in main() local 54 for (i = 0; i < nr_cpus; i++) in main() 55 sum += values[i]; in main() 67 for (i = 1; i <= max_key + 1; i++) { in main() 68 stars(starstr, data[i - 1], max_value, MAX_STARS); in main() [all …]
|
D | syscall_tp_user.c | 48 int map0_fds[num_progs], map1_fds[num_progs], fd, i, j = 0; in test() local 53 for (i = 0; i < num_progs; i++) { in test() 54 objs[i] = bpf_object__open_file(filename, NULL); in test() 55 if (libbpf_get_error(objs[i])) { in test() 57 objs[i] = NULL; in test() 62 if (bpf_object__load(objs[i])) { in test() 67 map0_fds[i] = bpf_object__find_map_fd_by_name(objs[i], in test() 69 map1_fds[i] = bpf_object__find_map_fd_by_name(objs[i], in test() 71 if (map0_fds[i] < 0 || map1_fds[i] < 0) { in test() 76 bpf_object__for_each_program(prog, objs[i]) { in test() [all …]
|
D | map_perf_test_user.c | 86 int i; in test_hash_prealloc() local 89 for (i = 0; i < max_cnt; i++) in test_hash_prealloc() 128 int i, ret; in do_test_lru() local 187 for (i = 0; i < max_cnt; i++) { in do_test_lru() 224 int i; in test_percpu_hash_prealloc() local 227 for (i = 0; i < max_cnt; i++) in test_percpu_hash_prealloc() 236 int i; in test_hash_kmalloc() local 239 for (i = 0; i < max_cnt; i++) in test_hash_kmalloc() 248 int i; in test_percpu_hash_kmalloc() local 251 for (i = 0; i < max_cnt; i++) in test_percpu_hash_kmalloc() [all …]
|
D | cpustat_user.c | 42 int i, j; in cpu_stat_print() local 53 for (i = 0; i < MAX_CSTATE_ENTRIES; i++) { in cpu_stat_print() 54 sprintf(state_str, "cstate-%d", i); in cpu_stat_print() 58 for (i = 0; i < MAX_PSTATE_ENTRIES; i++) { in cpu_stat_print() 59 sprintf(state_str, "pstate-%d", i); in cpu_stat_print() 69 for (i = 0; i < MAX_CSTATE_ENTRIES; i++) in cpu_stat_print() 70 printf("%-11ld ", data->cstate[i] / 1000000); in cpu_stat_print() 72 for (i = 0; i < MAX_PSTATE_ENTRIES; i++) in cpu_stat_print() 73 printf("%-11ld ", data->pstate[i] / 1000000); in cpu_stat_print() 82 int c, i; in cpu_stat_update() local [all …]
|
D | tracex2_user.c | 21 int i; in stars() local 23 for (i = 0; i < (width * val / max) - 1 && i < width - 1; i++) in stars() 24 str[i] = '*'; in stars() 26 str[i - 1] = '+'; in stars() 27 str[i] = '\0'; in stars() 53 int i, ind; in print_hist_for_pid() local 62 for (i = 0; i < nr_cpus; i++) in print_hist_for_pid() 63 value += values[i]; in print_hist_for_pid() 75 for (i = 1; i <= max_ind + 1; i++) { in print_hist_for_pid() 76 stars(starstr, data[i - 1], max_value, MAX_STARS); in print_hist_for_pid() [all …]
|
D | xdp_monitor_user.c | 84 int i; in usage() local 90 for (i = 0; long_options[i].name != 0; i++) { in usage() 91 printf(" --%-15s", long_options[i].name); in usage() 92 if (long_options[i].flag != NULL) in usage() 94 *long_options[i].flag); in usage() 97 long_options[i].val); in usage() 192 int i; in map_collect_record() local 203 for (i = 0; i < nr_cpus; i++) { in map_collect_record() 204 rec->cpu[i].processed = values[i].processed; in map_collect_record() 205 sum_processed += values[i].processed; in map_collect_record() [all …]
|
D | xdpsock_user.c | 219 int i; in dump_app_stats() local 221 for (i = 0; i < num_socks && xsks[i]; i++) { in dump_app_stats() 226 rx_empty_polls_ps = (xsks[i]->app_stats.rx_empty_polls - in dump_app_stats() 227 xsks[i]->app_stats.prev_rx_empty_polls) * 1000000000. / dt; in dump_app_stats() 228 fill_fail_polls_ps = (xsks[i]->app_stats.fill_fail_polls - in dump_app_stats() 229 xsks[i]->app_stats.prev_fill_fail_polls) * 1000000000. / dt; in dump_app_stats() 230 copy_tx_sendtos_ps = (xsks[i]->app_stats.copy_tx_sendtos - in dump_app_stats() 231 xsks[i]->app_stats.prev_copy_tx_sendtos) * 1000000000. / dt; in dump_app_stats() 232 tx_wakeup_sendtos_ps = (xsks[i]->app_stats.tx_wakeup_sendtos - in dump_app_stats() 233 xsks[i]->app_stats.prev_tx_wakeup_sendtos) in dump_app_stats() [all …]
|
D | sampleip_user.c | 39 int i, pmu_fd; in sampling_start() local 49 for (i = 0; i < nr_cpus; i++) { in sampling_start() 50 pmu_fd = sys_perf_event_open(&pe_sample_attr, -1 /* pid */, i, in sampling_start() 56 links[i] = bpf_program__attach_perf_event(prog, pmu_fd); in sampling_start() 57 if (libbpf_get_error(links[i])) { in sampling_start() 59 links[i] = NULL; in sampling_start() 70 int i; in sampling_end() local 72 for (i = 0; i < nr_cpus; i++) in sampling_end() 73 bpf_link__destroy(links[i]); in sampling_end() 94 int i, max; in print_ip_map() local [all …]
|
D | test_overhead_user.c | 37 int i, fd; in test_task_rename() local 45 for (i = 0; i < MAX_CNT; i++) { in test_task_rename() 61 int i, fd; in test_urandom_read() local 69 for (i = 0; i < MAX_CNT; i++) { in test_urandom_read() 98 int i; in run_perf_test() local 100 for (i = 0; i < tasks; i++) { in run_perf_test() 101 pid[i] = fork(); in run_perf_test() 102 if (pid[i] == 0) { in run_perf_test() 103 loop(i, flags); in run_perf_test() 105 } else if (pid[i] == -1) { in run_perf_test() [all …]
|
D | xsk_fwd.c | 135 u64 total_size, i; in bpool_init() local 182 for (i = 0; i < n_slabs; i++) in bpool_init() 183 bp->slabs[i] = &bp->buffers[i * params->n_buffers_per_slab]; in bpool_init() 186 for (i = 0; i < n_slabs_reserved; i++) in bpool_init() 187 bp->slabs_reserved[i] = &bp->buffers_reserved[i * in bpool_init() 191 for (i = 0; i < n_buffers; i++) in bpool_init() 192 bp->buffers[i] = i * params->buffer_size; in bpool_init() 479 int status, i; in port_init() local 516 for (i = 0; i < umem_fq_size; i++) in port_init() 517 *xsk_ring_prod__fill_addr(&p->umem_fq, pos + i) = in port_init() [all …]
|
D | bpf_load.c | 268 int i, numa_node; in load_maps() local 270 for (i = 0; i < nr_maps; i++) { in load_maps() 272 fixup_map(&maps[i], i); in load_maps() 274 if (maps[i].fd != -1) { in load_maps() 275 map_fd[i] = maps[i].fd; in load_maps() 280 numa_node = maps[i].def.map_flags & BPF_F_NUMA_NODE ? in load_maps() 281 maps[i].def.numa_node : -1; in load_maps() 283 if (maps[i].def.type == BPF_MAP_TYPE_ARRAY_OF_MAPS || in load_maps() 284 maps[i].def.type == BPF_MAP_TYPE_HASH_OF_MAPS) { in load_maps() 285 int inner_map_fd = map_fd[maps[i].def.inner_map_idx]; in load_maps() [all …]
|
D | offwaketime_user.c | 52 int i; in print_stack() local 58 for (i = PERF_MAX_STACK_DEPTH - 1; i >= 0; i--) in print_stack() 59 print_ksym(ip[i]); in print_stack() 65 for (i = 0; i < PERF_MAX_STACK_DEPTH; i++) in print_stack() 66 print_ksym(ip[i]); in print_stack() 102 int delay = 1, i = 0; in main() local 140 links[i] = bpf_program__attach(prog); in main() 141 if (libbpf_get_error(links[i])) { in main() 143 links[i] = NULL; in main() 146 i++; in main() [all …]
|
D | xdp_rxq_info_user.c | 113 int i; in parse_xdp_action() local 115 for (i = 0; i < XDP_ACTION_MAX; i++) { in parse_xdp_action() 117 if (strncmp(xdp_action_names[i], action_str, maxlen) == 0) { in parse_xdp_action() 118 action = i; in parse_xdp_action() 127 int i; in list_xdp_actions() local 130 for (i = 0; i < XDP_ACTION_MAX; i++) in list_xdp_actions() 131 printf("\t%s\n", xdp_action_names[i]); in list_xdp_actions() 149 int i; in usage() local 154 for (i = 0; long_options[i].name != 0; i++) { in usage() 155 printf(" --%-12s", long_options[i].name); in usage() [all …]
|
D | tracex6_user.c | 77 int i, status, nr_cpus = sysconf(_SC_NPROCESSORS_CONF); in test_perf_event_array() local 83 for (i = 0; i < nr_cpus; i++) { in test_perf_event_array() 84 pid[i] = fork(); in test_perf_event_array() 85 assert(pid[i] >= 0); in test_perf_event_array() 86 if (pid[i] == 0) { in test_perf_event_array() 87 check_on_cpu(i, attr); in test_perf_event_array() 92 for (i = 0; i < nr_cpus; i++) { in test_perf_event_array() 93 assert(waitpid(pid[i], &status, 0) == pid[i]); in test_perf_event_array() 183 int i = 0; in main() local 209 links[i] = bpf_program__attach(prog); in main() [all …]
|
D | xdp_redirect_cpu_user.c | 137 int i; in usage() local 143 for (i = 0; long_options[i].name != 0; i++) { in usage() 144 printf(" --%-12s", long_options[i].name); in usage() 145 if (long_options[i].flag != NULL) in usage() 147 *long_options[i].flag); in usage() 150 long_options[i].val); in usage() 209 int i; in map_collect_percpu() local 220 for (i = 0; i < nr_cpus; i++) { in map_collect_percpu() 221 rec->cpu[i].processed = values[i].processed; in map_collect_percpu() 222 sum_processed += values[i].processed; in map_collect_percpu() [all …]
|
D | tracex3_user.c | 84 int i; in print_hist() local 89 for (i = 0; i < nr_cpus; i++) in print_hist() 90 value += values[i]; in print_hist() 115 int map_fd, i, j = 0; in main() local 117 for (i = 1; i < ac; i++) { in main() 118 if (strcmp(argv[i], "-a") == 0) { in main() 120 } else if (strcmp(argv[i], "-t") == 0) { in main() 122 } else if (strcmp(argv[i], "-h") == 0) { in main() 177 for (i = 0; ; i++) { in main() 178 if (i % 20 == 0) in main()
|
D | xdp_router_ipv4_user.c | 43 int i = 0; in int_exit() local 45 for (i = 0; i < total_ifindex; i++) { in int_exit() 46 if (bpf_get_link_xdp_id(ifindex_list[i], &prog_id, flags)) { in int_exit() 48 ifindex_list[i]); in int_exit() 51 if (prog_id_list[i] == prog_id) in int_exit() 52 bpf_set_link_xdp_fd(ifindex_list[i], -1, flags); in int_exit() 55 ifindex_list[i]); in int_exit() 58 ifindex_list[i]); in int_exit() 77 int fd, i; in getmac() local 86 for (i = 0; i < 6 ; i++) in getmac() [all …]
|
/samples/auxdisplay/ |
D | cfag12864b-example.c | 128 unsigned short i; in cfag12864b_fill() local 130 for (i = 0; i < CFAG12864B_SIZE; i++) in cfag12864b_fill() 131 cfag12864b_buffer[i] = 0xFF; in cfag12864b_fill() 139 unsigned short i; in cfag12864b_clear() local 141 for (i = 0; i < CFAG12864B_SIZE; i++) in cfag12864b_clear() 142 cfag12864b_buffer[i] = 0; in cfag12864b_clear() 153 unsigned char i, j, n; in cfag12864b_format() local 155 for (i = 0; i < CFAG12864B_HEIGHT; i++) in cfag12864b_format() 157 cfag12864b_buffer[i * CFAG12864B_WIDTH / CFAG12864B_BPB + in cfag12864b_format() 160 if (matrix[i * CFAG12864B_WIDTH + in cfag12864b_format() [all …]
|
/samples/kfifo/ |
D | dma-example.c | 23 int i; in example_init() local 39 for (i = 0; i != 9; i++) in example_init() 40 kfifo_put(&fifo, i); in example_init() 73 for (i = 0; i < nents; i++) { in example_init() 77 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init() 79 if (sg_is_last(&sg[i])) in example_init() 102 for (i = 0; i < nents; i++) { in example_init() 106 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init() 108 if (sg_is_last(&sg[i])) in example_init()
|
D | bytestream-example.c | 55 unsigned char i, j; in testfunc() local 64 for (i = 0; i != 10; i++) in testfunc() 65 kfifo_put(&test, i); in testfunc() 71 i = kfifo_out(&test, buf, 5); in testfunc() 72 printk(KERN_INFO "buf: %.*s\n", i, buf); in testfunc() 86 for (i = 20; kfifo_put(&test, i); i++) in testfunc() 92 if (kfifo_peek(&test, &i)) in testfunc() 93 printk(KERN_INFO "%d\n", i); in testfunc() 97 while (kfifo_get(&test, &i)) { in testfunc() 98 printk(KERN_INFO "item = %d\n", i); in testfunc() [all …]
|
D | inttype-example.c | 55 int i, j; in testfunc() local 61 for (i = 0; i != 10; i++) in testfunc() 62 kfifo_put(&test, i); in testfunc() 79 for (i = 20; kfifo_put(&test, i); i++) in testfunc() 85 if (kfifo_peek(&test, &i)) in testfunc() 86 printk(KERN_INFO "%d\n", i); in testfunc() 90 while (kfifo_get(&test, &i)) { in testfunc() 91 printk(KERN_INFO "item = %d\n", i); in testfunc() 92 if (i != expected_result[j++]) { in testfunc()
|
/samples/nitro_enclaves/ |
D | ne_ioctl_sample.c | 201 int i = 0; in ne_poll_enclave_fd() local 211 printf("[iter %d] Polling ...\n", i); in ne_poll_enclave_fd() 220 i++; in ne_poll_enclave_fd() 224 i * NE_POLL_WAIT_TIME); in ne_poll_enclave_fd() 293 unsigned long i = 0; in ne_load_enclave_image() local 302 for (i = 0; i < NE_DEFAULT_NR_MEM_REGIONS; i++) in ne_load_enclave_image() 303 enclave_memory_size += ne_user_mem_regions[i].memory_size; in ne_load_enclave_image() 362 for (i = 0; i < NE_DEFAULT_NR_MEM_REGIONS; i++) { in ne_load_enclave_image() 365 size_t memory_size = ne_user_mem_regions[i].memory_size; in ne_load_enclave_image() 367 void *userspace_addr = ne_user_mem_regions[i].userspace_addr; in ne_load_enclave_image() [all …]
|
/samples/pktgen/ |
D | pktgen_sample06_numa_awared_queue_irq_affinity.sh | 51 for ((i = 0; i < $THREADS; i++)); do 56 thread=${cpu_array[$((i+F_THREAD))]} 58 echo $thread > /proc/irq/${irq_array[$i]}/smp_affinity_list 59 … info "irq ${irq_array[$i]} is set affinity to `cat /proc/irq/${irq_array[$i]}/smp_affinity_list`" 66 queue_num=$i 108 for ((i = 0; i < $THREADS; i++)); do 109 thread=${cpu_array[$((i+F_THREAD))]}
|
/samples/hidraw/ |
D | hid-example.c | 46 int i, res, desc_size = 0; in main() local 82 for (i = 0; i < rpt_desc.size; i++) in main() 83 printf("%hhx ", rpt_desc.value[i]); in main() 132 for (i = 0; i < res; i++) in main() 133 printf("%hhx ", buf[i]); in main() 154 for (i = 0; i < res; i++) in main() 155 printf("%hhx ", buf[i]); in main()
|