Skip to content

Commit 8617e2e

Browse files
captain5050acmel
authored andcommitted
perf tests: Don't tail call optimize in unwind test
The tail call optimization can unexpectedly make the stack smaller and cause the test to fail. Signed-off-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: Jakub Kicinski <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Quentin Monnet <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 21f2b7c commit 8617e2e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/perf/tests/dwarf-unwind.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static int unwind_entry(struct unwind_entry *entry, void *arg)
9494
return strcmp((const char *) symbol, funcs[idx]);
9595
}
9696

97-
noinline int test_dwarf_unwind__thread(struct thread *thread)
97+
__no_tail_call noinline int test_dwarf_unwind__thread(struct thread *thread)
9898
{
9999
struct perf_sample sample;
100100
unsigned long cnt = 0;
@@ -125,7 +125,7 @@ noinline int test_dwarf_unwind__thread(struct thread *thread)
125125

126126
static int global_unwind_retval = -INT_MAX;
127127

128-
noinline int test_dwarf_unwind__compare(void *p1, void *p2)
128+
__no_tail_call noinline int test_dwarf_unwind__compare(void *p1, void *p2)
129129
{
130130
/* Any possible value should be 'thread' */
131131
struct thread *thread = *(struct thread **)p1;
@@ -144,7 +144,7 @@ noinline int test_dwarf_unwind__compare(void *p1, void *p2)
144144
return p1 - p2;
145145
}
146146

147-
noinline int test_dwarf_unwind__krava_3(struct thread *thread)
147+
__no_tail_call noinline int test_dwarf_unwind__krava_3(struct thread *thread)
148148
{
149149
struct thread *array[2] = {thread, thread};
150150
void *fp = &bsearch;
@@ -163,12 +163,12 @@ noinline int test_dwarf_unwind__krava_3(struct thread *thread)
163163
return global_unwind_retval;
164164
}
165165

166-
noinline int test_dwarf_unwind__krava_2(struct thread *thread)
166+
__no_tail_call noinline int test_dwarf_unwind__krava_2(struct thread *thread)
167167
{
168168
return test_dwarf_unwind__krava_3(thread);
169169
}
170170

171-
noinline int test_dwarf_unwind__krava_1(struct thread *thread)
171+
__no_tail_call noinline int test_dwarf_unwind__krava_1(struct thread *thread)
172172
{
173173
return test_dwarf_unwind__krava_2(thread);
174174
}

0 commit comments

Comments
 (0)