mirror-linux/tools/perf/tests/shell
Ravi Bangoria 3c723f4497 perf test: Fix lock contention test
Couple of independent fixes:

1. Wire in SIGSEGV handler that terminates the test with a failure code.

2. Use "--lock-cgroup" instead of "-g"; "-g" was proposed but never
   merged. See commit 4d1792d0a2 ("perf lock contention: Add
   --lock-cgroup option")

3. Call cleanup() on every normal exit so trap_cleanup() doesn't mistake
   it for an unexpected signal and emit a false-negative "Unexpected
   signal in main" message.

Before patch:

  # ./perf test -vv "lock contention"
   85: kernel lock contention analysis test:
  --- start ---
  test child forked, pid 610711
  Testing perf lock record and perf lock contention
  Testing perf lock contention --use-bpf
  Testing perf lock record and perf lock contention at the same time
  Testing perf lock contention --threads
  Testing perf lock contention --lock-addr
  Testing perf lock contention --lock-cgroup
  Unexpected signal in test_aggr_cgroup
  ---- end(0) ----
   85: kernel lock contention analysis test                            : Ok

After patch:

  # ./perf test -vv "lock contention"
   85: kernel lock contention analysis test:
  --- start ---
  test child forked, pid 602637
  Testing perf lock record and perf lock contention
  Testing perf lock contention --use-bpf
  Testing perf lock record and perf lock contention at the same time
  Testing perf lock contention --threads
  Testing perf lock contention --lock-addr
  Testing perf lock contention --lock-cgroup
  Testing perf lock contention --type-filter (w/ spinlock)
  Testing perf lock contention --lock-filter (w/ tasklist_lock)
  Testing perf lock contention --callstack-filter (w/ unix_stream)
  [Skip] Could not find 'unix_stream'
  Testing perf lock contention --callstack-filter with task aggregation
  [Skip] Could not find 'unix_stream'
  Testing perf lock contention --cgroup-filter
  Testing perf lock contention CSV output
  ---- end(0) ----
   85: kernel lock contention analysis test                            : Ok

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ananth Narayan <ananth.narayan@amd.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Santosh Shukla <santosh.shukla@amd.com>
Cc: Tycho Andersen <tycho@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2025-11-13 17:29:00 -03:00
..
attr perf test attr: Add missing int_mist.uop_dropping event to test-stat files 2025-09-19 12:41:50 -03:00
base_probe perf test perftool_testsuite: Use absolute paths 2025-10-01 09:44:05 -03:00
base_report perf test perftool_testsuite: Use absolute paths 2025-10-01 09:44:05 -03:00
common perf test perftool_testsuite: Use absolute paths 2025-10-01 09:44:05 -03:00
coresight perf test coresight: Dismiss clang warning for unroll loop thread 2025-10-06 16:49:25 -03:00
lib perf stat: Fix uncore aggregation number 2025-06-27 16:14:10 -07:00
amd-ibs-swfilt.sh perf test: AMD IBS swfilt skip kernel tests if paranoia is >1 2025-09-19 12:14:29 -03:00
annotate.sh perf test annotate: Use --percent-limit rather than head to reduce output 2025-06-30 09:12:55 -07:00
attr.sh
buildid.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
daemon.sh
diff.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
drm_pmu.sh perf tests: Add a DRM PMU test 2025-06-25 11:12:35 -07:00
ftrace.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
header.sh perf header: Fix pipe mode header dumping 2025-07-03 11:22:17 -07:00
list.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
lock_contention.sh perf test: Fix lock contention test 2025-11-13 17:29:00 -03:00
perf-report-hierarchy.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
perftool-testsuite_probe.sh perf test: Skip perf probe tests when running as non-root 2025-03-05 09:17:01 -08:00
perftool-testsuite_report.sh perf test: Tag parallel failing shell tests with "(exclusive)" 2024-10-28 09:32:58 -07:00
pipe_test.sh perf test: Fix perf test case 84 on s390 2024-10-19 09:39:54 -07:00
probe_vfs_getname.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
python-use.sh perf test: Add an 'import perf' test shell script 2025-10-01 16:59:06 -03:00
record+probe_libc_inet_pton.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
record+script_probe_vfs_getname.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
record+zstd_comp_decomp.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
record.sh perf record: Add auto counter reload parse and regression tests 2025-10-03 16:49:51 -03:00
record_bpf_filter.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
record_lbr.sh perf test shell lbr: Avoid failures with perf event paranoia 2025-09-19 12:14:30 -03:00
record_offcpu.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
record_sideband.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
sched.sh perf test: Add more test cases to sched test 2025-07-03 11:52:20 -07:00
script.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat+csv_output.sh perf test: Add --metric-only to perf stat output tests 2025-03-05 09:17:01 -08:00
stat+csv_summary.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat+event_uniquifying.sh perf test: Avoid uncore_imc/clockticks in uniquification test 2025-09-19 16:50:21 -03:00
stat+json_output.sh perf tests metric-only perf stat: Fix tests 84 and 86 s390 2025-04-25 12:32:07 -03:00
stat+shadow_stat.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat+std_output.sh perf test: Stat std output don't fail metric only 2025-10-02 15:05:41 -03:00
stat.sh perf test stat: Additional topdown grouping tests 2025-03-11 19:05:04 -07:00
stat_all_metricgroups.sh
stat_all_metrics.sh perf tests metrics: Permission related fixes 2025-05-12 14:18:16 -03:00
stat_all_pfm.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat_all_pmu.sh perf test stat_all_pmu.sh: Correctly check 'perf stat' result 2025-03-14 10:41:34 -07:00
stat_bpf_counters.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat_bpf_counters_cgrp.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
stat_metrics_values.sh perf test: Hybrid improvements for metric value validation test 2025-05-13 17:24:42 -03:00
test_arm_callgraph_fp.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_arm_coresight.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_arm_coresight_disasm.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_arm_spe.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_arm_spe_fork.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_bpf_metadata.sh perf test: Checking BPF metadata collection fails on version string 2025-09-04 16:37:19 -07:00
test_brstack.sh perf test: Extend branch stack sampling test for Arm64 BRBE 2025-10-01 15:31:49 -03:00
test_data_symbol.sh perf mem/c2c amd: Add ldlat support 2025-04-29 22:30:46 -03:00
test_intel_pt.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
test_java_symbol.sh
test_perf_data_converter_json.sh
test_stat_intel_tpebs.sh perf test: Extra verbosity and hypervisor skip for tpebs test 2025-02-03 19:45:50 -08:00
test_task_analyzer.sh perf tests shell task_analyzer: Run this test exclusively 2025-01-08 17:20:42 -03:00
test_uprobe_from_different_cu.sh perf test: Skip perf probe tests when running as non-root 2025-03-05 09:17:01 -08:00
trace+probe_vfs_getname.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
trace_btf_enum.sh perf test trace_btf_enum: Skip if permissions are insufficient 2025-09-03 12:34:54 -03:00
trace_btf_general.sh perf test trace: Change the regex pattern in the struct test 2025-06-09 11:18:20 -07:00
trace_exit_race.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
trace_record_replay.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00
trace_summary.sh perf test: Change all remaining #!/bin/sh to #!/bin/bash 2025-06-26 10:31:05 -07:00