Lines Matching defs:size

433 	 * entry-point BPF programs this includes the size of main program
485 * kern_vdata-size == sizeof(struct bpf_struct_ops_tcp_congestion_ops)
795 pr_warn("sec '%s': corrupted program '%s', offset %zu, size %zu\n",
895 pr_debug("sec '%s': found program '%s' at insn offset %zu (%zu bytes), code size %zu insns (%zu bytes)\n",
1060 map->def.value_size = kern_vtype->size;
1063 st_ops->kern_vdata = calloc(1, kern_vtype->size);
1150 pr_warn("struct_ops init_kern %s: Error in size of member %s: %zd != %zd(kernel)\n",
1246 map->def.value_size = type->size;
1254 st_ops->data = malloc(type->size);
1261 if (vsi->offset + type->size > data->d_size) {
1269 type->size);
1489 bpf_object__init_license(struct bpf_object *obj, void *data, size_t size)
1495 /* libbpf_strlcpy() only copies first N - 1 bytes, so size + 1 won't
1498 libbpf_strlcpy(obj->license, data, min(size + 1, sizeof(obj->license)));
1504 bpf_object__init_kversion(struct bpf_object *obj, void *data, size_t size)
1508 if (!data || size != sizeof(kver)) {
1526 static int find_elf_sec_sz(const struct bpf_object *obj, const char *name, __u32 *size)
1544 *size = data->d_size;
1793 /* Skip recognized sections with size 0. */
1948 * bytes size without any loss of information. If the target integer
2336 pr_warn("map '%s': conflicting key size %u != %u.\n",
2358 pr_warn("map '%s': can't determine key size for type [%u]: %zd.\n",
2363 pr_warn("map '%s': conflicting key size %u != %zd.\n",
2376 pr_warn("map '%s': conflicting value size %u != %u.\n",
2398 pr_warn("map '%s': can't determine value size for type [%u]: %zd.\n",
2403 pr_warn("map '%s': conflicting value size %u != %zd.\n",
2434 pr_warn("map '%s': conflicting value size %u != 4.\n",
2522 /* if user forgot to set any size, make sure they see error */
2526 * a power-of-2 multiple of kernel's page size. If user diligently
2527 * satisified these conditions, pass the size through.
2533 * user-set size to satisfy both user size request and kernel
2541 /* if it's impossible to satisfy the conditions (i.e., user size is
2543 * page_size) then just return original size and let kernel reject it
2567 /* auto-adjust BPF ringbuf map max_entries to be a multiple of page size */
2635 if ((__u64)vi->offset + vi->size > data->d_size) {
2656 if (def->size > vi->size) {
2657 pr_warn("map '%s': invalid def size.\n", map_name);
2838 * using size = 1 is the safest choice, 4 will be too
2842 t->size = 1;
2872 t->size = sizeof(__u32); /* kernel enforced */
3036 __u32 size = 0, i, vars = btf_vlen(t);
3047 /* Extern-backing datasecs (.ksyms, .kconfig) have their size and
3056 /* Clang leaves DATASEC size and VAR offsets as zeroes, so we need to
3064 if (t->size == 0) {
3065 err = find_elf_sec_sz(obj, sec_name, &size);
3066 if (err || !size) {
3067 pr_debug("sec '%s': failed to determine size from ELF: size %u, err %d\n",
3068 sec_name, size, err);
3072 t->size = size;
3139 * is section size and global variable offset. We use
3678 * include sec #0, it is already the necessary size of an array to keep
3809 pr_debug("elf: section(%d) %s, size %ld, link %d, flags %lx, type=%d\n",
3922 pr_info("elf: skipping section(%d) %s (size %zu)\n", idx, name,
4041 return t->size == 1 ? KCFG_BOOL : KCFG_UNKNOWN;
4044 if (t->size == 1)
4046 if (t->size < 1 || t->size > 8 || (t->size & (t->size - 1)))
4051 if (t->size != 4)
4083 /* ascending order by size, within same alignment class */
4240 pr_warn("failed to resolve size of extern (kcfg) '%s': %d\n",
4271 /* sort externs by type, for kcfg ones also by (align, size, name) */
4336 vs->size = sizeof(int);
4338 sec->size = off;
4355 sec->size = off;
4902 /* auto-adjust BPF ringbuf map max_entries to be a multiple of page size */
5709 pr_debug("map '%s': setting size to %d\n", map->name, nr_cpus);
6075 * - for ENUMs, the size is ignored;
6076 * - for INT, size and signedness are ignored;
7087 rel->r_offset + bpf_ptr_sz <= vi->offset + vi->size)
7107 pr_warn(".maps relo #%d: hash-of-maps '%s' should have key size %zu.\n",
7149 /* here we use BPF pointer size, which is always 64 bit, as we
7466 /* On ENOSPC, increase log buffer size and retry, unless custom
7468 * Be careful to not overflow u32, though. Kernel's log buf size limit
7513 /* size of the remaining log content to the right from the to-be-replaced part */
10006 int bpf_map__set_key_size(struct bpf_map *map, __u32 size)
10010 map->def.key_size = size;
10019 static int map_btf_datasec_resize(struct bpf_map *map, __u32 size)
10060 /* verify request size aligns with array */
10063 if (element_sz <= 0 || (size - var->offset) % element_sz != 0) {
10064 pr_warn("map '%s': cannot be resized, element size (%d) doesn't align with new total size (%u)\n",
10065 bpf_map__name(map), element_sz, size);
10070 nr_elements = (size - var->offset) / element_sz;
10083 datasec_type->size = size;
10084 var->size = size - var->offset;
10090 int bpf_map__set_value_size(struct bpf_map *map, __u32 size)
10100 mmap_new_sz = bpf_map_mmap_sz(size, map->def.max_entries);
10107 err = map_btf_datasec_resize(map, size);
10116 map->def.value_size = size;
10131 const void *data, size_t size)
10134 size != map->def.value_size || map->fd >= 0)
10137 memcpy(map->mmaped, data, size);
10270 pr_warn("map '%s': unexpected key size %zu provided, expected %u\n",
10287 pr_warn("map '%s': unexpected value size %zu provided for per-CPU map, expected %d * %zu = %zd\n",
10295 pr_warn("map '%s': unexpected value size %zu provided, expected %u\n",
10740 attr.size = attr_sz;
10884 attr.size = attr_sz;
11545 attr.size = attr_sz;
12165 attr.size = attr_sz;
12777 ehdr_size = ehdr->size;
12962 attr.size = attr_sz;
13150 uint32_t size;
13177 pb->sample_cb(pb->ctx, cpu_buf->cpu, s->data, s->size);