perf tools fixes for v6.5:

- Don't group events when computing metrics that require more than the
  maximum number of simultaneously enabled events on AMD systems.

- Fix multi CU handling in 'perf probe', add a 'perf test' entry to regress
  test it.

- Make the 'perf test task_exit' stop generating samples by using the
  'dummy' event, all it is testing is if a PERF_RECORD_EXIT is generated
  at the end of a perf session. This makes this perf test to stop
  sometimes failing on some systems due to a full ring buffer.

- Avoid SEGV if PMU lookup fails for legacy cache terms.

- Fix libsubcmd SEGV/use-after-free when commands aren't excluded.

- Fix OpenCSD (ARM64's CoreSight hardware tracing) library path resolution when
  specifying CSLIBS= in the make command line.

- Fix broken feature check for libtracefs due to external lib changes,
  use the provided pkgconfig file instead future proof it.

- Sync drm, fcntl, kvm, mount, prctl, socket, vhost, asound, arm64's
  cputype headers with the kernel sources, in some cases this made the
  tools become aware of new kernel APIs such as ioctls and the cachestat
  sysctl.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf test task_exit: No need for a cycles event to check if we get an PERF_RECORD_EXIT

The intent of this test is to check we get a PERF_RECORD_EXIT as asked
for by setting perf_event_attr.task=1.

When the test was written we didn't had the "dummy" event so we went
with the default event, "cycles".

There were reports of this test failing sometimes, one of these reports
was with a PREEMPT_RT_FULL, but I noticed it failing sometimes with an
aarch64 Firefly board.

In the kernel the call to perf_event_task_output(), that generates the
PERF_RECORD_EXIT may fail when there is not enough memory in the ring
buffer, if the ring buffer is paused, etc.

So switch to using the "dummy" event to use the ring buffer just for
what the test was designed for, avoiding uneeded PERF_RECORD_SAMPLEs.

Acked-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZLGXmMuNRpx1ubFm@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 file changed