Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tests: Fix test_arm_callgraph_fp variable expansion

$TEST_PROGRAM is a command with spaces so it's supposed to be word
split. The referenced fix to fix the shellcheck warnings incorrectly
quoted this string so unquote it to fix the test.

At the same time silence the shellcheck warning for that line and fix
two more shellcheck errors at the end of the script.

Fixes: 1bb17b4c6c91 ("perf tests arm_callgraph_fp: Address shellcheck warnings about signal names and adding double quotes for expression")
Signed-off-by: James Clark <james.clark@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: spoorts2@in.ibm.com
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Link: https://lore.kernel.org/r/20230622101809.2431897-1-james.clark@arm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

James Clark and committed by
Namhyung Kim
33fe7c08 765be32b

+4 -3
+4 -3
tools/perf/tests/shell/test_arm_callgraph_fp.sh
··· 15 15 trap cleanup_files EXIT TERM INT 16 16 17 17 # Add a 1 second delay to skip samples that are not in the leaf() function 18 - perf record -o "$PERF_DATA" --call-graph fp -e cycles//u -D 1000 --user-callchains -- "$TEST_PROGRAM" 2> /dev/null & 18 + # shellcheck disable=SC2086 19 + perf record -o "$PERF_DATA" --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null & 19 20 PID=$! 20 21 21 22 echo " + Recording (PID=$PID)..." ··· 34 33 # 76c leafloop 35 34 # ... 36 35 37 - perf script -i $PERF_DATA -F comm,ip,sym | head -n4 38 - perf script -i $PERF_DATA -F comm,ip,sym | head -n4 | \ 36 + perf script -i "$PERF_DATA" -F comm,ip,sym | head -n4 37 + perf script -i "$PERF_DATA" -F comm,ip,sym | head -n4 | \ 39 38 awk '{ if ($2 != "") sym[i++] = $2 } END { if (sym[0] != "leaf" || 40 39 sym[1] != "parent" || 41 40 sym[2] != "leafloop") exit 1 }'