[PATCH 0/3] perf tools: Fix test "perf probe of function from different CU"

From: Chaitanya S Prakash
Date: Mon Feb 19 2024 - 23:30:31 EST


From: Chaitanya S Prakash <chaitanyas.prakash@xxxxxxx>

Defconfig doesn't provide all the necessary configs required for the
test "perf probe of function from different CU" to run successfully on
all platforms. Therefore the required configs have been added to
config fragments to resolve this issue. On further investigation it was
seen that the Perf treated all files beginning with "/tmp/perf-" as a
map file despite them always ending in ".map", this caused the test to
fail when Perf was built with NO_DWARF=1. As the file was parsed as a
map file, the probe...--funcs command output garbage values instead of
listing the functions in the binary. After fixing the issue an
additional check to test the output of the probe...--funcs command has
been added.

This patch series has been tested on 6.8-rc3 mainline kernerl, both on
arm64 and x86 platforms.

Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: James Clark <james.clark@xxxxxxx>
Cc: Georg Müller <georgmueller@xxxxxxx>
Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cc: Liam Howlett <liam.howlett@xxxxxxxxxx>
Cc: Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
Cc: linux-perf-users@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

Chaitanya S Prakash (3):
perf tools: Enable configs required for
test_uprobe_from_different_cu.sh
perf tools: Only treat files as map files when they have the extension
.map
perf test: Check output of the probe ... --funcs command

tools/perf/builtin-script.c | 15 +--------------
tools/perf/tests/config-fragments/config | 3 +++
.../shell/test_uprobe_from_different_cu.sh | 2 +-
tools/perf/util/string.c | 18 ++++++++++++++++++
tools/perf/util/string2.h | 1 +
tools/perf/util/symbol.c | 5 ++++-
6 files changed, 28 insertions(+), 16 deletions(-)

--
2.34.1