Lines Matching refs:def
12 static bool bpf_map_def__is_per_cpu(const struct bpf_map_def *def)
14 return def->type == BPF_MAP_TYPE_PERCPU_HASH ||
15 def->type == BPF_MAP_TYPE_PERCPU_ARRAY ||
16 def->type == BPF_MAP_TYPE_LRU_PERCPU_HASH ||
17 def->type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE;
20 static void *bpf_map_def__alloc_value(const struct bpf_map_def *def)
22 if (bpf_map_def__is_per_cpu(def))
23 return malloc(round_up(def->value_size, 8) * sysconf(_SC_NPROCESSORS_CONF));
25 return malloc(def->value_size);
30 const struct bpf_map_def *def = bpf_map__def(map);
38 if (IS_ERR(def))
39 return PTR_ERR(def);
42 key = malloc(def->key_size);
46 value = bpf_map_def__alloc_value(def);