[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b72ee8f2-1dae-49a4-b89e-4d5453c8834f@intel.com>
Date: Tue, 5 Dec 2023 21:22:14 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Ian Rogers <irogers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] perf test: Skip diff test if test_loop is missing
On 5/12/23 18:49, Ian Rogers wrote:
> The diff test depends on finding the symbol test_loop in perf and will
> fail if perf has been stripped and no debug object is available. In
> that case, skip the test instead.
>
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> tools/perf/tests/shell/diff.sh | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/tools/perf/tests/shell/diff.sh b/tools/perf/tests/shell/diff.sh
> index 213185763688..14b87af88703 100755
> --- a/tools/perf/tests/shell/diff.sh
> +++ b/tools/perf/tests/shell/diff.sh
> @@ -9,8 +9,15 @@ perfdata1=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
> perfdata2=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
> perfdata3=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
> testprog="perf test -w thloop"
> +
> +shelldir=$(dirname "$0")
> +# shellcheck source=lib/perf_has_symbol.sh
> +. "${shelldir}"/lib/perf_has_symbol.sh
> +
> testsym="test_loop"
>
> +skip_test_missing_symbol ${testsym}
> +
> cleanup() {
> rm -rf "${perfdata1}"
> rm -rf "${perfdata1}".old
The verbose output in the error case could also
be tweaked.
Before patch:
$ strip tools/perf/perf
$ tools/perf/perf buildid-cache -p $(realpath tools/perf/perf)
$ tools/perf/perf test -v 'diff test'
85: perf diff tests :
--- start ---
test child forked, pid 8621
Basic two file diff test
./tools/perf/tests/shell/diff.sh: 51: [: Workload: unexpected operator
./tools/perf/tests/shell/diff.sh: 56: [: Workload: unexpected operator
Basic two file diff test [Failed diff]
Basic three file diff test
./tools/perf/tests/shell/diff.sh: 73: [: Workload: unexpected operator
./tools/perf/tests/shell/diff.sh: 78: [: Workload: unexpected operator
./tools/perf/tests/shell/diff.sh: 83: [: Workload: unexpected operator
Basic three file diff test [Failed diff]
test child finished with -1
---- end ----
perf diff tests: FAILED!
After patch:
$ tools/perf/perf test -v 'diff test'
85: perf diff tests :
--- start ---
test child forked, pid 8853
perf does not have symbol 'test_loop'
perf is missing symbols - skipping test
test child finished with -2
---- end ----
perf diff tests: Skip
and with symbols:
$ tools/perf/perf test -v 'diff test'
85: perf diff tests :
--- start ---
test child forked, pid 10122
103e20-103e60 g test_loop
perf does have symbol 'test_loop'
Basic two file diff test
Basic two file diff test [Success]
Basic three file diff test
Basic three file diff test [Success]
test child finished with 0
---- end ----
perf diff tests: Ok
Tested-by: Adrian Hunter <adrian.hunter@...el.com>
Powered by blists - more mailing lists