/samples/bpf/ |
D | lathist_user.c | 26 int i; in stars() local 28 for (i = 0; i < (width * val / max) - 1 && i < width - 1; i++) in stars() 29 str[i] = '*'; in stars() 31 str[i - 1] = '+'; in stars() 32 str[i] = '\0'; in stars() 39 int i, j; in print_hist() local 53 for (i = 1; i <= MAX_ENTRIES; i++) { in print_hist() 54 stars(starstr, hist->data[i - 1], hist->max, MAX_STARS); in print_hist() 56 (1l << i) >> 1, (1l << i) - 1, in print_hist() 57 hist->data[i - 1], MAX_STARS, starstr); in print_hist() [all …]
|
D | tracex2_user.c | 19 int i; in stars() local 21 for (i = 0; i < (width * val / max) - 1 && i < width - 1; i++) in stars() 22 str[i] = '*'; in stars() 24 str[i - 1] = '+'; in stars() 25 str[i] = '\0'; in stars() 51 int i, ind; in print_hist_for_pid() local 60 for (i = 0; i < nr_cpus; i++) in print_hist_for_pid() 61 value += values[i]; in print_hist_for_pid() 73 for (i = 1; i <= max_ind + 1; i++) { in print_hist_for_pid() 74 stars(starstr, data[i - 1], max_value, MAX_STARS); in print_hist_for_pid() [all …]
|
D | cpustat_user.c | 41 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("%-11ld ", data->cstate[i] / 1000000); in cpu_stat_print() 71 for (i = 0; i < MAX_PSTATE_ENTRIES; i++) in cpu_stat_print() 72 printf("%-11ld ", data->pstate[i] / 1000000); in cpu_stat_print() 81 int c, i; in cpu_stat_update() local [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 | map_perf_test_user.c | 81 int i; in test_hash_prealloc() local 84 for (i = 0; i < max_cnt; i++) in test_hash_prealloc() 123 int i, ret; in do_test_lru() local 182 for (i = 0; i < max_cnt; i++) { in do_test_lru() 219 int i; in test_percpu_hash_prealloc() local 222 for (i = 0; i < max_cnt; i++) in test_percpu_hash_prealloc() 231 int i; in test_hash_kmalloc() local 234 for (i = 0; i < max_cnt; i++) in test_hash_kmalloc() 243 int i; in test_percpu_hash_kmalloc() local 246 for (i = 0; i < max_cnt; i++) in test_percpu_hash_kmalloc() [all …]
|
D | xdp_monitor_user.c | 49 int i; in usage() local 55 for (i = 0; long_options[i].name != 0; i++) { in usage() 56 printf(" --%-15s", long_options[i].name); in usage() 57 if (long_options[i].flag != NULL) in usage() 59 *long_options[i].flag); in usage() 62 long_options[i].val); in usage() 157 int i; in map_collect_record() local 168 for (i = 0; i < nr_cpus; i++) { in map_collect_record() 169 rec->cpu[i].processed = values[i].processed; in map_collect_record() 170 sum_processed += values[i].processed; in map_collect_record() [all …]
|
D | sampleip_user.c | 39 int i; in sampling_start() local 49 for (i = 0; i < nr_cpus; i++) { in sampling_start() 50 pmu_fd[i] = sys_perf_event_open(&pe_sample_attr, -1 /* pid */, i, in sampling_start() 52 if (pmu_fd[i] < 0) { in sampling_start() 56 assert(ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, in sampling_start() 58 assert(ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE, 0) == 0); in sampling_start() 66 int i; in sampling_end() local 68 for (i = 0; i < nr_cpus; i++) in sampling_end() 69 close(pmu_fd[i]); in sampling_end() 90 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 | 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 | tracex3_user.c | 85 int i; in print_hist() local 90 for (i = 0; i < nr_cpus; i++) in print_hist() 91 value += values[i]; in print_hist() 113 int i; in main() local 127 for (i = 1; i < ac; i++) { in main() 128 if (strcmp(argv[i], "-a") == 0) { in main() 130 } else if (strcmp(argv[i], "-t") == 0) { in main() 132 } else if (strcmp(argv[i], "-h") == 0) { in main() 153 for (i = 0; ; i++) { in main() 154 if (i % 20 == 0) in main()
|
D | xdpsock_user.c | 142 int i; in dump_stats() local 146 for (i = 0; i < num_socks && xsks[i]; i++) { in dump_stats() 150 rx_pps = (xsks[i]->rx_npkts - xsks[i]->prev_rx_npkts) * in dump_stats() 152 tx_pps = (xsks[i]->tx_npkts - xsks[i]->prev_tx_npkts) * in dump_stats() 155 printf("\n sock%d@", i); in dump_stats() 161 printf(fmt, "rx", rx_pps, xsks[i]->rx_npkts); in dump_stats() 162 printf(fmt, "tx", tx_pps, xsks[i]->tx_npkts); in dump_stats() 164 xsks[i]->prev_rx_npkts = xsks[i]->rx_npkts; in dump_stats() 165 xsks[i]->prev_tx_npkts = xsks[i]->tx_npkts; in dump_stats() 248 int i = 0; in hex_dump() local [all …]
|
D | syscall_tp_user.c | 52 int i, fd, map0_fds[num_progs], map1_fds[num_progs]; in test() local 54 for (i = 0; i < num_progs; i++) { in test() 59 printf("prog #%d: map ids %d %d\n", i, map_fd[0], map_fd[1]); in test() 60 map0_fds[i] = map_fd[0]; in test() 61 map1_fds[i] = map_fd[1]; in test() 78 for (i = 0; i < num_progs; i++) { in test() 79 verify_map(map0_fds[i]); in test() 80 verify_map(map1_fds[i]); in test()
|
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 | trace_event_user.c | 65 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, error = 0; in test_perf_event_all_cpu() local 147 for (i = 0; i < nr_cpus; i++) { in test_perf_event_all_cpu() 148 pmu_fd[i] = sys_perf_event_open(attr, -1, i, -1, 0); in test_perf_event_all_cpu() 149 if (pmu_fd[i] < 0) { in test_perf_event_all_cpu() 154 assert(ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[0]) == 0); in test_perf_event_all_cpu() [all …]
|
D | xdp_redirect_cpu_user.c | 118 int i; in usage() local 124 for (i = 0; long_options[i].name != 0; i++) { in usage() 125 printf(" --%-12s", long_options[i].name); in usage() 126 if (long_options[i].flag != NULL) in usage() 128 *long_options[i].flag); in usage() 131 long_options[i].val); in usage() 184 int i; in map_collect_percpu() local 195 for (i = 0; i < nr_cpus; i++) { in map_collect_percpu() 196 rec->cpu[i].processed = values[i].processed; in map_collect_percpu() 197 sum_processed += values[i].processed; in map_collect_percpu() [all …]
|
D | xdp_adjust_tail_user.c | 92 int i, prog_fd, map_fd, opt; in main() local 98 for (i = 0; i < strlen(optstr); i++) in main() 99 if (optstr[i] != 'h' && 'a' <= optstr[i] && optstr[i] <= 'z') in main() 100 opt_flags[(unsigned char)optstr[i]] = 1; in main() 129 for (i = 0; i < strlen(optstr); i++) { in main() 130 if (opt_flags[(unsigned int)optstr[i]]) { in main() 131 fprintf(stderr, "Missing argument -%c\n", optstr[i]); 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 …]
|
D | xdp_tx_iptunnel_user.c | 58 int i; in poll_stats() local 70 for (i = 0; i < nr_cpus; i++) in poll_stats() 71 sum += (values[i] - prev[proto][i]); in poll_stats() 170 int i, err; in main() local 175 for (i = 0; i < strlen(optstr); i++) in main() 176 if (optstr[i] != 'h' && 'a' <= optstr[i] && optstr[i] <= 'z') in main() 177 opt_flags[(unsigned char)optstr[i]] = 1; in main() 246 for (i = 0; i < strlen(optstr); i++) { in main() 247 if (opt_flags[(unsigned int)optstr[i]]) { in main() 248 fprintf(stderr, "Missing argument -%c\n", optstr[i]); in main()
|
D | test_lru_dist.c | 178 int i; in read_keys() local 189 for (i = 0; i < fst.st_size; i++) { in read_keys() 190 if (b[i] == '\n') in read_keys() 238 static void run_parallel(unsigned int tasks, void (*fn)(int i, void *data), in run_parallel() argument 243 int i; in run_parallel() local 245 for (i = 0; i < tasks; i++) { in run_parallel() 246 pid[i] = fork(); in run_parallel() 247 if (pid[i] == 0) { in run_parallel() 249 fn(i, data); in run_parallel() 251 } else if (pid[i] == -1) { in run_parallel() [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/pktgen/ |
D | pktgen_sample06_numa_awared_queue_irq_affinity.sh | 47 for ((i = 0; i < $THREADS; i++)); do 52 thread=${cpu_array[$((i+F_THREAD))]} 54 echo $thread > /proc/irq/${irq_array[$i]}/smp_affinity_list 55 … info "irq ${irq_array[$i]} is set affinity to `cat /proc/irq/${irq_array[$i]}/smp_affinity_list`" 62 queue_num=$i 103 for ((i = 0; i < $THREADS; i++)); do 104 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()
|