Thread (11 messages) 11 messages, 6 authors, 2011-06-15

Re: [PATCH] [perf] Add inverted call graph report support.

From: Arun Sharma <hidden>
Date: 2011-06-09 20:13:08
Also in: lkml

On 6/9/11 1:10 PM, David Ahern wrote:

On 06/09/2011 01:33 PM, Arun Sharma wrote:
quoted
On Thu, Jun 09, 2011 at 02:44:19PM +0800, Sam Liao wrote:
quoted
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -247,9 +247,14 @@ int perf_session__resolve_callchain(struct
perf_session *self,
  	callchain_cursor_reset(&self->callchain_cursor);

  	for (i = 0; i<  chain->nr; i++) {
-		u64 ip = chain->ips[i];
+		u64 ip;
  		struct addr_location al;

+		if (callchain_param.order == ORDER_CALLEE)
+			ip = chain->ips[i];
+		else
+			ip = chain->ips[chain->nr - i - 1];
This can dereference a bad pointer if chain->nr == 0.
Should not enter the loop if chain->nr is 0 (See for arg).
Ah right. I had this problem with an earlier version of the patch. This 
version seems to be fine.

  -Arun
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help