Re: [PATCH bpf-next v2 9/9] selftests/bpf: Add nested type to type based tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 23, 2022 at 2:22 PM Daniel Müller <deso@xxxxxxxxxx> wrote:
>
> This change extends the type based tests with another struct type (in
> addition to a_struct) to check relocations against: a_complex_struct.
> This type is nested more deeply to provide additional coverage of
> certain paths in the type match logic.
>
> Signed-off-by: Daniel Müller <deso@xxxxxxxxxx>
> ---

I'd like us to have a TYPE_MATCHES test against struct task_struct,
something like below:

struct mm_struct___wrong {
    int abc_whatever_should_not_exist;
};

struct task_struct____local {
    int pid;
    struct mm_struct___wrong *mm;
};


and then use struct task_struct____local with bpf_core_type_matches()
and check that it succeeds. This will show that TYPE_MATCHES can be
used practically. Can you please add it to
progs/test_core_reloc_kernel.c?


>  .../selftests/bpf/prog_tests/core_reloc.c     |  4 ++
>  .../selftests/bpf/progs/core_reloc_types.h    | 62 +++++++++++++------
>  .../bpf/progs/test_core_reloc_type_based.c    | 12 ++++
>  3 files changed, 58 insertions(+), 20 deletions(-)
>

[...]




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux