When it records callchains, they will always have 2 scheduler functions
(__schedule + schedule or __schedule + preempt_schedule) and get
ignored.  So it should collect 2 more functions to show the expected
number of callchains to user.

Cc: David Ahern <dsah...@gmail.com>
Signed-off-by: Namhyung Kim <namhy...@kernel.org>
---
 tools/perf/builtin-sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 06be809a02ab..a49a032f5b15 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1960,7 +1960,7 @@ static bool is_idle_sample(struct perf_sched *sched,
                return false;
 
        if (thread__resolve_callchain(thread, cursor, evsel, sample,
-                                     NULL, NULL, sched->max_stack) != 0) {
+                                     NULL, NULL, sched->max_stack + 2) != 0) {
                if (verbose)
                        error("Failed to resolve callchain. Skipping\n");
 
-- 
2.10.0

Reply via email to