Re: [PATCH v2] perf test: Skip sigtrap test on old kernels

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

 



Hi Song,

On Tue, Sep 6, 2022 at 10:58 PM Song Liu <song@xxxxxxxxxx> wrote:
>
> On Tue, Sep 6, 2022 at 10:04 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > If it runs on an old kernel, perf_event_open would fail because of the
> > new fields sigtrap and sig_data.  Just skipping the test could miss an
> > actual bug in the kernel.
> >
> > Let's check BTF if it has the perf_event_attr.sigtrap field.
> >
> > Cc: Marco Elver <elver@xxxxxxxxxx>
> > Cc: Song Liu <songliubraving@xxxxxx>
> > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> > ---
> >  tools/perf/tests/sigtrap.c | 46 +++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 45 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c
> > index e32ece90e164..32f08ce0f2b0 100644
> > --- a/tools/perf/tests/sigtrap.c
> > +++ b/tools/perf/tests/sigtrap.c
> > @@ -16,6 +16,8 @@
> >  #include <sys/syscall.h>
> >  #include <unistd.h>
> >
> > +#include <bpf/btf.h>
> > +
>
> Do we need "#ifdef HAVE_BPF_SKEL" for the include part?

Right, it'd be better to move it under the #ifdef.  Will change.

>
> Other than this, looks good to me.
>
> Acked-by: Song Liu <song@xxxxxxxxxx>

Thanks for the review!
Namhyung



[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