perf test bpf: Check for libtraceevent support
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Tue, 31 Jan 2023 13:50:01 +0000 (19:20 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 6 Feb 2023 14:40:59 +0000 (11:40 -0300)
commitee739f132f716f28c9fbe70a230e35085c197dd5
tree45e582e4a7322f5a917a70f3eb1681a898cf6c10
parentab809efaeba0cca20cfcda23852b0ee958f6ea69
perf test bpf: Check for libtraceevent support

The "bpf" tests fails in environment with missing libtraceevent support
as below:

  # ./perf test 36
  36: BPF filter                          :
  36.1: Basic BPF filtering               : FAILED!
  36.2: BPF pinning                       : FAILED!
  36.3: BPF prologue generation           : FAILED!

The environment has clang but missing the libtraceevent devel. Hence
perf is compiled without libtraceevent support.

Detailed logs:
./perf test -v "Basic BPF filtering"

Failed to add BPF event syscalls:sys_enter_epoll_pwait
bpf: tracepoint call back failed, stop iterate
Failed to add events selected by BPF

The bpf tests tris to add probe event which fails at
"parse_events_add_tracepoint" function due to missing libtraceevent. Add
check for "HAVE_LIBTRACEEVENT" in the "tests/bpf.c" before proceeding
with the test.

With the change,

# ./perf test 36
  36: BPF filter                    :
  36.1: Basic BPF filtering         : Skip (not compiled in or missing libtraceevent support)
  36.2: BPF pinning                 : Skip (not compiled in or missing libtraceevent support)
  36.3: BPF prologue generation     : Skip (not compiled in or missing libtraceevent support)

Signed-off-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Disha Goel <disgoel@linux.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230131135001.54578-1-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/bpf.c