2022-12-06 10:44:06 -05:00
|
|
|
#!/bin/bash
|
|
|
|
# perf script task-analyzer tests
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
tmpdir=$(mktemp -d /tmp/perf-script-task-analyzer-XXXXX)
|
|
|
|
err=0
|
|
|
|
|
2023-06-22 16:53:57 -07:00
|
|
|
# set PERF_EXEC_PATH to find scripts in the source directory
|
|
|
|
perfdir=$(dirname "$0")/../..
|
|
|
|
if [ -e "$perfdir/scripts/python/Perf-Trace-Util" ]; then
|
|
|
|
export PERF_EXEC_PATH=$perfdir
|
|
|
|
fi
|
|
|
|
|
perf test: Avoid python leak sanitizer test failures
Leak sanitizer will report memory leaks from python and the leak
sanitizer output causes tests to fail. For example:
```
$ perf test 98 -v
98: perf script tests:
--- start ---
test child forked, pid 1272962
DB test
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.046 MB /tmp/perf-test-script.x0EktdCel8/perf.data (8 samples) ]
call_path_table((1, 0, 0, 0)
call_path_table((2, 1, 0, 140339508617447)
call_path_table((3, 2, 2, 0)
call_path_table((4, 3, 3, 0)
call_path_table((5, 4, 4, 0)
call_path_table((6, 5, 5, 0)
call_path_table((7, 6, 6, 0)
call_path_table((8, 7, 7, 0)
call_path_table((9, 8, 8, 0)
call_path_table((10, 9, 9, 0)
call_path_table((11, 10, 10, 0)
call_path_table((12, 11, 11, 0)
call_path_table((13, 12, 1, 0)
sample_table((1, 1, 1, 1, 1, 1, 1, 8, -2058824120, 588306954119000, -1, 0, 0, 0, 0, 1, 0, 0, 128933429281, 0, 0, 13, 0, 0, 0, -1, -1))
sample_table((2, 1, 1, 1, 1, 1, 1, 8, -2058824120, 588306954137053, -1, 0, 0, 0, 0, 1, 0, 0, 128933429281, 0, 0, 13, 0, 0, 0, -1, -1))
sample_table((3, 1, 1, 1, 1, 1, 1, 8, -2058824120, 588306954140089, -1, 0, 0, 0, 0, 9, 0, 0, 128933429281, 0, 0, 13, 0, 0, 0, -1, -1))
sample_table((4, 1, 1, 1, 1, 1, 1, 8, -2058824120, 588306954142376, -1, 0, 0, 0, 0, 155, 0, 0, 128933429281, 0, 0, 13, 0, 0, 0, -1, -1))
sample_table((5, 1, 1, 1, 1, 1, 1, 8, -2058824120, 588306954144045, -1, 0, 0, 0, 0, 2493, 0, 0, 128933429281, 0, 0, 13, 0, 0, 0, -1, -1))
sample_table((6, 1, 1, 1, 1, 1, 12, 77, -2046828595, 588306954145722, -1, 0, 0, 0, 0, 47555, 0, 0, 128933429281, 0, 0, 13, 0, 0, 0, -1, -1))
call_path_table((14, 9, 14, 0)
call_path_table((15, 14, 15, 0)
call_path_table((16, 15, 0, -1040969624)
call_path_table((17, 16, 16, 0)
call_path_table((18, 17, 17, 0)
call_path_table((19, 18, 18, 0)
call_path_table((20, 19, 19, 0)
call_path_table((21, 20, 13, 0)
sample_table((7, 1, 1, 1, 2, 1, 13, 46, -2053700898, 588306954157436, -1, 0, 0, 0, 0, 964078, 0, 0, 128933429281, 0, 0, 21, 0, 0, 0, -1, -1))
call_path_table((22, 1, 21, 0)
call_path_table((23, 22, 22, 0)
call_path_table((24, 23, 23, 0)
call_path_table((25, 24, 24, 0)
call_path_table((26, 25, 25, 0)
call_path_table((27, 26, 26, 0)
call_path_table((28, 27, 27, 0)
call_path_table((29, 28, 28, 0)
call_path_table((30, 29, 29, 0)
call_path_table((31, 30, 30, 0)
call_path_table((32, 31, 31, 0)
call_path_table((33, 32, 32, 0)
call_path_table((34, 33, 33, 0)
call_path_table((35, 34, 20, 0)
sample_table((8, 1, 1, 1, 2, 1, 20, 49, -2046878127, 588306954378624, -1, 0, 0, 0, 0, 2534317, 0, 0, 128933429281, 0, 0, 35, 0, 0, 0, -1, -1))
=================================================================
==1272975==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 13628 byte(s) in 6 object(s) allocated from:
#0 0x56354f60c092 in malloc (/tmp/perf/perf+0x29c092)
#1 0x7ff25c7d02e7 in _PyObject_Malloc /build/python3.11/../Objects/obmalloc.c:2003:11
#2 0x7ff25c7d02e7 in _PyObject_Malloc /build/python3.11/../Objects/obmalloc.c:1996:1
SUMMARY: AddressSanitizer: 13628 byte(s) leaked in 6 allocation(s).
--- Cleaning up ---
---- end(-1) ----
98: perf script tests : FAILED!
```
Disable leak sanitizer when running specific perf+python tests to
avoid this. This causes the tests to pass when run with leak
sanitizer.
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-07-17 09:57:17 -07:00
|
|
|
# Disable lsan to avoid warnings about python memory leaks.
|
|
|
|
export ASAN_OPTIONS=detect_leaks=0
|
|
|
|
|
2022-12-06 10:44:06 -05:00
|
|
|
cleanup() {
|
|
|
|
rm -f perf.data
|
|
|
|
rm -f perf.data.old
|
|
|
|
rm -f csv
|
|
|
|
rm -f csvsummary
|
2023-06-13 22:11:37 +05:30
|
|
|
rm -rf "$tmpdir"
|
2022-12-06 10:44:06 -05:00
|
|
|
trap - exit term int
|
|
|
|
}
|
|
|
|
|
|
|
|
trap_cleanup() {
|
|
|
|
cleanup
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
trap trap_cleanup exit term int
|
|
|
|
|
|
|
|
report() {
|
2023-06-13 22:11:37 +05:30
|
|
|
if [ "$1" = 0 ]; then
|
2022-12-06 10:44:06 -05:00
|
|
|
echo "PASS: \"$2\""
|
|
|
|
else
|
|
|
|
echo "FAIL: \"$2\" Error message: \"$3\""
|
|
|
|
err=1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
check_exec_0() {
|
|
|
|
if [ $? != 0 ]; then
|
2023-06-13 22:11:43 +05:30
|
|
|
report 1 "invocation of $1 command failed"
|
2022-12-06 10:44:06 -05:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
find_str_or_fail() {
|
2023-06-13 22:11:37 +05:30
|
|
|
grep -q "$1" "$2"
|
|
|
|
if [ "$?" != 0 ]; then
|
|
|
|
report 1 "$3" "Failed to find required string:'${1}'."
|
2022-12-06 10:44:06 -05:00
|
|
|
else
|
2023-06-13 22:11:37 +05:30
|
|
|
report 0 "$3"
|
2022-12-06 10:44:06 -05:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
perf tests task_analyzer: Skip tests if no libtraceevent support
Test "perf script task-analyzer tests" fails in environment with missing
libtraceevent support, as perf record fails to create the perf.data
file, which further tests depend on.
Instead, when perf is not compiled with libtraceevent support, skip
those tests instead of failing them, by checking the output of `perf
record --dry-run` to see if it prints the error "libtraceevent is
necessary for tracepoint support"
For the following output, perf compiled with: `make NO_LIBTRACEEVENT=1`
Before the patch:
108: perf script task-analyzer tests :
test child forked, pid 24105
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer command failed" Error message: ""
FAIL: "test_basic" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer --ns --rename-comms-by-tids 0:random command failed" Error message: ""
FAIL: "test_ns_rename" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
<...>
perf script task-analyzer tests: FAILED!
With this patch, the script instead returns 2 signifying SKIP, and after
the patch:
108: perf script task-analyzer tests :
test child forked, pid 26010
libtraceevent is necessary for tracepoint support
WARN: Skipping tests. No libtraceevent support
test child finished with -2
perf script task-analyzer tests: Skip
Fixes: e8478b84d6ba9ccf ("perf test: Add new task-analyzer tests")
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Petar Gligoric <petar.gligoric@rohde-schwarz.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230613164145.50488-18-atrajeev@linux.vnet.ibm.com
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-06-13 22:11:45 +05:30
|
|
|
# check if perf is compiled with libtraceevent support
|
|
|
|
skip_no_probe_record_support() {
|
2024-09-05 00:31:29 +05:30
|
|
|
perf check feature -q libtraceevent && return 0
|
|
|
|
return 2
|
perf tests task_analyzer: Skip tests if no libtraceevent support
Test "perf script task-analyzer tests" fails in environment with missing
libtraceevent support, as perf record fails to create the perf.data
file, which further tests depend on.
Instead, when perf is not compiled with libtraceevent support, skip
those tests instead of failing them, by checking the output of `perf
record --dry-run` to see if it prints the error "libtraceevent is
necessary for tracepoint support"
For the following output, perf compiled with: `make NO_LIBTRACEEVENT=1`
Before the patch:
108: perf script task-analyzer tests :
test child forked, pid 24105
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer command failed" Error message: ""
FAIL: "test_basic" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer --ns --rename-comms-by-tids 0:random command failed" Error message: ""
FAIL: "test_ns_rename" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
<...>
perf script task-analyzer tests: FAILED!
With this patch, the script instead returns 2 signifying SKIP, and after
the patch:
108: perf script task-analyzer tests :
test child forked, pid 26010
libtraceevent is necessary for tracepoint support
WARN: Skipping tests. No libtraceevent support
test child finished with -2
perf script task-analyzer tests: Skip
Fixes: e8478b84d6ba9ccf ("perf test: Add new task-analyzer tests")
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Petar Gligoric <petar.gligoric@rohde-schwarz.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230613164145.50488-18-atrajeev@linux.vnet.ibm.com
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-06-13 22:11:45 +05:30
|
|
|
}
|
|
|
|
|
2022-12-06 10:44:06 -05:00
|
|
|
prepare_perf_data() {
|
|
|
|
# 1s should be sufficient to catch at least some switches
|
|
|
|
perf record -e sched:sched_switch -a -- sleep 1 > /dev/null 2>&1
|
perf tests task_analyzer: Skip tests if no libtraceevent support
Test "perf script task-analyzer tests" fails in environment with missing
libtraceevent support, as perf record fails to create the perf.data
file, which further tests depend on.
Instead, when perf is not compiled with libtraceevent support, skip
those tests instead of failing them, by checking the output of `perf
record --dry-run` to see if it prints the error "libtraceevent is
necessary for tracepoint support"
For the following output, perf compiled with: `make NO_LIBTRACEEVENT=1`
Before the patch:
108: perf script task-analyzer tests :
test child forked, pid 24105
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer command failed" Error message: ""
FAIL: "test_basic" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer --ns --rename-comms-by-tids 0:random command failed" Error message: ""
FAIL: "test_ns_rename" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
<...>
perf script task-analyzer tests: FAILED!
With this patch, the script instead returns 2 signifying SKIP, and after
the patch:
108: perf script task-analyzer tests :
test child forked, pid 26010
libtraceevent is necessary for tracepoint support
WARN: Skipping tests. No libtraceevent support
test child finished with -2
perf script task-analyzer tests: Skip
Fixes: e8478b84d6ba9ccf ("perf test: Add new task-analyzer tests")
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Petar Gligoric <petar.gligoric@rohde-schwarz.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230613164145.50488-18-atrajeev@linux.vnet.ibm.com
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-06-13 22:11:45 +05:30
|
|
|
# check if perf data file got created in above step.
|
|
|
|
if [ ! -e "perf.data" ]; then
|
|
|
|
printf "FAIL: perf record failed to create \"perf.data\" \n"
|
|
|
|
return 1
|
|
|
|
fi
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
# check standard inkvokation with no arguments
|
|
|
|
test_basic() {
|
|
|
|
out="$tmpdir/perf.out"
|
2023-06-13 22:11:37 +05:30
|
|
|
perf script report task-analyzer > "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Comm" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_ns_rename(){
|
|
|
|
out="$tmpdir/perf.out"
|
2023-06-13 22:11:37 +05:30
|
|
|
perf script report task-analyzer --ns --rename-comms-by-tids 0:random > "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --ns --rename-comms-by-tids 0:random"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Comm" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_ms_filtertasks_highlight(){
|
|
|
|
out="$tmpdir/perf.out"
|
|
|
|
perf script report task-analyzer --ms --filter-tasks perf --highlight-tasks perf \
|
2023-06-13 22:11:37 +05:30
|
|
|
> "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --ms --filter-tasks perf --highlight-tasks perf"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Comm" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_extended_times_timelimit_limittasks() {
|
|
|
|
out="$tmpdir/perf.out"
|
|
|
|
perf script report task-analyzer --extended-times --time-limit :99999 \
|
2023-06-13 22:11:37 +05:30
|
|
|
--limit-to-tasks perf > "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --extended-times --time-limit :99999 --limit-to-tasks perf"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Out-Out" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_summary() {
|
|
|
|
out="$tmpdir/perf.out"
|
2023-06-13 22:11:37 +05:30
|
|
|
perf script report task-analyzer --summary > "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --summary"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Summary" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_summaryextended() {
|
|
|
|
out="$tmpdir/perf.out"
|
2023-06-13 22:11:37 +05:30
|
|
|
perf script report task-analyzer --summary-extended > "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --summary-extended"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Inter Task Times" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_summaryonly() {
|
|
|
|
out="$tmpdir/perf.out"
|
2023-06-13 22:11:37 +05:30
|
|
|
perf script report task-analyzer --summary-only > "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --summary-only"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Summary" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_extended_times_summary_ns() {
|
|
|
|
out="$tmpdir/perf.out"
|
2023-06-13 22:11:37 +05:30
|
|
|
perf script report task-analyzer --extended-times --summary --ns > "$out"
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --extended-times --summary --ns"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Out-Out" "$out" "${FUNCNAME[0]}"
|
|
|
|
find_str_or_fail "Summary" "$out" "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_csv() {
|
|
|
|
perf script report task-analyzer --csv csv > /dev/null
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --csv csv"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Comm;" csv "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_csv_extended_times() {
|
|
|
|
perf script report task-analyzer --csv csv --extended-times > /dev/null
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --csv csv --extended-times"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Out-Out;" csv "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_csvsummary() {
|
|
|
|
perf script report task-analyzer --csv-summary csvsummary > /dev/null
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --csv-summary csvsummary"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Comm;" csvsummary "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test_csvsummary_extended() {
|
|
|
|
perf script report task-analyzer --csv-summary csvsummary --summary-extended \
|
|
|
|
>/dev/null
|
2023-06-13 22:11:44 +05:30
|
|
|
check_exec_0 "perf script report task-analyzer --csv-summary csvsummary --summary-extended"
|
2023-06-13 22:11:37 +05:30
|
|
|
find_str_or_fail "Out-Out;" csvsummary "${FUNCNAME[0]}"
|
2022-12-06 10:44:06 -05:00
|
|
|
}
|
|
|
|
|
perf tests task_analyzer: Skip tests if no libtraceevent support
Test "perf script task-analyzer tests" fails in environment with missing
libtraceevent support, as perf record fails to create the perf.data
file, which further tests depend on.
Instead, when perf is not compiled with libtraceevent support, skip
those tests instead of failing them, by checking the output of `perf
record --dry-run` to see if it prints the error "libtraceevent is
necessary for tracepoint support"
For the following output, perf compiled with: `make NO_LIBTRACEEVENT=1`
Before the patch:
108: perf script task-analyzer tests :
test child forked, pid 24105
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer command failed" Error message: ""
FAIL: "test_basic" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
FAIL: "invokation of perf script report task-analyzer --ns --rename-comms-by-tids 0:random command failed" Error message: ""
FAIL: "test_ns_rename" Error message: "Failed to find required string:'Comm'."
failed to open perf.data: No such file or directory (try 'perf record' first)
<...>
perf script task-analyzer tests: FAILED!
With this patch, the script instead returns 2 signifying SKIP, and after
the patch:
108: perf script task-analyzer tests :
test child forked, pid 26010
libtraceevent is necessary for tracepoint support
WARN: Skipping tests. No libtraceevent support
test child finished with -2
perf script task-analyzer tests: Skip
Fixes: e8478b84d6ba9ccf ("perf test: Add new task-analyzer tests")
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Petar Gligoric <petar.gligoric@rohde-schwarz.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230613164145.50488-18-atrajeev@linux.vnet.ibm.com
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-06-13 22:11:45 +05:30
|
|
|
skip_no_probe_record_support
|
|
|
|
err=$?
|
|
|
|
if [ $err -ne 0 ]; then
|
|
|
|
echo "WARN: Skipping tests. No libtraceevent support"
|
|
|
|
cleanup
|
|
|
|
exit $err
|
|
|
|
fi
|
2022-12-06 10:44:06 -05:00
|
|
|
prepare_perf_data
|
|
|
|
test_basic
|
|
|
|
test_ns_rename
|
|
|
|
test_ms_filtertasks_highlight
|
|
|
|
test_extended_times_timelimit_limittasks
|
|
|
|
test_summary
|
|
|
|
test_summaryextended
|
|
|
|
test_summaryonly
|
|
|
|
test_extended_times_summary_ns
|
|
|
|
test_csv
|
|
|
|
test_csvsummary
|
|
|
|
test_csv_extended_times
|
|
|
|
test_csvsummary_extended
|
|
|
|
cleanup
|
|
|
|
exit $err
|