linux-stable/tools/perf/tests
Athira Rajeev 3d9c07c4cf perf test build-id: Fix test check for PE file
Perf test "build id cache operations" fails for PE executable.  Logs
below from powerpc system.  Same is observed on x86 as well.

  <<>>
  Adding 5a0fd882b53084224ba47b624c55a469 ./tests/shell/../pe-file.exe: Ok
  build id: 5a0fd882b53084224ba47b624c55a469
  link: /tmp/perf.debug.w0V/.build-id/5a/0fd882b53084224ba47b624c55a469
  file: /tmp/perf.debug.w0V/.build-id/5a/../../root/<user>/linux/tools/perf/tests/pe-file.exe/5a0fd882b53084224ba47b624c55a469/elf
  failed: file /tmp/perf.debug.w0V/.build-id/5a/../../root/<user>/linux/tools/perf/tests/pe-file.exe/5a0fd882b53084224ba47b624c55a469/elf does not exist
  test child finished with -1
  ---- end ----
  build id cache operations: FAILED!
  <<>>

The test tries to do:

  <<>>
  mkdir /tmp/perf.debug.TeY1
  perf --buildid-dir /tmp/perf.debug.TeY1 buildid-cache -v -a ./tests/shell/../pe-file.exe
  <<>>

The option "--buildid-dir" sets the build id cache directory as
/tmp/perf.debug.TeY1. The option given to buildid-cahe, ie "-a
./tests/shell/../pe-file.exe", is to add the pe-file.exe to the cache.

The testcase, sets buildid-dir and adds the file: pe-file.exe to build
id cache. To check if the command is run successfully, "check" function
looks for presence of the file in buildid cache directory. But the check
here expects the added file to be executable. Snippet below:

  <<>>
  if [ ! -x $file ]; then
  	echo "failed: file ${file} does not exist"
  	exit 1
  fi
  <<>>

The buildid test is done for sha1 binary, md5 binary and also for PE
file. The first two binaries are created at runtime by compiling with
"--build-id" option and hence the check for sha1/md5 test should use [ !
-x ]. But in case of PE file, the permission for this input file is
rw-r--r-- Hence the file added to build id cache has same permissoin

Original file:

  ls tests/pe-file.exe | xargs stat --printf "%n %A \n"
  tests/pe-file.exe -rw-r--r--

buildid cache file:

  ls /tmp/perf.debug.w0V/.build-id/5a/../../root/<user>/linux/tools/perf/tests/pe-file.exe/5a0fd882b53084224ba47b624c55a469/elf | xargs stat --printf "%n %A \n"
  /tmp/perf.debug.w0V/.build-id/5a/../../root/<user>/linux/tools/perf/tests/pe-file.exe/5a0fd882b53084224ba47b624c55a469/elf -rw-r--r--

Fix the test to match with the permission of original file in case of FE
file. ie if the "tests/pe-file.exe" file is not having exec permission,
just check for existence of the buildid file using [ ! -e <file> ]

Signed-off-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Disha Goel <disgoel@linux.ibm.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.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/20230116050131.17221-2-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-01-18 10:52:06 -03:00
..
attr perf evlist: Remove group option. 2022-12-14 15:28:18 -03:00
shell perf test build-id: Fix test check for PE file 2023-01-18 10:52:06 -03:00
workloads perf test: Add 'datasym' test workload 2022-11-23 10:29:21 -03:00
.gitignore
api-io.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
attr.c perf cpumap: Give CPUs their own type 2022-01-12 14:28:23 -03:00
attr.py perf test: Add mechanism for skipping attr tests on kernel versions 2022-12-14 11:24:32 -03:00
backward-ring-buffer.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
bitmap.c perf tools: Use dedicated non-atomic clear/set bit helpers 2022-12-05 09:29:06 -03:00
bp_account.c perf test: Fix variable length array undefined behavior in bp_account 2022-06-19 10:41:43 -03:00
bp_signal.c perf test: BP tests, remove is_supported use 2021-11-13 18:11:50 -03:00
bp_signal_overflow.c perf test: BP tests, remove is_supported use 2021-11-13 18:11:50 -03:00
bpf-script-example.c perf bpf: Convert legacy map definition to BTF-defined 2022-08-01 14:43:13 -03:00
bpf-script-test-kbuild.c
bpf-script-test-prologue.c perf tests bpf prologue: Fix bpf-script-test-prologue test compile issue with clang 2023-01-09 11:57:47 -03:00
bpf-script-test-relocation.c
bpf.c perf test bpf: Skip test if clang is not present 2022-05-21 14:54:21 -03:00
Build perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-test-list.c perf test: Refactor shell tests allowing subdirs 2022-08-13 15:13:20 -03:00
builtin-test-list.h perf test: Refactor shell tests allowing subdirs 2022-08-13 15:13:20 -03:00
builtin-test.c perf tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -03:00
clang.c perf test: Remove skip_if_fail 2021-11-13 18:11:50 -03:00
code-reading.c perf util: Add host_is_bigendian to util.h 2022-12-14 11:16:12 -03:00
cpumap.c perf cpumap: Tidy libperf includes 2022-11-16 16:00:45 -03:00
demangle-java-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
demangle-ocaml-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
dlfilter-test.c perf tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -03:00
dso-data.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
dwarf-unwind.c perf unwind: Don't show unwind error messages when augmenting frame pointer stack 2022-04-09 12:34:29 -03:00
event-times.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
event_groups.c perf test: Update event group check for support of uncore event 2022-12-14 11:23:36 -03:00
event_update.c perf events: Prefer union over variable length array 2022-10-04 08:55:21 -03:00
evsel-roundtrip-name.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
evsel-tp-sched.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
expand-cgroup.c perf pmu-events: Hide the pmu_events 2022-08-13 15:02:08 -03:00
expr.c Merge remote-tracking branch 'torvalds/master' into perf/core 2022-12-16 09:53:53 -03:00
fdarray.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
genelf.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
hists_common.c
hists_common.h
hists_cumulate.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
hists_filter.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
hists_link.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
hists_output.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
is_printable_array.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
keep-tracking.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
kmod-path.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
llvm.c perf: Stop using bpf_object__open_buffer() API 2022-01-24 20:44:09 -08:00
llvm.h
make perf tools: Don't install libtraceevent plugins as its not anymore in the kernel sources 2023-01-10 10:52:49 -03:00
maps.c perf test: Use pointer for maps 2022-02-14 16:51:03 -03:00
mem.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
mem2node.c perf tools: Use dedicated non-atomic clear/set bit helpers 2022-12-05 09:29:06 -03:00
mmap-basic.c perf tests: Add missing event.h include 2022-10-31 11:07:08 -03:00
mmap-thread-lookup.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
openat-syscall-all-cpus.c perf tests: Avoid pthread.h inclusion 2022-10-04 08:55:19 -03:00
openat-syscall-tp-fields.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
openat-syscall.c perf thread_map: Reduce exposure of libperf internal API 2022-11-16 12:17:15 -03:00
parse-events.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
parse-metric.c perf stat: Allocate evsel->stats->aggr properly 2022-10-27 16:37:25 -03:00
parse-no-sample-id-all.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
pe-file-parsing.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
pe-file.c perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe.debug perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
perf-hooks.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
perf-record.c perf tests: Add missing event.h include 2022-10-31 11:07:08 -03:00
perf-targz-src-pkg
perf-time-to-tsc.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
pfm.c perf test: Remove skip_if_fail 2021-11-13 18:11:50 -03:00
pmu-events.c perf test pmu-events: Fake PMU metric workaround 2022-12-21 14:52:40 -03:00
pmu.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
python-use.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
sample-parsing.c perf util: Add host_is_bigendian to util.h 2022-12-14 11:16:12 -03:00
sdt.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
sigtrap.c perf test: Skip sigtrap test on old kernels 2022-10-04 08:55:22 -03:00
stat.c perf cpumap: Give CPUs their own type 2022-01-12 14:28:23 -03:00
sw-clock.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
switch-tracking.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
task-exit.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
tests.h perf test: Add event group test for events in multiple PMUs 2022-12-14 11:16:12 -03:00
thread-map.c perf thread_map: Reduce exposure of libperf internal API 2022-11-16 12:17:15 -03:00
thread-maps-share.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
time-utils-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
topology.c perf stat: Rename to aggr_cpu_id.thread_idx 2022-10-06 08:03:53 -03:00
unit_number__scnprintf.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
vmlinux-kallsyms.c perf tests vmlinux-kallsyms: Update is_ignored_symbol function to match the kernel ignored list 2022-09-28 11:11:33 -03:00
wp.c perf test: Skip watchpoint tests if no watchpoints available 2022-11-23 10:32:53 -03:00