/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 | bpf_iter_bpf_hash_map.c | 17 __type(key, struct key_t); 24 __type(key, __u64); 31 __type(key, struct key_t); 48 struct key_t *key = ctx->key; in dump_bpf_hash_map() local 63 if (key == (void *)0 || val == (void *)0) in dump_bpf_hash_map() 70 __builtin_memcpy(&tmp_key, key, sizeof(struct key_t)); in dump_bpf_hash_map() 78 key_sum_a += key->a; in dump_bpf_hash_map() 79 key_sum_b += key->b; in dump_bpf_hash_map() 80 key_sum_c += key->c; in dump_bpf_hash_map() 105 if (key == (void *)0 || val == (void *)0) { in dump_bpf_hash_map() [all …]
|
D | timer.c | 19 __type(key, int); 27 __type(key, int); 38 __type(key, int); 45 __type(key, int); 61 static int timer_cb1(void *map, int *key, struct bpf_timer *timer) in timer_cb1() argument 71 if (*key == ARRAY) { in timer_cb1() 85 } else if (*key == LRU) { in timer_cb1() 110 if (*key != LRU) in timer_cb1() 156 static int timer_cb2(void *map, int *key, struct hmap_elem *val) in timer_cb2() argument 158 if (*key == HTAB) in timer_cb2() [all …]
|
D | test_btf_map_in_map.c | 9 __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 …]
|
D | lsm.c | 15 __type(key, __u32); 22 __type(key, __u32); 29 __type(key, __u32); 36 __type(key, __u32); 43 __type(key, __u32); 50 __type(key, __u32); 57 __type(key, int); 113 __u32 key = 0; in BPF_PROG() local 122 value = bpf_map_lookup_elem(&array, &key); in BPF_PROG() 125 value = bpf_map_lookup_elem(&hash, &key); in BPF_PROG() [all …]
|
D | linked_maps2.c | 14 __type(key, key_type); 21 __type(key, int); 29 __type(key, int); 42 int key = 2, val = 2; in BPF_PROG() local 47 bpf_map_update_elem(&map2, &key, &val, 0); in BPF_PROG() 48 bpf_map_update_elem(&map_weak, &key, &val, 0); in BPF_PROG() 57 int key = 1, *val; in BPF_PROG() local 65 val = bpf_map_lookup_elem(&map2, &key); in BPF_PROG() 69 val = bpf_map_lookup_elem(&map_weak, &key); in BPF_PROG()
|
D | linked_maps1.c | 13 __type(key, struct my_key); 23 __type(key, int); 35 __type(key, int); 48 int key = 1, val = 1; in BPF_PROG() local 53 bpf_map_update_elem(&map2, &key, &val, 0); in BPF_PROG() 54 bpf_map_update_elem(&map_weak, &key, &val, 0); in BPF_PROG() 63 int key = 2, *val; in BPF_PROG() local 71 val = bpf_map_lookup_elem(&map2, &key); in BPF_PROG() 75 val = bpf_map_lookup_elem(&map_weak, &key); in BPF_PROG()
|
D | test_hash_large_key.c | 11 __type(key, struct bigelement); 18 __type(key, __u32); 32 struct bigelement *key; in bpf_hash_large_key_test() local 34 key = bpf_map_lookup_elem(&key_map, &zero); in bpf_hash_large_key_test() 35 if (!key) in bpf_hash_large_key_test() 38 key->c = 1; in bpf_hash_large_key_test() 39 if (bpf_map_update_elem(&hash_map, key, &value, BPF_ANY)) in bpf_hash_large_key_test()
|
D | bpf_iter_bpf_array_map.c | 18 __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()
|
D | test_stacktrace_build_id.c | 14 __type(key, __u32); 21 __type(key, __u32); 38 __type(key, __u32); 47 __u32 key = 0, val = 0, *value_p; in oncpu() local 50 value_p = bpf_map_lookup_elem(&control_map, &key); in oncpu() 55 key = bpf_get_stackid(args, &stackmap, BPF_F_USER_STACK); in oncpu() 56 if ((int)key >= 0) { in oncpu() 57 bpf_map_update_elem(&stackid_hmap, &key, &val, 0); in oncpu() 58 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 | bpf_iter_bpf_percpu_hash_map.c | 18 __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()
|
/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) < 0 && in test_hashmap() 61 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 && in test_hashmap() 65 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() 67 key = 2; in test_hashmap() 70 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 73 assert(bpf_map_lookup_and_delete_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() [all …]
|
/tools/perf/arch/x86/util/ |
D | kvm-stat.c | 32 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/testing/selftests/bpf/prog_tests/ |
D | lookup_and_delete.c | 15 __u64 key, value = START_VALUE; in fill_values() local 18 for (key = 1; key < MAX_ENTRIES + 1; key++) { in fill_values() 19 err = bpf_map_update_elem(map_fd, &key, &value, BPF_NOEXIST); in fill_values() 29 __u64 key, value[nr_cpus]; in fill_values_percpu() local 35 for (key = 1; key < MAX_ENTRIES + 1; key++) { in fill_values_percpu() 36 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in fill_values_percpu() 78 static int trigger_tp(struct test_lookup_and_delete *skel, __u64 key, in trigger_tp() argument 84 skel->bss->set_key = key; in trigger_tp() 101 __u64 key, value; in test_lookup_and_delete_hash() local 114 key = 1; in test_lookup_and_delete_hash() [all …]
|
D | cg_storage_multi.c | 22 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() 117 key.cgroup_inode_id = get_cgroup_id(PARENT_CGROUP); in test_egress_only() 120 &key, &expected_cgroup_value)) in test_egress_only() 122 key.cgroup_inode_id = get_cgroup_id(CHILD_CGROUP); in test_egress_only() 123 if (assert_storage_noexist(obj->maps.cgroup_storage, &key)) in test_egress_only() [all …]
|
D | btf_map_in_map.c | 28 int err, key = 0, val, i, fd; in test_lookup_update() local 48 bpf_map_update_elem(outer_arr_fd, &key, &map1_fd, 0); in test_lookup_update() 49 bpf_map_update_elem(outer_hash_fd, &key, &map2_fd, 0); in test_lookup_update() 50 bpf_map_update_elem(outer_arr_dyn_fd, &key, &map3_fd, 0); in test_lookup_update() 53 bpf_map_lookup_elem(map1_fd, &key, &val); in test_lookup_update() 55 bpf_map_lookup_elem(map2_fd, &key, &val); in test_lookup_update() 57 bpf_map_lookup_elem(map3_fd, &key, &val); in test_lookup_update() 61 bpf_map_update_elem(outer_arr_fd, &key, &map2_fd, 0); in test_lookup_update() 62 bpf_map_update_elem(outer_hash_fd, &key, &map1_fd, 0); in test_lookup_update() 63 bpf_map_update_elem(outer_arr_dyn_fd, &key, &map4_fd, 0); in test_lookup_update() [all …]
|
D | map_init.c | 24 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 …]
|
/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 = 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/perf/arch/arm64/util/ |
D | kvm-stat.c | 27 struct event_key *key) in event_get_key() argument 29 key->info = 0; in event_get_key() 30 key->key = evsel__intval(evsel, sample, kvm_exit_reason); in event_get_key() 31 key->exit_reasons = arm64_exit_reasons; in event_get_key() 38 if (key->key == ARM_EXCEPTION_TRAP) { in event_get_key() 39 key->key = evsel__intval(evsel, sample, kvm_trap_exit_reason); in event_get_key() 40 key->exit_reasons = arm64_trap_exit_reasons; in event_get_key() 46 struct event_key *key __maybe_unused) in event_begin() 53 struct event_key *key) in event_end() argument 56 event_get_key(evsel, sample, key); in event_end()
|
/tools/testing/selftests/drivers/net/netdevsim/ |
D | ethtool-coalesce.sh | 14 for key in ${!SETTINGS_MAP[@]}; do 15 CURRENT_SETTINGS[$key]=$(get_value $key) 99 for key in ${!SETTINGS_MAP[@]}; do 100 EXPECTED_SETTINGS[$key]=$(get_value $key) 104 for key in ${!SETTINGS_MAP[@]}; do 107 ethtool -C $NSIM_NETDEV "$key" "$value" 109 EXPECTED_SETTINGS[$key]="$value"
|
D | ethtool-ring.sh | 15 for key in ${!SETTINGS_MAP[@]}; do 16 CURRENT_SETTINGS[$key]=$(get_value $key) 61 for key in ${!SETTINGS_MAP[@]}; do 62 EXPECTED_SETTINGS[$key]=$(get_value $key) 66 for key in ${!SETTINGS_MAP[@]}; do 69 ethtool -G $NSIM_NETDEV "$key" "$value" 71 EXPECTED_SETTINGS[$key]="$value"
|
/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() 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 …]
|