diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 281053b..a067be8 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -421,15 +421,20 @@ iter_prepare_cumulative_entry(struct add_entry_iter *iter, return -ENOMEM; node = callchain_cursor_current(&callchain_cursor); - if (node == NULL) + if (node == NULL) { + struct cumulative_cache *tmp = iter->priv; + ccache[0].dso = tmp[0].dso; + ccache[0].sym = tmp[0].sym; + iter->priv = ccache; return 0; - - ccache[0].dso = node->map->dso; - ccache[0].sym = node->sym; + } iter->priv = ccache; iter->curr = 1; + ccache[0].dso = node->map->dso; + ccache[0].sym = node->sym; + /* * The first callchain node always contains same information * as a hist entry itself. So skip it in order to prevent