Home
last modified time | relevance | path

Searched refs:i (Results 1 – 25 of 63) 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.c50 int map0_fds[nr_tests], map1_fds[nr_tests], fd, i, j = 0; in test() local
55 for (i = 0; i < nr_tests; i++) { in test()
56 objs[i] = bpf_object__open_file(filename, NULL); in test()
57 if (libbpf_get_error(objs[i])) { in test()
59 objs[i] = NULL; in test()
67 bpf_object__for_each_program(prog, objs[i]) in test()
77 if (bpf_object__load(objs[i])) { in test()
82 map0_fds[i] = bpf_object__find_map_fd_by_name(objs[i], in test()
84 map1_fds[i] = bpf_object__find_map_fd_by_name(objs[i], in test()
86 if (map0_fds[i] < 0 || map1_fds[i] < 0) { in test()
[all …]
Dmap_perf_test_user.c85 int i; in test_hash_prealloc() local
88 for (i = 0; i < max_cnt; i++) in test_hash_prealloc()
127 int i, ret; in do_test_lru() local
189 for (i = 0; i < max_cnt; i++) { in do_test_lru()
226 int i; in test_percpu_hash_prealloc() local
229 for (i = 0; i < max_cnt; i++) in test_percpu_hash_prealloc()
238 int i; in test_hash_kmalloc() local
241 for (i = 0; i < max_cnt; i++) in test_hash_kmalloc()
250 int i; in test_percpu_hash_kmalloc() local
253 for (i = 0; i < max_cnt; i++) in test_percpu_hash_kmalloc()
[all …]
Dcpustat_user.c41 int i, j; in cpu_stat_print() local
52 for (i = 0; i < MAX_CSTATE_ENTRIES; i++) { in cpu_stat_print()
53 sprintf(state_str, "cstate-%d", i); in cpu_stat_print()
57 for (i = 0; i < MAX_PSTATE_ENTRIES; i++) { in cpu_stat_print()
58 sprintf(state_str, "pstate-%d", i); in cpu_stat_print()
68 for (i = 0; i < MAX_CSTATE_ENTRIES; i++) in cpu_stat_print()
69 printf("%-11lu ", data->cstate[i] / 1000000); in cpu_stat_print()
71 for (i = 0; i < MAX_PSTATE_ENTRIES; i++) in cpu_stat_print()
72 printf("%-11lu ", data->pstate[i] / 1000000); in cpu_stat_print()
81 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 …]
Doffwaketime_user.c51 int i; in print_stack() local
57 for (i = PERF_MAX_STACK_DEPTH - 1; i >= 0; i--) in print_stack()
58 print_ksym(ip[i]); in print_stack()
64 for (i = 0; i < PERF_MAX_STACK_DEPTH; i++) in print_stack()
65 print_ksym(ip[i]); in print_stack()
100 int delay = 1, i = 0; in main() local
133 links[i] = bpf_program__attach(prog); in main()
134 if (libbpf_get_error(links[i])) { in main()
136 links[i] = NULL; in main()
139 i++; in main()
[all …]
Dxdp_sample_user.c243 for (int i = 2; i < XDP_REDIRECT_ERR_MAX; i++) in sample_print_help() local
244 printf("\t\t\t %s: %s\n", xdp_redirect_err_names[i], in sample_print_help()
245 xdp_redirect_err_help[i - 1]); in sample_print_help()
297 int i; in sample_usage() local
303 for (i = 0; long_options[i].name != 0; i++) { in sample_usage()
304 printf(" --%-15s", long_options[i].name); in sample_usage()
305 if (long_options[i].flag != NULL) in sample_usage()
307 *long_options[i].flag); in sample_usage()
309 printf("\t short-option: -%c", long_options[i].val); in sample_usage()
350 int i; in map_collect_percpu() local
[all …]
Dtracex6_user.c76 int i, status, nr_cpus = sysconf(_SC_NPROCESSORS_CONF); in test_perf_event_array() local
82 for (i = 0; i < nr_cpus; i++) { in test_perf_event_array()
83 pid[i] = fork(); in test_perf_event_array()
84 assert(pid[i] >= 0); in test_perf_event_array()
85 if (pid[i] == 0) { in test_perf_event_array()
86 check_on_cpu(i, attr); in test_perf_event_array()
91 for (i = 0; i < nr_cpus; i++) { in test_perf_event_array()
92 assert(waitpid(pid[i], &status, 0) == pid[i]); in test_perf_event_array()
181 int i = 0; in main() local
205 links[i] = bpf_program__attach(prog); in main()
[all …]
Dtest_overhead_user.c44 int i, fd; in test_task_rename() local
52 for (i = 0; i < MAX_CNT; i++) { in test_task_rename()
69 int i, fd; in test_fib_table_lookup() local
81 for (i = 0; i < MAX_CNT; i++) { in test_fib_table_lookup()
111 int i; in run_perf_test() local
113 for (i = 0; i < tasks; i++) { in run_perf_test()
114 pid[i] = fork(); in run_perf_test()
115 if (pid[i] == 0) { in run_perf_test()
116 loop(i, flags); in run_perf_test()
118 } else if (pid[i] == -1) { in run_perf_test()
[all …]
Dmap_perf_test.bpf.c109 int i; in BPF_KSYSCALL() local
111 for (i = 0; i < 10; i++) { in BPF_KSYSCALL()
127 int i; in BPF_KSYSCALL() local
129 for (i = 0; i < 10; i++) { in BPF_KSYSCALL()
144 int i; in BPF_KSYSCALL() local
146 for (i = 0; i < 10; i++) { in BPF_KSYSCALL()
161 int i; in BPF_KSYSCALL() local
163 for (i = 0; i < 10; i++) { in BPF_KSYSCALL()
228 u32 i; in BPF_KSYSCALL() local
233 for (i = 0; i < 32; i++) { in BPF_KSYSCALL()
[all …]
Dtracex3_user.c83 int i; in print_hist() local
88 for (i = 0; i < nr_cpus; i++) in print_hist()
89 value += values[i]; in print_hist()
113 int map_fd, i, j = 0; in main() local
115 for (i = 1; i < ac; i++) { in main()
116 if (strcmp(argv[i], "-a") == 0) { in main()
118 } else if (strcmp(argv[i], "-t") == 0) { in main()
120 } else if (strcmp(argv[i], "-h") == 0) { in main()
170 for (i = 0; ; i++) { in main()
171 if (i % 20 == 0) in main()
Dxdp_adjust_tail_user.c89 int i, prog_fd, map_fd, opt; in main() local
97 for (i = 0; i < strlen(optstr); i++) in main()
98 if (optstr[i] != 'h' && 'a' <= optstr[i] && optstr[i] <= 'z') in main()
99 opt_flags[(unsigned char)optstr[i]] = 1; in main()
134 for (i = 0; i < strlen(optstr); i++) { in main()
135 if (opt_flags[(unsigned int)optstr[i]]) { in main()
136 fprintf(stderr, "Missing argument -%c\n", optstr[i]); in main()
Dtrace_event_user.c65 int i; in print_stack() local
71 for (i = PERF_MAX_STACK_DEPTH - 1; i >= 0; i--) in print_stack()
72 print_ksym(ip[i]); in print_stack()
78 for (i = PERF_MAX_STACK_DEPTH - 1; i >= 0; i--) in print_stack()
79 print_addr(ip[i]); in print_stack()
141 int i, pmu_fd, error = 1; in test_perf_event_all_cpu() local
152 for (i = 0; i < nr_cpus; i++) { in test_perf_event_all_cpu()
153 pmu_fd = sys_perf_event_open(attr, -1, i, -1, 0); in test_perf_event_all_cpu()
158 links[i] = bpf_program__attach_perf_event(prog, pmu_fd); in test_perf_event_all_cpu()
159 if (libbpf_get_error(links[i])) { in test_perf_event_all_cpu()
[all …]
Dxdp_tx_iptunnel_user.c57 int i; in poll_stats() local
69 for (i = 0; i < nr_cpus; i++) in poll_stats()
70 sum += (values[i] - prev[proto][i]); in poll_stats()
166 int i, err; in main() local
171 for (i = 0; i < strlen(optstr); i++) in main()
172 if (optstr[i] != 'h' && 'a' <= optstr[i] && optstr[i] <= 'z') in main()
173 opt_flags[(unsigned char)optstr[i]] = 1; in main()
245 for (i = 0; i < strlen(optstr); i++) { in main()
246 if (opt_flags[(unsigned int)optstr[i]]) { in main()
247 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.c25 int i; in example_init() local
41 for (i = 0; i != 9; i++) in example_init()
42 kfifo_put(&fifo, i); in example_init()
75 for (i = 0; i < nents; i++) { in example_init()
79 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init()
81 if (sg_is_last(&sg[i])) in example_init()
104 for (i = 0; i < nents; i++) { in example_init()
108 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init()
110 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/pfsm/
Dpfsm-wakeup.c33 int i, ret, fd_rtc, fd_pfsm[PMIC_NB] = { 0 }; in main() local
44 for (i = 0 ; i < PMIC_NB ; i++) { in main()
45 fd_pfsm[i] = open(dev_pfsm[i], O_RDWR); in main()
46 if (fd_pfsm[i] < 0) { in main()
93 for (i = PMIC_NB - 1 ; i >= 0 ; i--) { in main()
94 printf("Set RETENTION state for PMIC_%d.\n", i); in main()
96 ret = ioctl(fd_pfsm[i], PMIC_SET_RETENTION_STATE, &pmic_opt); in main()
117 for (i = 0 ; i < PMIC_NB ; i++) in main()
118 if (fd_pfsm[i]) in main()
119 close(fd_pfsm[i]); in main()
/samples/nitro_enclaves/
Dne_ioctl_sample.c200 int i = 0; in ne_poll_enclave_fd() local
210 printf("[iter %d] Polling ...\n", i); in ne_poll_enclave_fd()
219 i++; in ne_poll_enclave_fd()
223 i * NE_POLL_WAIT_TIME); in ne_poll_enclave_fd()
292 unsigned long i = 0; in ne_load_enclave_image() local
301 for (i = 0; i < NE_DEFAULT_NR_MEM_REGIONS; i++) in ne_load_enclave_image()
302 enclave_memory_size += ne_user_mem_regions[i].memory_size; in ne_load_enclave_image()
361 for (i = 0; i < NE_DEFAULT_NR_MEM_REGIONS; i++) { in ne_load_enclave_image()
364 size_t memory_size = ne_user_mem_regions[i].memory_size; in ne_load_enclave_image()
366 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.sh53 for ((i = 0; i < $THREADS; i++)); do
58 thread=${cpu_array[$((i+F_THREAD))]}
60 echo $thread > /proc/irq/${irq_array[$i]}/smp_affinity_list
61 … info "irq ${irq_array[$i]} is set affinity to `cat /proc/irq/${irq_array[$i]}/smp_affinity_list`"
68 queue_num=$i
109 for ((i = 0; i < $THREADS; i++)); do
110 thread=${cpu_array[$((i+F_THREAD))]}
/samples/ftrace/
Dftrace-ops.c129 for (unsigned int i = 0; i < nr; i++) { in ops_alloc_init() local
130 ops[i].ops.func = func; in ops_alloc_init()
131 ops[i].ops.flags = flags; in ops_alloc_init()
132 WARN_ON_ONCE(ftrace_set_filter_ip(&ops[i].ops, (unsigned long)tracee, 0, 0)); in ops_alloc_init()
133 WARN_ON_ONCE(register_ftrace_function(&ops[i].ops)); in ops_alloc_init()
144 for (unsigned int i = 0; i < nr; i++) { in ops_destroy() local
145 WARN_ON_ONCE(unregister_ftrace_function(&ops[i].ops)); in ops_destroy()
146 ftrace_free_filter(&ops[i].ops); in ops_destroy()
158 for (unsigned int i = 0; i < nr; i++) { in ops_check() local
215 for (unsigned int i = 0; i < nr_function_calls; i++) in ftrace_ops_sample_init() local
/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/crypto/
Dfips140_lab_util.c93 size_t i; in rand_bytes() local
95 for (i = 0; i < count; i++) in rand_bytes()
96 bytes[i] = rand(); in rand_bytes()
107 size_t i; in bytes_to_hex() local
110 for (i = 0; i < count; i++) in bytes_to_hex()
111 sprintf(&hex[2*i], "%02x", bytes[i]); in bytes_to_hex()
278 size_t i; in cmd_dump_jitterentropy() local
299 for (i = 0; i < iterations; i++) { in cmd_dump_jitterentropy()
521 int i; in cmd_show_invalid_inputs() local
523 for (i = 0; i < ARRAY_SIZE(invalid_input_tests); i++) in cmd_show_invalid_inputs()
[all …]

123