/tools/testing/selftests/bpf/progs/ |
D | test_tunnel_kern.c | 49 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 …]
|
D | test_attach_probe.c | 11 __type(key, int); 18 const int key = 0, value = 1; in handle_sys_nanosleep_entry() local 20 bpf_map_update_elem(&results_map, &key, &value, 0); in handle_sys_nanosleep_entry() 27 const int key = 1, value = 2; in handle_sys_getpid_return() local 29 bpf_map_update_elem(&results_map, &key, &value, 0); in handle_sys_getpid_return() 36 const int key = 2, value = 3; in handle_uprobe_entry() local 38 bpf_map_update_elem(&results_map, &key, &value, 0); in handle_uprobe_entry() 45 const int key = 3, value = 4; in handle_uprobe_return() local 47 bpf_map_update_elem(&results_map, &key, &value, 0); in handle_uprobe_return()
|
D | test_tcpbpf_kern.c | 20 __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() 78 __u32 key = 0; in bpf_testcb() local 81 gp = bpf_map_lookup_elem(&global_map, &key); in bpf_testcb() 87 bpf_map_update_elem(&global_map, &key, &g, in bpf_testcb() 105 __u32 key = 1; in bpf_testcb() local [all …]
|
D | test_stacktrace_build_id.c | 14 __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()
|
D | test_stacktrace_map.c | 14 __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()
|
D | test_map_in_map.c | 31 int key = 0; in xdp_mimtest0() local 34 map = bpf_map_lookup_elem(&mim_array, &key); in xdp_mimtest0() 38 bpf_map_update_elem(map, &key, &value, 0); in xdp_mimtest0() 39 value_p = bpf_map_lookup_elem(map, &key); in xdp_mimtest0() 43 map = bpf_map_lookup_elem(&mim_hash, &key); in xdp_mimtest0() 47 bpf_map_update_elem(map, &key, &value, 0); in xdp_mimtest0()
|
D | get_cgroup_id_kern.c | 10 __type(key, __u32); 17 __type(key, __u32); 25 __u32 key = 0, *expected_pid; in trace() local 28 expected_pid = bpf_map_lookup_elem(&pidmap, &key); in trace() 32 val = bpf_map_lookup_elem(&cg_ids, &key); in trace()
|
D | test_spin_lock.c | 16 __type(key, int); 27 __type(key, struct bpf_cgroup_storage_key); 42 __type(key, int); 56 int key = 0; in bpf_sping_lock_test() local 59 val = bpf_map_lookup_elem(&hmap, &key); in bpf_sping_lock_test() 61 bpf_map_update_elem(&hmap, &key, &zero, 0); in bpf_sping_lock_test() 62 val = bpf_map_lookup_elem(&hmap, &key); in bpf_sping_lock_test() 79 q = bpf_map_lookup_elem(&vqueue, &key); in bpf_sping_lock_test()
|
D | test_send_signal_kern.c | 10 __type(key, __u32); 17 __type(key, __u32); 25 __u32 key = 0, pid, sig; in bpf_send_signal_test() local 28 status_val = bpf_map_lookup_elem(&status_map, &key); in bpf_send_signal_test() 32 info_val = bpf_map_lookup_elem(&info_map, &key); in bpf_send_signal_test()
|
D | test_map_lock.c | 17 __type(key, __u32); 29 __type(key, int); 38 int key = 0, err = 1, i; in bpf_map_lock_test() local 41 val = bpf_map_lookup_elem(&hash_map, &key); in bpf_map_lock_test() 51 q = bpf_map_lookup_elem(&array_map, &key); in bpf_map_lock_test()
|
/tools/testing/selftests/bpf/ |
D | test_lru_map.c | 42 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 …]
|
D | test_lpm_map.c | 34 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 …]
|
D | test_maps.c | 39 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 …]
|
D | test_cgroup_storage.c | 41 struct bpf_cgroup_storage_key key; in main() local 53 map_fd = bpf_create_map(BPF_MAP_TYPE_CGROUP_STORAGE, sizeof(key), in main() 61 sizeof(key), sizeof(value), 0, 0); in main() 100 if (bpf_map_get_next_key(map_fd, NULL, &key)) { in main() 105 if (bpf_map_lookup_elem(map_fd, &key, &value)) { in main() 113 if (bpf_map_update_elem(percpu_map_fd, &key, percpu_value, 0)) { in main() 124 if (bpf_map_lookup_elem(map_fd, &key, &value)) { in main() 136 if (bpf_map_update_elem(map_fd, &key, &value, 0)) { in main() 147 if (bpf_map_lookup_elem(map_fd, &key, &value)) { in main() 162 if (bpf_map_lookup_elem(percpu_map_fd, &key, percpu_value)) { in main()
|
/tools/perf/arch/x86/util/ |
D | kvm-stat.c | 32 struct event_key *key) in mmio_event_get_key() argument 34 key->key = perf_evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key() 35 key->info = perf_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/ |
D | kvm-stat.c | 29 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 = perf_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 = perf_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/perf/ui/tui/ |
D | util.c | 28 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() 55 return key; in popup_menu__run() 74 int x, y, len, key; in ui_browser__input_window() local 128 key = ui__getch(delay_secs); in ui_browser__input_window() 129 while (key != K_TIMER && key != K_ENTER && key != K_ESC) { in ui_browser__input_window() 132 if (key == K_BKSPC) { in ui_browser__input_window() [all …]
|
/tools/lib/bpf/ |
D | hashmap.c | 113 h = hash_bits(map->hash_fn(cur->key, map->ctx), new_cap_bits); in hashmap_grow() 126 const void *key, size_t hash, in hashmap_find_entry() argument 138 if (map->equal_fn(cur->key, key, map->ctx)) { in hashmap_find_entry() 149 int hashmap__insert(struct hashmap *map, const void *key, void *value, in hashmap__insert() argument 162 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert() 164 hashmap_find_entry(map, key, h, NULL, &entry)) { in hashmap__insert() 166 *old_key = entry->key; in hashmap__insert() 171 entry->key = key; in hashmap__insert() 186 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert() 193 entry->key = key; in hashmap__insert() [all …]
|
D | hashmap.h | 26 typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx); 30 const void *key; member 95 int hashmap__insert(struct hashmap *map, const void *key, void *value, 100 const void *key, void *value) in hashmap__add() argument 102 return hashmap__insert(map, key, value, HASHMAP_ADD, NULL, NULL); in hashmap__add() 106 const void *key, void *value, in hashmap__set() argument 109 return hashmap__insert(map, key, value, HASHMAP_SET, in hashmap__set() 114 const void *key, void *value, in hashmap__update() argument 117 return hashmap__insert(map, key, value, HASHMAP_UPDATE, in hashmap__update() 122 const void *key, void *value) in hashmap__append() argument [all …]
|
/tools/bpf/bpftool/ |
D | map.c | 150 struct bpf_map_info *map_info, void *key, in do_dump_btf() argument 161 ret = btf_dumper_type(d, map_info->btf_key_type_id, key); in do_dump_btf() 207 static void print_entry_json(struct bpf_map_info *info, unsigned char *key, in print_entry_json() argument 214 print_hex_data_json(key, info->key_size); in print_entry_json() 225 do_dump_btf(&d, info, key, value); in print_entry_json() 234 print_hex_data_json(key, info->key_size); in print_entry_json() 258 do_dump_btf(&d, info, key, value); in print_entry_json() 265 static void print_entry_error(struct bpf_map_info *info, unsigned char *key, in print_entry_error() argument 275 fprint_hex(stdout, key, info->key_size, " "); in print_entry_error() 284 static void print_entry_plain(struct bpf_map_info *info, unsigned char *key, in print_entry_plain() argument [all …]
|
/tools/perf/util/ |
D | kvm-stat.h | 17 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 …]
|
D | bpf_map.c | 31 void *prev_key = NULL, *key, *value; in bpf_map__fprintf() local 42 key = malloc(def->key_size); in bpf_map__fprintf() 43 if (key == NULL) in bpf_map__fprintf() 50 while ((err = bpf_map_get_next_key(fd, prev_key, key) == 0)) { in bpf_map__fprintf() 51 int intkey = *(int *)key; in bpf_map__fprintf() 53 if (!bpf_map_lookup_elem(fd, key, value)) { in bpf_map__fprintf() 61 prev_key = key; in bpf_map__fprintf() 69 free(key); in bpf_map__fprintf()
|
/tools/lib/lockdep/include/liblockdep/ |
D | mutex.h | 10 struct lock_class_key key; member 24 struct lock_class_key *key, in __mutex_init() argument 27 lockdep_init_map(&lock->dep_map, name, key, 0); in __mutex_init() 33 lockdep_register_key(&(mutex)->key); \ 34 __mutex_init((mutex), #mutex, &(mutex)->key, (mutexattr)); \ 58 lockdep_unregister_key(&lock->key); in liblockdep_pthread_mutex_destroy()
|
D | common.h | 31 struct lock_class_key *key; member 41 struct lock_class_key *key, int subclass); 48 void lockdep_register_key(struct lock_class_key *key); 49 void lockdep_unregister_key(struct lock_class_key *key); 53 { .name = (_name), .key = (void *)(_key), }
|
/tools/perf/arch/powerpc/util/ |
D | kvm-stat.c | 39 struct event_key *key) in hcall_event_get_key() argument 41 key->info = 0; in hcall_event_get_key() 42 key->key = perf_evsel__intval(evsel, sample, "req"); in hcall_event_get_key() 62 struct event_key *key __maybe_unused) in hcall_event_end() 68 struct perf_sample *sample, struct event_key *key) in hcall_event_begin() argument 71 hcall_event_get_key(evsel, sample, key); in hcall_event_begin() 78 struct event_key *key, in hcall_event_decode_key() argument 81 const char *hcall_reason = get_hcall_exit_reason(key->key); in hcall_event_decode_key()
|