lkml.org 
[lkml]   [2014]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/26] perf tools: Save callchain info for each cumulative entry
Date
When accumulating callchain entry, also save current snapshot of the
chain so that it can show the rest of the chain.

Tested-by: Arun Sharma <asharma@fb.com>
Tested-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
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 b3faabf3d2c2..de13f0a12940 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -741,6 +741,14 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter,
iter->he = he;
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);
}

@@ -754,8 +762,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);
}

@@ -779,6 +785,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.
@@ -797,6 +808,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.9.2


\
 
 \ /
  Last update: 2014-05-24 08:41    [W:0.168 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site