Commit be7f855a authored by Namhyung Kim's avatar Namhyung Kim Committed by Jiri Olsa

perf tools: Save callchain info for each cumulative entry

When accumulating callchain entry, also save current snapshot of the
chain so that it can show the rest of the chain.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Tested-by: default avatarArun Sharma <asharma@fb.com>
Tested-by: default avatarRodrigo Campos <rodrigo@sdfg.com.ar>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1401335910-16832-10-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
parent be1f13e3
...@@ -738,6 +738,14 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter, ...@@ -738,6 +738,14 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter,
iter->he = he; iter->he = he;
he_cache[iter->curr++] = 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);
/* /*
* The iter->he will be over-written after ->add_next_entry() * The iter->he will be over-written after ->add_next_entry()
* called so inc stats for the original entry now. * called so inc stats for the original entry now.
...@@ -760,8 +768,6 @@ iter_next_cumulative_entry(struct hist_entry_iter *iter, ...@@ -760,8 +768,6 @@ iter_next_cumulative_entry(struct hist_entry_iter *iter,
if (node == NULL) if (node == NULL)
return 0; return 0;
callchain_cursor_advance(&callchain_cursor);
return fill_callchain_info(al, node, iter->hide_unresolved); return fill_callchain_info(al, node, iter->hide_unresolved);
} }
...@@ -785,6 +791,11 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, ...@@ -785,6 +791,11 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
.parent = iter->parent, .parent = iter->parent,
}; };
int i; 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. * Check if there's duplicate entries in the callchain.
...@@ -804,6 +815,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, ...@@ -804,6 +815,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
iter->he = he; iter->he = he;
he_cache[iter->curr++] = he; he_cache[iter->curr++] = he;
callchain_append(he->callchain, &cursor, sample->period);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment