Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753563AbaANFaL (ORCPT ); Tue, 14 Jan 2014 00:30:11 -0500 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:46794 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbaANF0F (ORCPT ); Tue, 14 Jan 2014 00:26:05 -0500 X-AuditID: 9c93016f-b7b1aae000000f15-9f-52d4ca676cd3 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Paul Mackerras , Ingo Molnar , Namhyung Kim , LKML , Jiri Olsa , Rodrigo Campos , Andi Kleen , Arun Sharma , Frederic Weisbecker Subject: [PATCH 11/24] perf tools: Save callchain info for each cumulative entry Date: Tue, 14 Jan 2014 14:25:44 +0900 Message-Id: <1389677157-30513-12-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1389677157-30513-1-git-send-email-namhyung@kernel.org> References: <1389677157-30513-1-git-send-email-namhyung@kernel.org> X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When accumulating callchain entry, also save current snapshot of the chain so that it can show the rest of the chain. Cc: Arun Sharma Cc: Frederic Weisbecker Signed-off-by: Namhyung Kim --- tools/perf/util/hist.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 1b477f8d2d17..765ac5953201 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -744,6 +744,14 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter, he_cache[iter->curr++] = he; + callchain_append(he->callchain, &callchain_cursor, sample->period); + + /* + * We need to re-initialize the cursor since callchain_append() + * advanced the cursor to the end. + */ + callchain_cursor_commit(&callchain_cursor); + return hist_entry__inc_addr_samples(he, evsel->idx, al->addr); } @@ -757,8 +765,6 @@ iter_next_cumulative_entry(struct hist_entry_iter *iter, if (node == NULL) return 0; - callchain_cursor_advance(&callchain_cursor); - return fill_callchain_info(al, node, iter->hide_unresolved); } @@ -782,6 +788,11 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, .parent = iter->parent, }; int i; + struct callchain_cursor cursor; + + callchain_cursor_snapshot(&cursor, &callchain_cursor); + + callchain_cursor_advance(&callchain_cursor); /* * Check if there's duplicate entries in the callchain. @@ -800,6 +811,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, he_cache[iter->curr++] = he; + callchain_append(he->callchain, &cursor, sample->period); + return hist_entry__inc_addr_samples(he, evsel->idx, al->addr); } -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/