* [PATCH 0/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in
@ 2024-01-23 16:39 James Clark
2024-01-23 16:39 ` [PATCH 1/2] perf version: Display availability of HAVE_DWARF_UNWIND_SUPPORT James Clark
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: James Clark @ 2024-01-23 16:39 UTC (permalink / raw)
To: linux-perf-users, irogers
Cc: James Clark, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Spoorthy S,
Kajol Jain, linux-kernel
The first commit outputs the unwinding feature definition in perf
version so that the script can gate on it. And then skip the test if
it's not present.
I didn't add any fixes tags because it's modifying the perf version
output, requires both commits, and it's just for a test skip change so
I don't think backporting makes sense.
James Clark (2):
perf version: Display availability of HAVE_DWARF_UNWIND_SUPPORT
perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in
tools/perf/builtin-version.c | 1 +
tools/perf/tests/shell/test_arm_callgraph_fp.sh | 6 ++++++
2 files changed, 7 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] perf version: Display availability of HAVE_DWARF_UNWIND_SUPPORT
2024-01-23 16:39 [PATCH 0/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
@ 2024-01-23 16:39 ` James Clark
2024-01-23 16:39 ` [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
2024-01-25 21:45 ` [PATCH 0/2] " Namhyung Kim
2 siblings, 0 replies; 7+ messages in thread
From: James Clark @ 2024-01-23 16:39 UTC (permalink / raw)
To: linux-perf-users, irogers
Cc: James Clark, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Spoorthy S,
Athira Rajeev, linux-kernel
Even though unwinding depends on either HAVE_DWARF_SUPPORT or
HAVE_LIBUNWIND, scripts testing unwinding can't just look for the
existence of either of those flags. This is because
NO_LIBDW_DWARF_UNWIND=1 can disable unwinding with libdw, but libdw will
still be linked leaving HAVE_DWARF_SUPPORT turned on. Presumably because
it is used for things other than unwinding, so I don't think this needs
to be fixed.
HAVE_DWARF_UNWIND_SUPPORT already takes the combination of all those
things into account, and is used to gate the built in tests like "Test
dwarf unwind", so add it to the feature list output so that it can be
used by the script tests too.
Signed-off-by: James Clark <james.clark@arm.com>
---
tools/perf/builtin-version.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
index ac20c2b9bbc2..529e9ce8c46c 100644
--- a/tools/perf/builtin-version.c
+++ b/tools/perf/builtin-version.c
@@ -82,6 +82,7 @@ static void library_status(void)
STATUS(HAVE_LIBPFM, libpfm4);
STATUS(HAVE_LIBTRACEEVENT, libtraceevent);
STATUS(HAVE_BPF_SKEL, bpf_skeletons);
+ STATUS(HAVE_DWARF_UNWIND_SUPPORT, dwarf-unwind-support);
}
int cmd_version(int argc, const char **argv)
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in
2024-01-23 16:39 [PATCH 0/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
2024-01-23 16:39 ` [PATCH 1/2] perf version: Display availability of HAVE_DWARF_UNWIND_SUPPORT James Clark
@ 2024-01-23 16:39 ` James Clark
2024-01-23 17:41 ` Ian Rogers
2024-01-25 21:45 ` [PATCH 0/2] " Namhyung Kim
2 siblings, 1 reply; 7+ messages in thread
From: James Clark @ 2024-01-23 16:39 UTC (permalink / raw)
To: linux-perf-users, irogers
Cc: James Clark, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kajol Jain,
Spoorthy S, linux-kernel
Even though this is a frame pointer unwind test, it's testing that a
frame pointer stack can be augmented correctly with a partial
Dwarf unwind. So add a feature check so that this test skips instead of
fails if Dwarf unwinding isn't present.
Signed-off-by: James Clark <james.clark@arm.com>
---
tools/perf/tests/shell/test_arm_callgraph_fp.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
index e342e6c8aa50..83b53591b1ea 100755
--- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh
+++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
@@ -8,6 +8,12 @@ shelldir=$(dirname "$0")
lscpu | grep -q "aarch64" || exit 2
+if perf version --build-options | grep HAVE_DWARF_UNWIND_SUPPORT | grep -q OFF
+then
+ echo "Skipping, no dwarf unwind support"
+ exit 2
+fi
+
skip_test_missing_symbol leafloop
PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in
2024-01-23 16:39 ` [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
@ 2024-01-23 17:41 ` Ian Rogers
2024-01-24 9:24 ` James Clark
0 siblings, 1 reply; 7+ messages in thread
From: Ian Rogers @ 2024-01-23 17:41 UTC (permalink / raw)
To: James Clark
Cc: linux-perf-users, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kajol Jain,
Spoorthy S, linux-kernel
On Tue, Jan 23, 2024 at 8:39 AM James Clark <james.clark@arm.com> wrote:
>
> Even though this is a frame pointer unwind test, it's testing that a
> frame pointer stack can be augmented correctly with a partial
> Dwarf unwind. So add a feature check so that this test skips instead of
> fails if Dwarf unwinding isn't present.
Hi James,
Is there value in testing without the partial Dwarf unwind? Presumably
that is covered by the existing dwarf unwind test?
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/dwarf-unwind.c?h=perf-tools-next
If the issue is inlined functions I'm surprised addr2line isn't doing
the job properly. Is there an addr2line perf script issue here?
Thanks,
Ian
> Signed-off-by: James Clark <james.clark@arm.com>
> ---
> tools/perf/tests/shell/test_arm_callgraph_fp.sh | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
> index e342e6c8aa50..83b53591b1ea 100755
> --- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh
> +++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
> @@ -8,6 +8,12 @@ shelldir=$(dirname "$0")
>
> lscpu | grep -q "aarch64" || exit 2
>
> +if perf version --build-options | grep HAVE_DWARF_UNWIND_SUPPORT | grep -q OFF
> +then
> + echo "Skipping, no dwarf unwind support"
> + exit 2
> +fi
> +
> skip_test_missing_symbol leafloop
>
> PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in
2024-01-23 17:41 ` Ian Rogers
@ 2024-01-24 9:24 ` James Clark
2024-01-24 18:30 ` Ian Rogers
0 siblings, 1 reply; 7+ messages in thread
From: James Clark @ 2024-01-24 9:24 UTC (permalink / raw)
To: Ian Rogers
Cc: linux-perf-users, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kajol Jain,
Spoorthy S, linux-kernel
On 23/01/2024 17:41, Ian Rogers wrote:
> On Tue, Jan 23, 2024 at 8:39 AM James Clark <james.clark@arm.com> wrote:
>>
>> Even though this is a frame pointer unwind test, it's testing that a
>> frame pointer stack can be augmented correctly with a partial
>> Dwarf unwind. So add a feature check so that this test skips instead of
>> fails if Dwarf unwinding isn't present.
>
> Hi James,
>
> Is there value in testing without the partial Dwarf unwind? Presumably
Yeah I think we could add a test for just --call-graph=fp, I don't think
there is one. But that would be separate to this test, and would be
redundant if the tests are run with a dwarf unwinder present because
this test already requires the frame pointer unwinder to be correct.
> that is covered by the existing dwarf unwind test?
There is no overlap, this test test is for --call-graph=fp, and the
dwarf test is for --call-graph=dwarf
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/dwarf-unwind.c?h=perf-tools-next
> If the issue is inlined functions I'm surprised addr2line isn't doing
> the job properly. Is there an addr2line perf script issue here?
>
The issue isn't inlined functions, it's when the leaf frame doesn't
insert a frame pointer. In that case we use the link register to see
what the parent function of the leaf frame was and insert it into the
frame pointer stack.
Dwarf is only used in this case to confirm if the link register was
valid at that instruction.
See commit b9f6fbb for more info. Long story short this test was only
added for that feature and it requires a dwarf unwinder to pass despite
being called test_arm_callgraph_fp
> Thanks,
> Ian
>
>> Signed-off-by: James Clark <james.clark@arm.com>
>> ---
>> tools/perf/tests/shell/test_arm_callgraph_fp.sh | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
>> index e342e6c8aa50..83b53591b1ea 100755
>> --- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh
>> +++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
>> @@ -8,6 +8,12 @@ shelldir=$(dirname "$0")
>>
>> lscpu | grep -q "aarch64" || exit 2
>>
>> +if perf version --build-options | grep HAVE_DWARF_UNWIND_SUPPORT | grep -q OFF
>> +then
>> + echo "Skipping, no dwarf unwind support"
>> + exit 2
>> +fi
>> +
>> skip_test_missing_symbol leafloop
>>
>> PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
>> --
>> 2.34.1
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in
2024-01-24 9:24 ` James Clark
@ 2024-01-24 18:30 ` Ian Rogers
0 siblings, 0 replies; 7+ messages in thread
From: Ian Rogers @ 2024-01-24 18:30 UTC (permalink / raw)
To: James Clark
Cc: linux-perf-users, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kajol Jain,
Spoorthy S, linux-kernel
On Wed, Jan 24, 2024 at 1:24 AM James Clark <james.clark@arm.com> wrote:
>
>
>
> On 23/01/2024 17:41, Ian Rogers wrote:
> > On Tue, Jan 23, 2024 at 8:39 AM James Clark <james.clark@arm.com> wrote:
> >>
> >> Even though this is a frame pointer unwind test, it's testing that a
> >> frame pointer stack can be augmented correctly with a partial
> >> Dwarf unwind. So add a feature check so that this test skips instead of
> >> fails if Dwarf unwinding isn't present.
> >
> > Hi James,
> >
> > Is there value in testing without the partial Dwarf unwind? Presumably
>
> Yeah I think we could add a test for just --call-graph=fp, I don't think
> there is one. But that would be separate to this test, and would be
> redundant if the tests are run with a dwarf unwinder present because
> this test already requires the frame pointer unwinder to be correct.
>
> > that is covered by the existing dwarf unwind test?
>
> There is no overlap, this test test is for --call-graph=fp, and the
> dwarf test is for --call-graph=dwarf
>
> > https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/dwarf-unwind.c?h=perf-tools-next
> > If the issue is inlined functions I'm surprised addr2line isn't doing
> > the job properly. Is there an addr2line perf script issue here?
> >
>
> The issue isn't inlined functions, it's when the leaf frame doesn't
> insert a frame pointer. In that case we use the link register to see
> what the parent function of the leaf frame was and insert it into the
> frame pointer stack.
>
> Dwarf is only used in this case to confirm if the link register was
> valid at that instruction.
>
> See commit b9f6fbb for more info. Long story short this test was only
> added for that feature and it requires a dwarf unwinder to pass despite
> being called test_arm_callgraph_fp
Ok, not directly seeing b9f6fbb being dependent on
HAVE_DWARF_UNWIND_SUPPORT. I'll assume I'm ignorant and the fix here
is obviously a workaround.
For the series:
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks,
Ian
> > Thanks,
> > Ian
> >
>
>
> >> Signed-off-by: James Clark <james.clark@arm.com>
> >> ---
> >> tools/perf/tests/shell/test_arm_callgraph_fp.sh | 6 ++++++
> >> 1 file changed, 6 insertions(+)
> >>
> >> diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
> >> index e342e6c8aa50..83b53591b1ea 100755
> >> --- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh
> >> +++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
> >> @@ -8,6 +8,12 @@ shelldir=$(dirname "$0")
> >>
> >> lscpu | grep -q "aarch64" || exit 2
> >>
> >> +if perf version --build-options | grep HAVE_DWARF_UNWIND_SUPPORT | grep -q OFF
> >> +then
> >> + echo "Skipping, no dwarf unwind support"
> >> + exit 2
> >> +fi
> >> +
> >> skip_test_missing_symbol leafloop
> >>
> >> PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
> >> --
> >> 2.34.1
> >>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in
2024-01-23 16:39 [PATCH 0/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
2024-01-23 16:39 ` [PATCH 1/2] perf version: Display availability of HAVE_DWARF_UNWIND_SUPPORT James Clark
2024-01-23 16:39 ` [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
@ 2024-01-25 21:45 ` Namhyung Kim
2 siblings, 0 replies; 7+ messages in thread
From: Namhyung Kim @ 2024-01-25 21:45 UTC (permalink / raw)
To: James Clark, linux-perf-users, irogers
Cc: linux-kernel, Spoorthy S, Peter Zijlstra, Adrian Hunter,
Arnaldo Carvalho de Melo, Alexander Shishkin, Kajol Jain,
Mark Rutland, Jiri Olsa, Ingo Molnar
On Tue, 23 Jan 2024 16:39:00 +0000, James Clark wrote:
> The first commit outputs the unwinding feature definition in perf
> version so that the script can gate on it. And then skip the test if
> it's not present.
>
> I didn't add any fixes tags because it's modifying the perf version
> output, requires both commits, and it's just for a test skip change so
> I don't think backporting makes sense.
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
--
Namhyung Kim <namhyung@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-01-25 21:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 16:39 [PATCH 0/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
2024-01-23 16:39 ` [PATCH 1/2] perf version: Display availability of HAVE_DWARF_UNWIND_SUPPORT James Clark
2024-01-23 16:39 ` [PATCH 2/2] perf test: Skip test_arm_callgraph_fp.sh if unwinding isn't built in James Clark
2024-01-23 17:41 ` Ian Rogers
2024-01-24 9:24 ` James Clark
2024-01-24 18:30 ` Ian Rogers
2024-01-25 21:45 ` [PATCH 0/2] " Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).