| /samples/bpf/ |
| A D | map_perf_test.bpf.c | 19 __type(key, u32); 26 __type(key, u32); 33 __type(key, u32); 41 __type(key, u32); 184 u32 key; in BPF_KSYSCALL() member 190 u32 key = 0; in BPF_KSYSCALL() local 230 key = test_params.key; in BPF_KSYSCALL() 235 key++; in BPF_KSYSCALL() 254 } key; in BPF_KSYSCALL() local 260 key.b8[6] = 0; in BPF_KSYSCALL() [all …]
|
| A D | cpustat_kern.c | 56 __type(key, u32); 64 __type(key, u32); 72 __type(key, u32); 107 u32 key, cpu, pstate_idx; in bpf_prog1() local 116 cts = bpf_map_lookup_elem(&my_map, &key); in bpf_prog1() 120 key = cpu * MAP_OFF_NUM + MAP_OFF_CSTATE_IDX; in bpf_prog1() 121 cstate = bpf_map_lookup_elem(&my_map, &key); in bpf_prog1() 126 pts = bpf_map_lookup_elem(&my_map, &key); in bpf_prog1() 131 pstate = bpf_map_lookup_elem(&my_map, &key); in bpf_prog1() 215 u32 key, cpu, pstate_idx; in bpf_prog2() local [all …]
|
| A D | tracex3_user.c | 21 __u32 key; in clear_stats() local 24 for (key = 0; key < SLOTS; key++) in clear_stats() 25 bpf_map_update_elem(fd, &key, values, BPF_ANY); in clear_stats() 82 __u32 key; in print_hist() local 85 for (key = 0; key < SLOTS; key++) { in print_hist() 86 bpf_map_lookup_elem(fd, &key, values); in print_hist() 90 cnt[key] = value; in print_hist() 96 for (key = full_range ? 0 : 29; key < SLOTS; key++) { in print_hist() 97 int c = num_colors * cnt[key] / (max_cnt + 1); in print_hist()
|
| A D | tracex6.bpf.c | 16 __type(key, int); 23 __type(key, int); 31 u32 key = bpf_get_smp_processor_id(); in bpf_prog1() local 35 count = bpf_perf_event_read(&counters, key); in bpf_prog1() 40 val = bpf_map_lookup_elem(&values, &key); in bpf_prog1() 44 bpf_map_update_elem(&values, &key, &count, BPF_NOEXIST); in bpf_prog1() 58 u32 key = bpf_get_smp_processor_id(); in BPF_KPROBE() local 67 error = bpf_perf_event_read_value(&counters, key, &buf, sizeof(buf)); in BPF_KPROBE() 71 val = bpf_map_lookup_elem(&values2, &key); in BPF_KPROBE() 75 bpf_map_update_elem(&values2, &key, &buf, BPF_NOEXIST); in BPF_KPROBE()
|
| A D | trace_event_kern.c | 22 __type(key, struct key_t); 46 struct key_t key; in bpf_prog1() local 53 bpf_get_current_comm(&key.comm, sizeof(key.comm)); in bpf_prog1() 54 key.kernstack = bpf_get_stackid(ctx, &stackmap, KERN_STACKID_FLAGS); in bpf_prog1() 55 key.userstack = bpf_get_stackid(ctx, &stackmap, USER_STACKID_FLAGS); in bpf_prog1() 56 if ((int)key.kernstack < 0 && (int)key.userstack < 0) { in bpf_prog1() 71 val = bpf_map_lookup_elem(&counts, &key); in bpf_prog1() 75 bpf_map_update_elem(&counts, &key, &one, BPF_NOEXIST); in bpf_prog1()
|
| A D | offwaketime.bpf.c | 29 __type(key, struct key_t); 36 __type(key, u32); 48 __type(key, u32); 80 struct key_t key; in update_counts() local 82 __builtin_memset(&key.waker, 0, sizeof(key.waker)); in update_counts() 83 bpf_get_current_comm(&key.target, sizeof(key.target)); in update_counts() 85 key.wret = 0; in update_counts() 89 key.wret = woke->ret; in update_counts() 90 __builtin_memcpy(&key.waker, woke->name, sizeof(key.waker)); in update_counts() 94 val = bpf_map_lookup_elem(&counts, &key); in update_counts() [all …]
|
| A D | offwaketime_user.c | 47 static void print_stack(struct key_t *key, __u64 count) in print_stack() argument 53 printf("%s;", key->target); in print_stack() 54 if (bpf_map_lookup_elem(map_fd[1], &key->tret, ip) != 0) { in print_stack() 61 if (bpf_map_lookup_elem(map_fd[1], &key->wret, ip) != 0) { in print_stack() 67 printf(";%s %lld\n", key->waker, count); in print_stack() 69 if ((key->tret == -EEXIST || key->wret == -EEXIST) && !warned) { in print_stack() 72 } else if (((int)(key->tret) < 0 || (int)(key->wret) < 0)) { in print_stack() 73 printf("err stackid %d %d\n", key->tret, key->wret); in print_stack() 79 struct key_t key = {}, next_key; in print_stacks() local 82 while (bpf_map_get_next_key(fd, &key, &next_key) == 0) { in print_stacks() [all …]
|
| A D | test_lru_dist.c | 85 unsigned long long key; member 150 node->key = key; in pfect_lru_lookup_or_insert() 289 key, errno); in do_test_lru_dist() 354 for (key = 1; key <= 1000; key++) { in test_lru_loss0() 368 for (key = 1; key <= 1000; key++) { in test_lru_loss0() 370 if (key <= 100) in test_lru_loss0() 372 else if (key <= 900) in test_lru_loss0() 406 for (key = 1; key <= 1000; key++) in test_lru_loss1() 409 for (key = 1; key <= 1000; key++) { in test_lru_loss1() 455 key = stable_base; in do_test_parallel_lru_loss() [all …]
|
| A D | sockex1_user.c | 46 int key; in main() local 48 key = IPPROTO_TCP; in main() 49 assert(bpf_map_lookup_elem(map_fd, &key, &tcp_cnt) == 0); in main() 51 key = IPPROTO_UDP; in main() 52 assert(bpf_map_lookup_elem(map_fd, &key, &udp_cnt) == 0); in main() 54 key = IPPROTO_ICMP; in main() 55 assert(bpf_map_lookup_elem(map_fd, &key, &icmp_cnt) == 0); in main()
|
| A D | spintest_user.c | 14 long key, next_key, value; in main() local 56 key = 0; in main() 58 while (bpf_map_get_next_key(map_fd, &key, &next_key) == 0) { in main() 62 key = next_key; in main() 70 if (key) in main() 72 key = 0; in main() 73 while (bpf_map_get_next_key(map_fd, &key, &next_key) == 0) in main()
|
| A D | sock_example.c | 38 int sock = -1, map_fd, prog_fd, i, key; in test_sock() local 41 map_fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, NULL, sizeof(key), sizeof(value), in test_sock() 84 key = IPPROTO_TCP; in test_sock() 85 assert(bpf_map_lookup_elem(map_fd, &key, &tcp_cnt) == 0); in test_sock() 87 key = IPPROTO_UDP; in test_sock() 88 assert(bpf_map_lookup_elem(map_fd, &key, &udp_cnt) == 0); in test_sock() 90 key = IPPROTO_ICMP; in test_sock() 91 assert(bpf_map_lookup_elem(map_fd, &key, &icmp_cnt) == 0); in test_sock()
|
| A D | lwt_len_hist.bpf.c | 18 __type(key, u64); 49 __u64 *value, key, init_val = 1; in do_len_hist() local 51 key = log2l(skb->len); in do_len_hist() 53 value = bpf_map_lookup_elem(&lwt_len_hist_map, &key); in do_len_hist() 57 bpf_map_update_elem(&lwt_len_hist_map, &key, &init_val, BPF_ANY); in do_len_hist()
|
| A D | ibumad_user.c | 36 __u32 key; in dump_counts() local 39 for (key = 0; key < 256; key++) { in dump_counts() 40 if (bpf_map_lookup_elem(fd, &key, &value)) { in dump_counts() 41 printf("failed to read key %u\n", key); in dump_counts() 45 printf("0x%02x : %llu\n", key, value); in dump_counts()
|
| A D | tracex3.bpf.c | 20 __type(key, long); 30 struct start_key key = { in bpf_prog1() local 35 bpf_map_update_elem(&my_map, &key, &val, BPF_ANY); in bpf_prog1() 61 struct start_key key = { in bpf_prog2() local 69 value = bpf_map_lookup_elem(&my_map, &key); in bpf_prog2() 76 bpf_map_delete_elem(&my_map, &key); in bpf_prog2()
|
| A D | syscall_tp_kern.c | 34 __type(key, u32); 41 __type(key, u32); 48 u32 key = 0; in count() local 51 value = bpf_map_lookup_elem(map, &key); in count() 55 bpf_map_update_elem(map, &key, &init_val, BPF_NOEXIST); in count()
|
| A D | map_perf_test_user.c | 97 uint32_t key; in pre_test_lru_hash_lookup() local 111 for (key = 0; key < lru_hash_lookup_test_entries; key++) { in pre_test_lru_hash_lookup() 378 key = alloca(sizeof(*key) + 4); in fill_lpm_trie() 379 key->prefixlen = 32; in fill_lpm_trie() 382 key->prefixlen = rand() % 33; in fill_lpm_trie() 388 key, &value, 0); in fill_lpm_trie() 392 key->prefixlen = 32; in fill_lpm_trie() 393 key->data[0] = 192; in fill_lpm_trie() 394 key->data[1] = 168; in fill_lpm_trie() 395 key->data[2] = 0; in fill_lpm_trie() [all …]
|
| A D | tracex4_user.c | 31 __u64 key, next_key; in print_old_objects() local 34 key = write(1, "\e[1;1H\e[2J", 11); /* clear screen */ in print_old_objects() 36 key = -1; in print_old_objects() 37 while (bpf_map_get_next_key(fd, &key, &next_key) == 0) { in print_old_objects() 39 key = next_key; in print_old_objects()
|
| A D | lathist_kern.c | 23 __type(key, int); 66 __type(key, int); 75 int key, cpu; in bpf_prog2() local 89 key = cpu * MAX_ENTRIES + delta; in bpf_prog2() 90 val = bpf_map_lookup_elem(&my_lat, &key); in bpf_prog2()
|
| A D | trace_event_user.c | 61 static void print_stack(struct key_t *key, __u64 count) in print_stack() argument 67 printf("%3lld %s;", count, key->comm); in print_stack() 68 if (bpf_map_lookup_elem(map_fd[1], &key->kernstack, ip) != 0) { in print_stack() 75 if (bpf_map_lookup_elem(map_fd[1], &key->userstack, ip) != 0) { in print_stack() 86 if (key->kernstack == -EEXIST && !warned) { in print_stack() 89 } else if ((int)key->kernstack < 0 && (int)key->userstack < 0) { in print_stack() 90 printf("err stackid %d %d\n", key->kernstack, key->userstack); in print_stack() 102 struct key_t key = {}, next_key; in print_stacks() local 108 while (bpf_map_get_next_key(fd, &key, &next_key) == 0) { in print_stacks() 112 key = next_key; in print_stacks()
|
| A D | fds_example.c | 77 static int bpf_do_map(const char *file, uint32_t flags, uint32_t key, in bpf_do_map() argument 98 ret = bpf_map_update_elem(fd, &key, &value, 0); in bpf_do_map() 99 printf("bpf: fd:%d u->(%u:%u) ret:(%d,%s)\n", fd, key, value, in bpf_do_map() 103 ret = bpf_map_lookup_elem(fd, &key, &value); in bpf_do_map() 104 printf("bpf: fd:%d l->(%u):%u ret:(%d,%s)\n", fd, key, value, in bpf_do_map() 144 uint32_t key = 0, value = 0, flags = 0; in main() local 164 key = strtoul(optarg, NULL, 0); in main() 188 return bpf_do_map(file, flags, key, value); in main()
|
| A D | sockex2_user.c | 49 int key = 0, next_key; in main() local 52 while (bpf_map_get_next_key(map_fd, &key, &next_key) == 0) { in main() 57 key = next_key; in main()
|
| A D | xdp_sample.bpf.c | 19 __type(key, u64); 69 u32 key = XDP_REDIRECT_ERROR; in xdp_redirect_collect_stat() local 76 key = xdp_get_err_key(err); in xdp_redirect_collect_stat() 78 idx = key * nr_cpus + cpu; in xdp_redirect_collect_stat() 82 if (key) in xdp_redirect_collect_stat() 186 u32 key = act, idx; in BPF_PROG() local 193 if (key > XDP_REDIRECT) in BPF_PROG() 194 key = XDP_REDIRECT + 1; in BPF_PROG() 196 idx = key * nr_cpus + cpu; in BPF_PROG()
|
| A D | lwt_len_hist_user.c | 34 uint64_t key = 0, next_key, max_key = 0; in main() local 45 while (bpf_map_get_next_key(map_fd, &key, &next_key) == 0) { in main() 64 key = next_key; in main()
|
| A D | tracex5_user.c | 40 int key, fd, progs_fd; in main() local 80 if (sscanf(section, "kprobe/%d", &key) != 1) in main() 84 bpf_map_update_elem(progs_fd, &key, &fd, BPF_ANY); in main()
|
| /samples/vfs/ |
| A D | test-fsmount.c | 83 const char *key, const void *val, int aux) in fsconfig() argument 85 return syscall(__NR_fsconfig, fsfd, cmd, key, val, aux); in fsconfig() 97 #define E_fsconfig(fd, cmd, key, val, aux) \ argument 99 if (fsconfig(fd, cmd, key, val, aux) == -1) \ 100 mount_error(fd, key ?: "create"); \
|