[PATCH v2 6/7] perf test trace_summary: Skip --bpf-summary tests if no libbpf

Ian Rogers posted 7 patches 3 months, 1 week ago
[PATCH v2 6/7] perf test trace_summary: Skip --bpf-summary tests if no libbpf
Posted by Ian Rogers 3 months, 1 week ago
If perf is built without libbpf (e.g. NO_LIBBPF=1) then the
--bpf-summary perf trace tests will fail. Skip the tests as this is
expected behavior.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/shell/trace_summary.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/tests/shell/trace_summary.sh b/tools/perf/tests/shell/trace_summary.sh
index 49766524dc21..f9bb7f9388be 100755
--- a/tools/perf/tests/shell/trace_summary.sh
+++ b/tools/perf/tests/shell/trace_summary.sh
@@ -53,6 +53,12 @@ test_perf_trace "-as --summary-mode=thread --no-bpf-summary"
 # summary only for system wide - total summary mode
 test_perf_trace "-as --summary-mode=total --no-bpf-summary"
 
+if ! perf check feature -q bpf; then
+    echo "Skip --bpf-summary tests as perf built without libbpf"
+    rm -f ${OUTPUT}
+    exit 2
+fi
+
 # summary only for system wide - per-thread summary with BPF
 test_perf_trace "-as --summary-mode=thread --bpf-summary"
 
-- 
2.49.0.1238.gf8c92423fb-goog
Re: [PATCH v2 6/7] perf test trace_summary: Skip --bpf-summary tests if no libbpf
Posted by Howard Chu 3 months, 1 week ago
Hello Ian,

On Tue, May 27, 2025 at 8:26 PM Ian Rogers <irogers@google.com> wrote:
>
> If perf is built without libbpf (e.g. NO_LIBBPF=1) then the
> --bpf-summary perf trace tests will fail. Skip the tests as this is
> expected behavior.
>
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Howard Chu <howardchu95@gmail.com>

Thanks,
Howard
Re: [PATCH v2 6/7] perf test trace_summary: Skip --bpf-summary tests if no libbpf
Posted by Arnaldo Carvalho de Melo 3 months, 1 week ago
On Tue, May 27, 2025 at 09:17:25PM -0700, Howard Chu wrote:
> Hello Ian,
> 
> On Tue, May 27, 2025 at 8:26 PM Ian Rogers <irogers@google.com> wrote:
> >
> > If perf is built without libbpf (e.g. NO_LIBBPF=1) then the
> > --bpf-summary perf trace tests will fail. Skip the tests as this is
> > expected behavior.
> >
> > Signed-off-by: Ian Rogers <irogers@google.com>
> 
> Acked-by: Howard Chu <howardchu95@gmail.com>

Thanks, applied to perf-tools-next,

BTW, my answers were for v1 but b4 gets v2, for instance, the one that
is failing:

⬢ [acme@toolbx perf-tools-next]$ b4 am -P3 -ctsl --cc-trailers 20250527180703.129336-5-irogers@google.com
Grabbing thread from lore.kernel.org/all/20250527180703.129336-5-irogers@google.com/t.mbox.gz
Breaking thread to remove parents of 20250527180703.129336-1-irogers@google.com
Checking for newer revisions
Grabbing search results from lore.kernel.org
  Added from v2: 8 patches
Analyzing 21 messages in the thread
Analyzing 0 code-review messages
Will use the latest revision: v2
You can pick other revisions using the -vN flag
Unknown range value specified: 3
Checking attestation on all messages, may take a moment...
---
  ✓ [PATCH v2 3/7] perf symbol: Move demangling code out of symbol-elf.c
    + Link: https://lore.kernel.org/r/20250528032637.198960-4-irogers@google.com
    + Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  ---
  ✓ Signed: DKIM/google.com
---
Total patches: 1 (cherrypicked: 3)
---
Cover: ./v2_20250527_irogers_various_asan_and_test_fixes.cover
 Link: https://lore.kernel.org/r/20250528032637.198960-1-irogers@google.com
 Base: not specified
       git am ./v2_20250527_irogers_various_asan_and_test_fixes.mbx
⬢ [acme@toolbx perf-tools-next]$ 

⬢ [acme@toolbx perf-tools-next]$        git am ./v2_20250527_irogers_various_asan_and_test_fixes.mbx
Applying: perf symbol: Move demangling code out of symbol-elf.c
⬢ [acme@toolbx perf-tools-next]$

⬢ [acme@toolbx perf-tools-next]$ m
rm: cannot remove '/home/acme/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/__pycache__/Core.cpython-313.pyc': Permission denied
make: Entering directory '/home/acme/git/perf-tools-next/tools/perf'
  BUILD:   Doing 'make -j32' parallel build
Warning: Kernel ABI header differences:
  diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h

Auto-detecting system features:
...                                   libdw: [ on  ]
...                                   glibc: [ on  ]
...                                  libelf: [ on  ]
...                                 libnuma: [ on  ]
...                  numa_num_possible_cpus: [ on  ]
...                                 libperl: [ on  ]
...                               libpython: [ on  ]
...                               libcrypto: [ on  ]
...                             libcapstone: [ on  ]
...                               llvm-perf: [ on  ]
...                                    zlib: [ on  ]
...                                    lzma: [ on  ]
...                               get_cpuid: [ on  ]
...                                     bpf: [ on  ]
...                                  libaio: [ on  ]
...                                 libzstd: [ on  ]

  INSTALL libsubcmd_headers
  INSTALL libperf_headers
  INSTALL libapi_headers
  INSTALL libsymbol_headers
  PERF_VERSION = 6.15.rc7.g50ec05a72bc1
  LINK    /tmp/build/perf-tools-next/libperf-jvmti.so
  INSTALL libbpf_headers
  GEN     perf-archive
  GEN     perf-iostat
  CC      /tmp/build/perf-tools-next/util/symbol.o
  CC      /tmp/build/perf-tools-next/util/header.o
  CC      /tmp/build/perf-tools-next/util/symbol-elf.o
  CXX     /tmp/build/perf-tools-next/util/demangle-cxx.o
util/symbol-elf.c: In function ‘get_plt_got_name’:
util/symbol-elf.c:563:21: error: implicit declaration of function ‘demangle_sym’; did you mean ‘dso__demangle_sym’? [-Wimplicit-function-declaration]
  563 |         demangled = demangle_sym(di->dso, 0, sym_name);
      |                     ^~~~~~~~~~~~
      |                     dso__demangle_sym
util/symbol-elf.c:563:19: error: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  563 |         demangled = demangle_sym(di->dso, 0, sym_name);
      |                   ^
util/symbol-elf.c: In function ‘dso__synthesize_plt_symbols’:
util/symbol-elf.c:761:27: error: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  761 |                 demangled = demangle_sym(dso, 0, elf_name);
      |                           ^
util/symbol-elf.c: In function ‘dso__load_sym_internal’:
util/symbol-elf.c:1778:27: error: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 1778 |                 demangled = demangle_sym(dso, kmodule, elf_name);
      |                           ^
make[4]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:85: /tmp/build/perf-tools-next/util/symbol-elf.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:142: util] Error 2
make[2]: *** [Makefile.perf:798: /tmp/build/perf-tools-next/perf-util-in.o] Error 2
make[1]: *** [Makefile.perf:290: sub-make] Error 2
make: *** [Makefile:119: install-bin] Error 2
make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
⬢ [acme@toolbx perf-tools-next]$

I can try fixing those up, but I'm concentrated now in getting as much
low hanging fruits as possible for this merge, and the patches in this
series were mostly super small and fixed things.

- Arnaldo