Lines Matching refs:size

422 	 * entry-point BPF programs this includes the size of main program
472 * kern_vdata-size == sizeof(struct bpf_struct_ops_tcp_congestion_ops)
753 pr_warn("sec '%s': corrupted program '%s', offset %zu, size %zu\n",
852 pr_debug("sec '%s': found program '%s' at insn offset %zu (%zu bytes), code size %zu insns (%zu bytes)\n",
1015 map->def.value_size = kern_vtype->size;
1018 st_ops->kern_vdata = calloc(1, kern_vtype->size);
1105 pr_warn("struct_ops init_kern %s: Error in size of member %s: %zd != %zd(kernel)\n",
1201 map->def.value_size = type->size;
1209 st_ops->data = malloc(type->size);
1216 if (vsi->offset + type->size > data->d_size) {
1224 type->size);
1411 bpf_object__init_license(struct bpf_object *obj, void *data, size_t size)
1417 /* libbpf_strlcpy() only copies first N - 1 bytes, so size + 1 won't
1420 libbpf_strlcpy(obj->license, data, min(size + 1, sizeof(obj->license)));
1426 bpf_object__init_kversion(struct bpf_object *obj, void *data, size_t size)
1430 if (!data || size != sizeof(kver)) {
1448 static int find_elf_sec_sz(const struct bpf_object *obj, const char *name, __u32 *size)
1459 *size = data->d_size;
1708 /* Skip recognized sections with size 0. */
1851 * bytes size without any loss of information. If the target integer
2239 pr_warn("map '%s': conflicting key size %u != %u.\n",
2261 pr_warn("map '%s': can't determine key size for type [%u]: %zd.\n",
2266 pr_warn("map '%s': conflicting key size %u != %zd.\n",
2279 pr_warn("map '%s': conflicting value size %u != %u.\n",
2301 pr_warn("map '%s': can't determine value size for type [%u]: %zd.\n",
2306 pr_warn("map '%s': conflicting value size %u != %zd.\n",
2337 pr_warn("map '%s': conflicting value size %u != 4.\n",
2425 /* if user forgot to set any size, make sure they see error */
2429 * a power-of-2 multiple of kernel's page size. If user diligently
2430 * satisified these conditions, pass the size through.
2436 * user-set size to satisfy both user size request and kernel
2444 /* if it's impossible to satisfy the conditions (i.e., user size is
2446 * page_size) then just return original size and let kernel reject it
2470 /* auto-adjust BPF ringbuf map max_entries to be a multiple of page size */
2538 if ((__u64)vi->offset + vi->size > data->d_size) {
2559 if (def->size > vi->size) {
2560 pr_warn("map '%s': invalid def size.\n", map_name);
2730 * using size = 1 is the safest choice, 4 will be too
2734 t->size = 1;
2764 t->size = sizeof(__u32); /* kernel enforced */
2914 __u32 size = 0, i, vars = btf_vlen(t);
2925 /* Extern-backing datasecs (.ksyms, .kconfig) have their size and
2934 /* Clang leaves DATASEC size and VAR offsets as zeroes, so we need to
2942 if (t->size == 0) {
2943 err = find_elf_sec_sz(obj, sec_name, &size);
2944 if (err || !size) {
2945 pr_debug("sec '%s': failed to determine size from ELF: size %u, err %d\n",
2946 sec_name, size, err);
2950 t->size = size;
3017 * is section size and global variable offset. We use
3400 * include sec #0, it is already the necessary size of an array to keep
3465 pr_debug("elf: section(%d) %s, size %ld, link %d, flags %lx, type=%d\n",
3547 pr_info("elf: skipping section(%d) %s (size %zu)\n", idx, name,
3666 return t->size == 1 ? KCFG_BOOL : KCFG_UNKNOWN;
3669 if (t->size == 1)
3671 if (t->size < 1 || t->size > 8 || (t->size & (t->size - 1)))
3676 if (t->size != 4)
3708 /* ascending order by size, within same alignment class */
3856 pr_warn("failed to resolve size of extern (kcfg) '%s': %d\n",
3887 /* sort externs by type, for kcfg ones also by (align, size, name) */
3952 vs->size = sizeof(int);
3954 sec->size = off;
3971 sec->size = off;
4497 /* auto-adjust BPF ringbuf map max_entries to be a multiple of page size */
5306 pr_debug("map '%s': setting size to %d\n", map->name, nr_cpus);
5672 * - for ENUMs, the size is ignored;
5673 * - for INT, size and signedness are ignored;
6649 rel->r_offset + bpf_ptr_sz <= vi->offset + vi->size)
6669 pr_warn(".maps relo #%d: hash-of-maps '%s' should have key size %zu.\n",
6711 /* here we use BPF pointer size, which is always 64 bit, as we
7023 /* On ENOSPC, increase log buffer size and retry, unless custom
7025 * Be careful to not overflow u32, though. Kernel's log buf size limit
7070 /* size of the remaining log content to the right from the to-be-replaced part */
9550 int bpf_map__set_key_size(struct bpf_map *map, __u32 size)
9554 map->def.key_size = size;
9563 static int map_btf_datasec_resize(struct bpf_map *map, __u32 size)
9604 /* verify request size aligns with array */
9607 if (element_sz <= 0 || (size - var->offset) % element_sz != 0) {
9608 pr_warn("map '%s': cannot be resized, element size (%d) doesn't align with new total size (%u)\n",
9609 bpf_map__name(map), element_sz, size);
9614 nr_elements = (size - var->offset) / element_sz;
9627 datasec_type->size = size;
9628 var->size = size - var->offset;
9634 int bpf_map__set_value_size(struct bpf_map *map, __u32 size)
9644 mmap_new_sz = bpf_map_mmap_sz(size, map->def.max_entries);
9651 err = map_btf_datasec_resize(map, size);
9660 map->def.value_size = size;
9675 const void *data, size_t size)
9678 size != map->def.value_size || map->fd >= 0)
9681 memcpy(map->mmaped, data, size);
9814 pr_warn("map '%s': unexpected key size %zu provided, expected %u\n",
9831 pr_warn("map '%s': unexpected value size %zu provided for per-CPU map, expected %d * %zu = %zd\n",
9839 pr_warn("map '%s': unexpected value size %zu provided, expected %u\n",
10284 attr.size = attr_sz;
10428 attr.size = attr_sz;
11089 attr.size = attr_sz;
11685 attr.size = attr_sz;
12263 ehdr_size = ehdr->size;
12448 attr.size = attr_sz;
12636 uint32_t size;
12663 pb->sample_cb(pb->ctx, cpu_buf->cpu, s->data, s->size);