[PATCH 6/6] bpf: add support for new fields in struct bpf_prog_info

Dmitry V. Levin ldv at altlinux.org
Wed Dec 29 23:32:53 UTC 2021


On Wed, Dec 29, 2021 at 07:25:54PM +0100, Paul Chaignon wrote:
[...]
> --- a/src/bpf_attr.h
> +++ b/src/bpf_attr.h
> @@ -362,11 +362,13 @@ struct bpf_prog_info_struct {
>  	uint64_t ATTRIBUTE_ALIGNED(8) prog_tags;
>  	uint64_t ATTRIBUTE_ALIGNED(8) run_time_ns;
>  	uint64_t ATTRIBUTE_ALIGNED(8) run_cnt;
> +	uint64_t recursion_misses;

We always add ATTRIBUTE_ALIGNED(8) to uint64_t fields in src/bpf_attr.h
file, the reason is that kernel folks used to screw things up several
times in the past, so we would rather double check.

> +	uint32_t verified_insns;
>  };
>  
>  # define bpf_prog_info_struct_size \
>  	sizeof(struct bpf_prog_info_struct)
> -# define expected_bpf_prog_info_struct_size 208
> +# define expected_bpf_prog_info_struct_size 224

Since the structure is padded now, this has to be changed, e.g.

# define bpf_prog_info_struct_size \
	offsetofend(struct bpf_prog_info_struct, verified_insns)
# define expected_bpf_prog_info_struct_size 220


-- 
ldv


More information about the Strace-devel mailing list