summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaitanya S Prakash <chaitanyas.prakash@arm.com>2024-06-01 15:59:46 +0300
committerNamhyung Kim <namhyung@kernel.org>2024-06-25 21:06:19 +0300
commitabc0f0c444f1c485320961c98edf27737b465e03 (patch)
tree53aa3ee2a2ffefaf4cc94bb4dd03ac4a08d62b6f
parent7d49ced808b169c8cb754da15a69ed0b2fb26567 (diff)
downloadlinux-abc0f0c444f1c485320961c98edf27737b465e03.tar.xz
perf test: Check output of the probe ... --funcs command
Test "perf probe of function from different CU" only checks if the perf command has failed and doesn't test the --funcs output. In the issue reported in the previous commit, the garbage output of the --funcs command was being ignored by the test when it could have been caught. The script first makes use of --funcs option with the perf probe command to check if the function "foo" exists in the testfile before adding a probe to it in the next command. The output of probe...--funcs command is redirected to stdout, therefore, add '| grep "foo"' to validate the result. Signed-off-by: Chaitanya S Prakash <chaitanyas.prakash@arm.com> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Cc: anshuman.khandual@arm.com Cc: james.clark@arm.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240601125946.1741414-11-ChaitanyaS.Prakash@arm.com
-rwxr-xr-xtools/perf/tests/shell/test_uprobe_from_different_cu.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
index 319f36ebb9a4..82bc774a078a 100755
--- a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
+++ b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
@@ -77,7 +77,7 @@ gcc -g -Og -flto -c ${temp_dir}/testfile-foo.c -o ${temp_dir}/testfile-foo.o
gcc -g -Og -c ${temp_dir}/testfile-main.c -o ${temp_dir}/testfile-main.o
gcc -g -Og -o ${temp_dir}/testfile ${temp_dir}/testfile-foo.o ${temp_dir}/testfile-main.o
-perf probe -x ${temp_dir}/testfile --funcs foo
+perf probe -x ${temp_dir}/testfile --funcs foo | grep "foo"
perf probe -x ${temp_dir}/testfile foo
cleanup