Home
last modified time | relevance | path

Searched refs:i (Results 1 – 25 of 67) sorted by relevance

123

/samples/bpf/
Dlathist_user.c25 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 …]
Dlwt_len_hist_user.c20 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 …]
Dsyscall_tp_user.c48 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 …]
Dtracex2_user.c21 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 …]
Dmap_perf_test_user.c86 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 …]
Dcpustat_user.c42 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 …]
Dsampleip_user.c39 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 …]
Dxdpsock_user.c222 int i; in dump_app_stats() local
224 for (i = 0; i < num_socks && xsks[i]; i++) { in dump_app_stats()
229 rx_empty_polls_ps = (xsks[i]->app_stats.rx_empty_polls - in dump_app_stats()
230 xsks[i]->app_stats.prev_rx_empty_polls) * 1000000000. / dt; in dump_app_stats()
231 fill_fail_polls_ps = (xsks[i]->app_stats.fill_fail_polls - in dump_app_stats()
232 xsks[i]->app_stats.prev_fill_fail_polls) * 1000000000. / dt; in dump_app_stats()
233 copy_tx_sendtos_ps = (xsks[i]->app_stats.copy_tx_sendtos - in dump_app_stats()
234 xsks[i]->app_stats.prev_copy_tx_sendtos) * 1000000000. / dt; in dump_app_stats()
235 tx_wakeup_sendtos_ps = (xsks[i]->app_stats.tx_wakeup_sendtos - in dump_app_stats()
236 xsks[i]->app_stats.prev_tx_wakeup_sendtos) in dump_app_stats()
[all …]
Dxsk_fwd.c135 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 …]
Dxdp_sample_user.c244 for (int i = 2; i < XDP_REDIRECT_ERR_MAX; i++) in sample_print_help() local
245 printf("\t\t\t %s: %s\n", xdp_redirect_err_names[i], in sample_print_help()
246 xdp_redirect_err_help[i - 1]); in sample_print_help()
298 int i; in sample_usage() local
304 for (i = 0; long_options[i].name != 0; i++) { in sample_usage()
305 printf(" --%-15s", long_options[i].name); in sample_usage()
306 if (long_options[i].flag != NULL) in sample_usage()
308 *long_options[i].flag); in sample_usage()
310 printf("\t short-option: -%c", long_options[i].val); in sample_usage()
351 int i; in map_collect_percpu() local
[all …]
Doffwaketime_user.c52 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()
101 int delay = 1, i = 0; in main() local
134 links[i] = bpf_program__attach(prog); in main()
135 if (libbpf_get_error(links[i])) { in main()
137 links[i] = NULL; in main()
140 i++; in main()
[all …]
Dtest_overhead_user.c41 int i, fd; in test_task_rename() local
49 for (i = 0; i < MAX_CNT; i++) { in test_task_rename()
65 int i, fd; in test_urandom_read() local
73 for (i = 0; i < MAX_CNT; i++) { in test_urandom_read()
102 int i; in run_perf_test() local
104 for (i = 0; i < tasks; i++) { in run_perf_test()
105 pid[i] = fork(); in run_perf_test()
106 if (pid[i] == 0) { in run_perf_test()
107 loop(i, flags); in run_perf_test()
109 } else if (pid[i] == -1) { in run_perf_test()
[all …]
Dxdp_rxq_info_user.c113 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 …]
Dxdp_redirect_map_multi_user.c55 int i, ret = -1; in update_mac_map() local
57 for (i = 0; ifaces[i] > 0; i++) { in update_mac_map()
58 ifindex = ifaces[i]; in update_mac_map()
93 int i, opt; in main() local
148 for (i = 0; i < MAX_IFACE_NUM && argv[optind + i]; i++) { in main()
149 ifaces[i] = if_nametoindex(argv[optind + i]); in main()
150 if (!ifaces[i]) in main()
151 ifaces[i] = strtoul(argv[optind + i], NULL, 0); in main()
152 if (!if_indextoname(ifaces[i], ifname)) { in main()
158 skel->rodata->from_match[i] = ifaces[i]; in main()
[all …]
Dtracex6_user.c77 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()
182 int i = 0; in main() local
206 links[i] = bpf_program__attach(prog); in main()
[all …]
Dtracex3_user.c84 int i; in print_hist() local
89 for (i = 0; i < nr_cpus; i++) in print_hist()
90 value += values[i]; in print_hist()
114 int map_fd, i, j = 0; in main() local
116 for (i = 1; i < ac; i++) { in main()
117 if (strcmp(argv[i], "-a") == 0) { in main()
119 } else if (strcmp(argv[i], "-t") == 0) { in main()
121 } else if (strcmp(argv[i], "-h") == 0) { in main()
171 for (i = 0; ; i++) { in main()
172 if (i % 20 == 0) in main()
Dxdp_adjust_tail_user.c93 int i, prog_fd, map_fd, opt; in main() local
100 for (i = 0; i < strlen(optstr); i++) in main()
101 if (optstr[i] != 'h' && 'a' <= optstr[i] && optstr[i] <= 'z') in main()
102 opt_flags[(unsigned char)optstr[i]] = 1; in main()
137 for (i = 0; i < strlen(optstr); i++) { in main()
138 if (opt_flags[(unsigned int)optstr[i]]) { in main()
139 fprintf(stderr, "Missing argument -%c\n", optstr[i]); in main()
/samples/auxdisplay/
Dcfag12864b-example.c128 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/
Ddma-example.c23 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()
Dbytestream-example.c55 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 …]
Dinttype-example.c55 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/
Dne_ioctl_sample.c201 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/
Dpktgen_sample06_numa_awared_queue_irq_affinity.sh50 for ((i = 0; i < $THREADS; i++)); do
55 thread=${cpu_array[$((i+F_THREAD))]}
57 echo $thread > /proc/irq/${irq_array[$i]}/smp_affinity_list
58 … info "irq ${irq_array[$i]} is set affinity to `cat /proc/irq/${irq_array[$i]}/smp_affinity_list`"
65 queue_num=$i
106 for ((i = 0; i < $THREADS; i++)); do
107 thread=${cpu_array[$((i+F_THREAD))]}
/samples/hidraw/
Dhid-example.c46 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()
/samples/landlock/
Dsandboxer.c58 int i, num_paths = 0; in parse_path() local
62 for (i = 0; env_path[i]; i++) { in parse_path()
63 if (env_path[i] == ENV_PATH_TOKEN[0]) in parse_path()
68 for (i = 0; i < num_paths; i++) in parse_path()
69 (*path_list)[i] = strsep(&env_path, ENV_PATH_TOKEN); in parse_path()
86 int num_paths, i, ret = 1; in populate_ruleset() local
111 for (i = 0; i < num_paths; i++) { in populate_ruleset()
114 path_beneath.parent_fd = open(path_list[i], O_PATH | O_CLOEXEC); in populate_ruleset()
117 path_list[i], strerror(errno)); in populate_ruleset()
131 path_list[i], strerror(errno)); in populate_ruleset()

123