Re: [PATCH v2 1/2] perf trace: Add tests for BTF general augmentation
From: Howard Chu
Date: Wed Dec 11 2024 - 17:11:40 EST
Hello Namhyung,
On Tue, Dec 10, 2024 at 2:30 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> Hello,
>
> On Tue, Nov 26, 2024 at 02:32:56PM -0800, Howard Chu wrote:
> > Currently, we only have perf trace augmentation tests for enum
> > arguments. This patch adds tests for more general syscall arguments,
> > such as struct pointers, strings, and buffers.
> >
> > These tests utilize the perf config system to configure the perf trace
> > output, as suggested by Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> >
> > Suggested-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> > Suggested-by: Ian Rogers <irogers@xxxxxxxxxx>
> > Signed-off-by: Howard Chu <howardchu95@xxxxxxxxx>
> > ---
> > tools/perf/tests/shell/trace_btf_general.sh | 81 +++++++++++++++++++++
> > 1 file changed, 81 insertions(+)
> > create mode 100755 tools/perf/tests/shell/trace_btf_general.sh
> >
> > diff --git a/tools/perf/tests/shell/trace_btf_general.sh b/tools/perf/tests/shell/trace_btf_general.sh
> > new file mode 100755
> > index 000000000000..903310b355c4
> > --- /dev/null
> > +++ b/tools/perf/tests/shell/trace_btf_general.sh
> > @@ -0,0 +1,81 @@
> > +#!/bin/bash
> > +# perf trace BTF general tests
> > +# SPDX-License-Identifier: GPL-2.0
> > +
> > +err=0
> > +set -e
> > +
> > +. "$(dirname $0)"/lib/probe.sh
> > +skip_if_no_perf_trace || exit 2
>
> The kernel might not have BPF/BTF support. I think you can check if
> /sys/kernel/btf/vmlinux is there and skip the test if not.
My bad, I will add the check to it.
Thanks,
Howard