Home
last modified time | relevance | path

Searched refs:hashmap (Results 1 - 25 of 44) sorted by relevance

12

/kernel/linux/linux-5.10/tools/lib/bpf/
H A Dhashmap.h52 struct hashmap { struct
73 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn,
75 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn,
78 void hashmap__clear(struct hashmap *map);
79 void hashmap__free(struct hashmap *map);
81 size_t hashmap__size(const struct hashmap *map);
82 size_t hashmap__capacity(const struct hashmap *map);
92 * This turns hashmap into a multimap by allowing multiple values to be
93 * associated with the same key. Most useful read API for such hashmap is
112 int hashmap__insert(struct hashmap *ma
[all...]
H A Dhashmap.c13 #include "hashmap.h"
38 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn, in hashmap__init()
51 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn, in hashmap__new()
55 struct hashmap *map = malloc(sizeof(struct hashmap)); in hashmap__new()
63 void hashmap__clear(struct hashmap *map) in hashmap__clear()
76 void hashmap__free(struct hashmap *map) in hashmap__free()
85 size_t hashmap__size(const struct hashmap *map) in hashmap__size()
90 size_t hashmap__capacity(const struct hashmap *map) in hashmap__capacity()
95 static bool hashmap_needs_to_grow(struct hashmap *ma
[all...]
/kernel/linux/linux-5.10/tools/perf/util/
H A Dhashmap.h52 struct hashmap { struct
73 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn,
75 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn,
78 void hashmap__clear(struct hashmap *map);
79 void hashmap__free(struct hashmap *map);
81 size_t hashmap__size(const struct hashmap *map);
82 size_t hashmap__capacity(const struct hashmap *map);
92 * This turns hashmap into a multimap by allowing multiple values to be
93 * associated with the same key. Most useful read API for such hashmap is
112 int hashmap__insert(struct hashmap *ma
[all...]
H A Dhashmap.c13 #include "hashmap.h"
38 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn, in hashmap__init()
51 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn, in hashmap__new()
55 struct hashmap *map = malloc(sizeof(struct hashmap)); in hashmap__new()
63 void hashmap__clear(struct hashmap *map) in hashmap__clear()
76 void hashmap__free(struct hashmap *map) in hashmap__free()
85 size_t hashmap__size(const struct hashmap *map) in hashmap__size()
90 size_t hashmap__capacity(const struct hashmap *map) in hashmap__capacity()
95 static bool hashmap_needs_to_grow(struct hashmap *ma
[all...]
H A Dexpr.h9 //#include <bpf/hashmap.h>
11 #include "util/hashmap.h"
22 struct hashmap ids;
/kernel/linux/linux-6.6/tools/perf/util/
H A Dexpr.h5 struct hashmap;
16 struct hashmap *ids;
22 struct hashmap *ids__new(void);
23 void ids__free(struct hashmap *ids);
24 int ids__insert(struct hashmap *ids, const char *id);
29 struct hashmap *ids__union(struct hashmap *ids1, struct hashmap *ids2);
H A Dhashmap.c13 #include "hashmap.h"
38 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn, in hashmap__init()
51 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn, in hashmap__new()
55 struct hashmap *map = malloc(sizeof(struct hashmap)); in hashmap__new()
63 void hashmap__clear(struct hashmap *map) in hashmap__clear()
76 void hashmap__free(struct hashmap *map) in hashmap__free()
85 size_t hashmap__size(const struct hashmap *map) in hashmap__size()
90 size_t hashmap__capacity(const struct hashmap *map) in hashmap__capacity()
95 static bool hashmap_needs_to_grow(struct hashmap *ma
[all...]
H A Dhashmap.h72 struct hashmap { struct
83 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn,
85 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn,
88 void hashmap__clear(struct hashmap *map);
89 void hashmap__free(struct hashmap *map);
91 size_t hashmap__size(const struct hashmap *map);
92 size_t hashmap__capacity(const struct hashmap *map);
102 * This turns hashmap into a multimap by allowing multiple values to be
103 * associated with the same key. Most useful read API for such hashmap is
129 int hashmap_insert(struct hashmap *ma
[all...]
H A Dexpr.c15 #include "util/hashmap.h"
73 struct hashmap *ids__new(void) in ids__new()
75 struct hashmap *hash; in ids__new()
83 void ids__free(struct hashmap *ids) in ids__free()
99 int ids__insert(struct hashmap *ids, const char *id) in ids__insert()
113 struct hashmap *ids__union(struct hashmap *ids1, struct hashmap *ids2) in ids__union()
128 struct hashmap *tmp = ids1; in ids__union()
/kernel/linux/linux-6.6/tools/lib/bpf/
H A Dhashmap.c13 #include "hashmap.h"
38 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn, in hashmap__init()
51 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn, in hashmap__new()
55 struct hashmap *map = malloc(sizeof(struct hashmap)); in hashmap__new()
63 void hashmap__clear(struct hashmap *map) in hashmap__clear()
76 void hashmap__free(struct hashmap *map) in hashmap__free()
85 size_t hashmap__size(const struct hashmap *map) in hashmap__size()
90 size_t hashmap__capacity(const struct hashmap *map) in hashmap__capacity()
95 static bool hashmap_needs_to_grow(struct hashmap *ma
[all...]
H A Dhashmap.h72 struct hashmap { struct
83 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn,
85 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn,
88 void hashmap__clear(struct hashmap *map);
89 void hashmap__free(struct hashmap *map);
91 size_t hashmap__size(const struct hashmap *map);
92 size_t hashmap__capacity(const struct hashmap *map);
102 * This turns hashmap into a multimap by allowing multiple values to be
103 * associated with the same key. Most useful read API for such hashmap is
129 int hashmap_insert(struct hashmap *ma
[all...]
H A Dstrset.c8 #include "hashmap.h"
19 struct hashmap *strs_hash;
42 struct hashmap *hash; in strset__new()
/kernel/linux/linux-6.6/tools/bpf/bpftool/
H A Dpids.c12 #include <bpf/hashmap.h>
19 int build_obj_refs_table(struct hashmap **map, enum bpf_obj_type type) in build_obj_refs_table()
23 void delete_obj_refs_table(struct hashmap *map) {} in delete_obj_refs_table()
24 void emit_obj_refs_plain(struct hashmap *map, __u32 id, const char *prefix) {} in emit_obj_refs_plain()
25 void emit_obj_refs_json(struct hashmap *map, __u32 id, json_writer_t *json_writer) {} in emit_obj_refs_json()
31 static void add_ref(struct hashmap *map, struct pid_iter_entry *e) in add_ref()
86 p_err("failed to append entry to hashmap for ID %u: %s", in add_ref()
98 int build_obj_refs_table(struct hashmap **map, enum bpf_obj_type type) in build_obj_refs_table()
108 p_err("failed to create hashmap for PID references"); in build_obj_refs_table()
177 void delete_obj_refs_table(struct hashmap *ma
[all...]
H A Dmain.h16 #include <bpf/hashmap.h>
86 extern struct hashmap *refs_table;
115 int build_pinned_obj_table(struct hashmap *table,
117 void delete_pinned_obj_table(struct hashmap *table);
118 __weak int build_obj_refs_table(struct hashmap **table,
120 __weak void delete_obj_refs_table(struct hashmap *table);
121 __weak void emit_obj_refs_json(struct hashmap *table, __u32 id,
123 __weak void emit_obj_refs_plain(struct hashmap *table, __u32 id,
262 static inline bool hashmap__empty(struct hashmap *map) in hashmap__empty()
H A Dbtf.c17 #include <bpf/hashmap.h>
734 build_btf_type_table(struct hashmap *tab, enum bpf_obj_type type, in build_btf_type_table()
820 p_err("failed to append entry to hashmap for BTF ID %u, object ID %u: %s", in build_btf_type_table()
834 build_btf_tables(struct hashmap *btf_prog_table, in build_btf_tables()
835 struct hashmap *btf_map_table) in build_btf_tables()
860 struct hashmap *btf_prog_table, in show_btf_plain()
861 struct hashmap *btf_map_table) in show_btf_plain()
893 struct hashmap *btf_prog_table, in show_btf_json()
894 struct hashmap *btf_map_table) in show_btf_json()
928 show_btf(int fd, struct hashmap *btf_prog_tabl
[all...]
H A Dmain.c14 #include <bpf/hashmap.h>
35 struct hashmap *refs_table;
/kernel/linux/linux-5.10/tools/perf/
H A Dcheck-headers.sh161 check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
162 check_2 tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c
/kernel/linux/linux-6.6/tools/perf/
H A Dcheck-headers.sh184 check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
185 check_2 tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/progs/
H A Dfor_each_hash_map_elem.c13 } hashmap SEC(".maps");
71 bpf_for_each_map_elem(&hashmap, check_hash_elem, &data, 0); in check_percpu_elem()
89 hashmap_elems = bpf_for_each_map_elem(&hashmap, check_hash_elem, &data, 0); in test_pkt_access()
H A Dbloom_filter_bench.c40 } hashmap SEC(".maps");
142 result = bpf_map_lookup_elem(&hashmap, in bloom_hashmap_lookup()
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/benchs/
H A Dbench_local_storage.c29 0, "When doing hashmap test, set number of hashmap keys test uses"},
104 * populate the hashmap for a similar comparison in prepopulate_hashmap()
109 fprintf(stderr, "Error prepopulating hashmap (key %d)\n", key); in prepopulate_hashmap()
115 static void __setup(struct bpf_program *prog, bool hashmap) in __setup() argument
122 if (!hashmap) in __setup()
146 if (hashmap) in __setup()
157 if (hashmap) in __setup()
274 .name = "local-storage-cache-hashmap-control",
H A Dbench_bloom_filter_map.c149 /* Populate hashmap, bloom filter map, and array map with the same in map_prepare_thread()
164 fprintf(stderr, "failed to add elem to hashmap: %d\n", in map_prepare_thread()
213 ctx.hashmap_fd = bpf_map__fd(ctx.skel->maps.hashmap); in populate_maps()
272 bpf_map__set_max_entries(skel->maps.hashmap, args.nr_entries); in setup_skeleton()
283 bpf_map__set_value_size(skel->maps.hashmap, args.value_size); in setup_skeleton()
285 /* For the hashmap, we use the value as the key as well */ in setup_skeleton()
286 bpf_map__set_key_size(skel->maps.hashmap, args.value_size); in setup_skeleton()
458 .name = "hashmap-without-bloom",
469 .name = "hashmap-with-bloom",
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/
H A Dfor_each.c29 max_entries = bpf_map__max_entries(skel->maps.hashmap); in test_hash_map()
33 err = bpf_map__update_elem(skel->maps.hashmap, &key, sizeof(key), in test_hash_map()
63 err = bpf_map__lookup_elem(skel->maps.hashmap, &key, sizeof(key), &val, sizeof(val), 0); in test_hash_map()
H A Dhashmap.c4 * Tests for libbpf's hashmap.
9 #include "bpf/hashmap.h"
49 struct hashmap *map; in test_hashmap_generic()
259 /* Verify that hashmap interface works with pointer keys and values */
264 struct hashmap *map; in test_hashmap_ptr_iface()
268 if (CHECK(!map, "hashmap__new", "can't allocate hashmap\n")) in test_hashmap_ptr_iface()
343 struct hashmap *map; in test_hashmap_multimap()
415 struct hashmap *map; in test_hashmap_empty()
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/
H A Dhashmap.c4 * Tests for libbpf's hashmap.
9 #include "bpf/hashmap.h"
48 struct hashmap *map; in test_hashmap_generic()
264 struct hashmap *map; in test_hashmap_multimap()
337 struct hashmap *map; in test_hashmap_empty()

Completed in 11 milliseconds

12