linux-stable/tools
Arnaldo Carvalho de Melo f45380a17b perf tests record: Fail the test if the 'errs' counter is not zero
[ Upstream commit 25c5e67cdf ]

We were just checking for the 'err' variable, when we should really see
if there was some of the many checked errors that don't stop the test
right away.

Detected with clang 15.0.0:

  44    75.23 fedora:37       : FAIL clang version 15.0.0 (Fedora 15.0.0-2.fc37)

    tests/perf-record.c:68:16: error: variable 'errs' set but not used [-Werror,-Wunused-but-set-variable]
            int err = -1, errs = 0, i, wakeups = 0;
                          ^
    1 error generated.

The patch introducing this 'perf test' entry had that check:

  +       return (err < 0 || errs > 0) ? -1 : 0;

But at some point we lost that:

  -	  return (err < 0 || errs > 0) ? -1 : 0;
  +	  if (err == -EACCES)
  +               return TEST_SKIP;
  +	  if (err < 0)
  +               return TEST_FAIL;
  +	  return TEST_OK

Put it back.

Fixes: 2cf88f4614 ("perf test: Use skip in PERF_RECORD_*")
Acked-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/YzR0n5QhsH9VyYB0@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-05 10:40:54 +02:00
..
accounting delayacct: track delays from write-protect copy 2022-06-01 15:55:25 -07:00
arch x86/speculation: Add RSB VM Exit protections 2022-08-11 13:22:05 +02:00
bootconfig
bpf bpftool: Use sysfs vmlinux when dumping BTF by ID 2022-05-13 16:07:53 -07:00
build tools build: Switch to new openssl API for test-libcrypto 2022-08-25 11:45:24 +02:00
certs tools/certs: Add print-cert-tbs-hash.sh 2022-05-23 18:47:49 +03:00
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: Add new hardware clock type 2022-05-04 11:06:14 +02:00
hv
iio Kbuild updates for v5.18 2022-03-31 11:59:03 -07:00
include tools/include/uapi: Fix <asm/errno.h> for parisc and xtensa 2022-09-23 14:14:05 +02:00
io_uring
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-06-15 08:14:20 -04:00
laptop
leds
lib libperf evlist: Fix polling of system-wide events 2022-09-28 11:32:04 +02:00
memory-model tools/memory-model/README: Update klitmus7 compat table 2022-05-03 10:12:48 -07:00
objtool x86/sev: Mark snp_abort() noreturn 2022-09-15 10:47:09 +02:00
pci
pcmcia
perf perf tests record: Fail the test if the 'errs' counter is not zero 2022-10-05 10:40:54 +02:00
power tools/power/x86/intel-speed-select: Fix off by one check 2022-08-17 15:15:39 +02:00
rcu
scripts Kbuild updates for v5.18 2022-03-31 11:59:03 -07:00
spi
testing selftests: Fix the if conditions of in test_extra_filter() 2022-10-05 10:40:52 +02:00
thermal tools/thermal: Fix possible path truncations 2022-08-17 15:16:02 +02:00
time
tracing rtla: Fix tracer name 2022-09-05 10:31:31 +02:00
usb testusb: Fix warning comparing pointer to 0 2022-04-26 13:32:49 +02:00
virtio tools/virtio: compile with -pthread 2022-03-28 16:52:59 -04:00
vm tools/vm/slabinfo: use alphabetic order when two values are equal 2022-08-25 11:45:23 +02:00
wmi
Makefile Thermal control updates for 5.19-rc1 2022-05-24 16:19:30 -07:00