Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 284) sorted by relevance

12345678910>>...12

/tools/testing/selftests/bpf/progs/
Dtest_tunnel_kern.c49 struct bpf_tunnel_key key; in _gre_set_tunnel() local
51 __builtin_memset(&key, 0x0, sizeof(key)); in _gre_set_tunnel()
52 key.remote_ipv4 = 0xac100164; /* 172.16.1.100 */ in _gre_set_tunnel()
53 key.tunnel_id = 2; in _gre_set_tunnel()
54 key.tunnel_tos = 0; in _gre_set_tunnel()
55 key.tunnel_ttl = 64; in _gre_set_tunnel()
57 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in _gre_set_tunnel()
71 struct bpf_tunnel_key key; in _gre_get_tunnel() local
74 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); in _gre_get_tunnel()
80 bpf_trace_printk(fmt, sizeof(fmt), key.tunnel_id, key.remote_ipv4); in _gre_get_tunnel()
[all …]
Dbpf_iter_bpf_hash_map.c18 __type(key, struct key_t);
25 __type(key, __u64);
32 __type(key, struct key_t);
49 struct key_t *key = ctx->key; in dump_bpf_hash_map() local
64 if (key == (void *)0 || val == (void *)0) in dump_bpf_hash_map()
71 __builtin_memcpy(&tmp_key, key, sizeof(struct key_t)); in dump_bpf_hash_map()
79 key_sum_a += key->a; in dump_bpf_hash_map()
80 key_sum_b += key->b; in dump_bpf_hash_map()
81 key_sum_c += key->c; in dump_bpf_hash_map()
106 if (key == (void *)0 || val == (void *)0) { in dump_bpf_hash_map()
[all …]
Dtest_btf_map_in_map.c9 __type(key, int);
17 __type(key, int);
32 __type(key, int);
48 __type(key, int);
57 __type(key, int);
70 __type(key, int);
100 __type(key, int);
107 __type(key, int);
127 int key = 0, val; in handle__sys_enter() local
129 inner_map = bpf_map_lookup_elem(&outer_arr, &key); in handle__sys_enter()
[all …]
Dtest_tcpbpf_kern.c20 __type(key, __u32);
27 __type(key, __u32);
33 __u32 key = 0; in update_event_map() local
36 gp = bpf_map_lookup_elem(&global_map, &key); in update_event_map()
41 bpf_map_update_elem(&global_map, &key, &g, in update_event_map()
46 bpf_map_update_elem(&global_map, &key, &g, in update_event_map()
119 __u32 key = 0; in bpf_testcb() local
122 gp = bpf_map_lookup_elem(&global_map, &key); in bpf_testcb()
128 bpf_map_update_elem(&global_map, &key, &g, in bpf_testcb()
146 __u32 key = 1; in bpf_testcb() local
[all …]
Dbpf_iter_bpf_array_map.c18 __type(key, __u32);
28 __u32 *key = ctx->key; in dump_bpf_array_map() local
31 if (key == (void *)0 || val == (void *)0) in dump_bpf_array_map()
34 bpf_seq_write(ctx->meta->seq, key, sizeof(__u32)); in dump_bpf_array_map()
36 key_sum += *key; in dump_bpf_array_map()
38 *val = *key; in dump_bpf_array_map()
Dtest_stacktrace_map.c14 __type(key, __u32);
21 __type(key, __u32);
37 __type(key, __u32);
57 __u32 key = 0, val = 0, *value_p; in oncpu() local
60 value_p = bpf_map_lookup_elem(&control_map, &key); in oncpu()
65 key = bpf_get_stackid(ctx, &stackmap, 0); in oncpu()
66 if ((int)key >= 0) { in oncpu()
67 bpf_map_update_elem(&stackid_hmap, &key, &val, 0); in oncpu()
68 stack_p = bpf_map_lookup_elem(&stack_amap, &key); in oncpu()
Dtest_stacktrace_build_id.c14 __type(key, __u32);
21 __type(key, __u32);
38 __type(key, __u32);
55 __u32 key = 0, val = 0, *value_p; in oncpu() local
58 value_p = bpf_map_lookup_elem(&control_map, &key); in oncpu()
63 key = bpf_get_stackid(args, &stackmap, BPF_F_USER_STACK); in oncpu()
64 if ((int)key >= 0) { in oncpu()
65 bpf_map_update_elem(&stackid_hmap, &key, &val, 0); in oncpu()
66 stack_p = bpf_map_lookup_elem(&stack_amap, &key); in oncpu()
Dbpf_iter_bpf_percpu_hash_map.c18 __type(key, struct key_t);
32 struct key_t *key = ctx->key; in dump_bpf_percpu_hash_map() local
37 if (key == (void *)0 || pptr == (void *)0) in dump_bpf_percpu_hash_map()
40 key_sum_a += key->a; in dump_bpf_percpu_hash_map()
41 key_sum_b += key->b; in dump_bpf_percpu_hash_map()
42 key_sum_c += key->c; in dump_bpf_percpu_hash_map()
Dtest_sockmap_update.c9 __type(key, __u32);
16 __type(key, __u32);
23 __type(key, __u32);
32 __u32 key = 0; in copy_sock_map() local
34 sk = bpf_map_lookup_elem(&src, &key); in copy_sock_map()
38 if (bpf_map_update_elem(&dst_sock_map, &key, sk, 0)) in copy_sock_map()
41 if (bpf_map_update_elem(&dst_sock_hash, &key, sk, 0)) in copy_sock_map()
Dbpf_iter_sockmap.c14 __type(key, __u32);
21 __type(key, __u32);
28 __type(key, __u32);
39 __u32 tmp, *key = ctx->key; in copy() local
42 if (!key) in copy()
50 tmp = *key; in copy()
/tools/testing/selftests/bpf/
Dtest_lru_map.c42 static int bpf_map_lookup_elem_with_ref_bit(int fd, unsigned long long key, in bpf_map_lookup_elem_with_ref_bit() argument
50 BPF_LD_IMM64(BPF_REG_3, key), in bpf_map_lookup_elem_with_ref_bit()
161 unsigned long long key, value[nr_cpus]; in test_lru_sanity0() local
183 key = 1; in test_lru_sanity0()
184 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
185 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
189 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -1 in test_lru_sanity0()
193 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -1 && in test_lru_sanity0()
199 key = 2; in test_lru_sanity0()
200 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 && in test_lru_sanity0()
[all …]
Dtest_lpm_map.c34 uint8_t key[]; member
38 const uint8_t *key,
42 const uint8_t *key, in tlpm_add() argument
51 node = tlpm_match(list, key, n_bits); in tlpm_add()
53 memcpy(node->key, key, n); in tlpm_add()
64 memcpy(node->key, key, n); in tlpm_add()
82 const uint8_t *key, in tlpm_match() argument
96 if ((key[i / 8] & (1 << (7 - i % 8))) != in tlpm_match()
97 (list->key[i / 8] & (1 << (7 - i % 8)))) in tlpm_match()
111 const uint8_t *key, in tlpm_delete() argument
[all …]
Dtest_maps.c39 long long key, next_key, first_key, value; in test_hashmap() local
42 fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), in test_hashmap()
49 key = 1; in test_hashmap()
52 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap()
56 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == -1 && in test_hashmap()
61 assert(bpf_map_update_elem(fd, &key, &value, -1) == -1 && in test_hashmap()
65 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap()
67 key = 2; in test_hashmap()
69 assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == ENOENT); in test_hashmap()
72 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) == -1 && in test_hashmap()
[all …]
/tools/perf/arch/x86/util/
Dkvm-stat.c32 struct event_key *key) in mmio_event_get_key() argument
34 key->key = evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key()
35 key->info = evsel__intval(evsel, sample, "type"); in mmio_event_get_key()
43 struct perf_sample *sample, struct event_key *key) in mmio_event_begin() argument
52 mmio_event_get_key(evsel, sample, key); in mmio_event_begin()
60 struct event_key *key) in mmio_event_end() argument
69 mmio_event_get_key(evsel, sample, key); in mmio_event_end()
77 struct event_key *key, in mmio_event_decode_key() argument
81 (unsigned long)key->key, in mmio_event_decode_key()
82 key->info == KVM_TRACE_MMIO_WRITE ? "W" : "R"); in mmio_event_decode_key()
[all …]
/tools/perf/arch/s390/util/
Dkvm-stat.c29 struct event_key *key) in event_icpt_insn_get_key() argument
34 key->key = icpt_insn_decoder(insn); in event_icpt_insn_get_key()
35 key->exit_reasons = sie_icpt_insn_codes; in event_icpt_insn_get_key()
40 struct event_key *key) in event_sigp_get_key() argument
42 key->key = evsel__intval(evsel, sample, "order_code"); in event_sigp_get_key()
43 key->exit_reasons = sie_sigp_order_codes; in event_sigp_get_key()
48 struct event_key *key) in event_diag_get_key() argument
50 key->key = evsel__intval(evsel, sample, "code"); in event_diag_get_key()
51 key->exit_reasons = sie_diagnose_codes; in event_diag_get_key()
56 struct event_key *key) in event_icpt_prog_get_key() argument
[all …]
/tools/testing/selftests/bpf/prog_tests/
Dcg_storage_multi.c22 static bool assert_storage(struct bpf_map *map, const void *key, in assert_storage() argument
30 if (CHECK(bpf_map_lookup_elem(map_fd, key, &value) < 0, in assert_storage()
40 static bool assert_storage_noexist(struct bpf_map *map, const void *key) in assert_storage_noexist() argument
47 if (CHECK(bpf_map_lookup_elem(map_fd, key, &value) == 0, in assert_storage_noexist()
92 struct bpf_cgroup_storage_key key; in test_egress_only() local
96 key.attach_type = BPF_CGROUP_INET_EGRESS; in test_egress_only()
118 key.cgroup_inode_id = get_cgroup_id(PARENT_CGROUP); in test_egress_only()
121 &key, &expected_cgroup_value)) in test_egress_only()
123 key.cgroup_inode_id = get_cgroup_id(CHILD_CGROUP); in test_egress_only()
124 if (assert_storage_noexist(obj->maps.cgroup_storage, &key)) in test_egress_only()
[all …]
Dmap_init.c24 map_key_t key; in map_populate() local
29 for (key = 1; key <= num; key++) { in map_populate()
30 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in map_populate()
78 static int prog_run_insert_elem(struct test_map_init *skel, map_key_t key, in prog_run_insert_elem() argument
85 bss->inKey = key; in prog_run_insert_elem()
134 map_key_t key; in test_pcpu_map_init() local
142 key = 1; in test_pcpu_map_init()
143 err = bpf_map_delete_elem(map_fd, &key); in test_pcpu_map_init()
148 err = prog_run_insert_elem(skel, key, TEST_VALUE); in test_pcpu_map_init()
153 err = bpf_map_lookup_elem(map_fd, &key, value); in test_pcpu_map_init()
[all …]
Dbtf_map_in_map.c61 int err, key = 0, val, i, fd; in test_lookup_update() local
81 bpf_map_update_elem(outer_arr_fd, &key, &map1_fd, 0); in test_lookup_update()
82 bpf_map_update_elem(outer_hash_fd, &key, &map2_fd, 0); in test_lookup_update()
83 bpf_map_update_elem(outer_arr_dyn_fd, &key, &map3_fd, 0); in test_lookup_update()
86 bpf_map_lookup_elem(map1_fd, &key, &val); in test_lookup_update()
88 bpf_map_lookup_elem(map2_fd, &key, &val); in test_lookup_update()
90 bpf_map_lookup_elem(map3_fd, &key, &val); in test_lookup_update()
94 bpf_map_update_elem(outer_arr_fd, &key, &map2_fd, 0); in test_lookup_update()
95 bpf_map_update_elem(outer_hash_fd, &key, &map1_fd, 0); in test_lookup_update()
96 bpf_map_update_elem(outer_arr_dyn_fd, &key, &map4_fd, 0); in test_lookup_update()
[all …]
/tools/perf/ui/tui/
Dutil.c28 int key; in popup_menu__run() local
34 key = ui_browser__run(menu, 0); in popup_menu__run()
36 switch (key) { in popup_menu__run()
39 key = menu->index; in popup_menu__run()
45 key = -1; in popup_menu__run()
49 *keyp = key; in popup_menu__run()
50 key = menu->nr_entries; in popup_menu__run()
60 return key; in popup_menu__run()
78 int x, y, len, key; in ui_browser__input_window() local
132 key = ui__getch(delay_secs); in ui_browser__input_window()
[all …]
/tools/bootconfig/samples/
Dgood-simple.bconf3 key.word1 = 1
4 key.word2=2
5 key.word3 = 3;
7 key {
10 key { word5 = 5; word6 = 6 }
/tools/lib/bpf/
Dhashmap.c118 h = hash_bits(map->hash_fn(cur->key, map->ctx), new_cap_bits); in hashmap_grow()
131 const void *key, size_t hash, in hashmap_find_entry() argument
143 if (map->equal_fn(cur->key, key, map->ctx)) { in hashmap_find_entry()
154 int hashmap__insert(struct hashmap *map, const void *key, void *value, in hashmap__insert() argument
167 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert()
169 hashmap_find_entry(map, key, h, NULL, &entry)) { in hashmap__insert()
171 *old_key = entry->key; in hashmap__insert()
176 entry->key = key; in hashmap__insert()
191 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert()
198 entry->key = key; in hashmap__insert()
[all …]
Dhashmap.h43 typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx);
47 const void *key; member
112 int hashmap__insert(struct hashmap *map, const void *key, void *value,
117 const void *key, void *value) in hashmap__add() argument
119 return hashmap__insert(map, key, value, HASHMAP_ADD, NULL, NULL); in hashmap__add()
123 const void *key, void *value, in hashmap__set() argument
126 return hashmap__insert(map, key, value, HASHMAP_SET, in hashmap__set()
131 const void *key, void *value, in hashmap__update() argument
134 return hashmap__insert(map, key, value, HASHMAP_UPDATE, in hashmap__update()
139 const void *key, void *value) in hashmap__append() argument
[all …]
/tools/perf/util/
Dhashmap.c118 h = hash_bits(map->hash_fn(cur->key, map->ctx), new_cap_bits); in hashmap_grow()
131 const void *key, size_t hash, in hashmap_find_entry() argument
143 if (map->equal_fn(cur->key, key, map->ctx)) { in hashmap_find_entry()
154 int hashmap__insert(struct hashmap *map, const void *key, void *value, in hashmap__insert() argument
167 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert()
169 hashmap_find_entry(map, key, h, NULL, &entry)) { in hashmap__insert()
171 *old_key = entry->key; in hashmap__insert()
176 entry->key = key; in hashmap__insert()
191 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert()
198 entry->key = key; in hashmap__insert()
[all …]
Dhashmap.h43 typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx);
47 const void *key; member
112 int hashmap__insert(struct hashmap *map, const void *key, void *value,
117 const void *key, void *value) in hashmap__add() argument
119 return hashmap__insert(map, key, value, HASHMAP_ADD, NULL, NULL); in hashmap__add()
123 const void *key, void *value, in hashmap__set() argument
126 return hashmap__insert(map, key, value, HASHMAP_SET, in hashmap__set()
131 const void *key, void *value, in hashmap__update() argument
134 return hashmap__insert(map, key, value, HASHMAP_UPDATE, in hashmap__update()
139 const void *key, void *value) in hashmap__append() argument
[all …]
Dkvm-stat.h17 u64 key; member
31 struct event_key key; member
44 key_cmp_fun key; member
52 struct event_key *key);
59 struct event_key *key);
61 struct perf_sample *sample, struct event_key *key);
63 void (*decode_key)(struct perf_kvm_stat *kvm, struct event_key *key,
116 struct event_key *key);
119 struct event_key *key);
122 struct event_key *key);
[all …]

12345678910>>...12