linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Milian Wolff <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, hpa@zytor.com, jolsa@redhat.com,
	yao.jin@linux.intel.com, milian.wolff@kdab.com,
	torvalds@linux-foundation.org, tglx@linutronix.de,
	dsahern@gmail.com, linux-kernel@vger.kernel.org, acme@redhat.com,
	jolsa@kernel.org, a.p.zijlstra@chello.nl, namhyung@kernel.org,
	mingo@kernel.org, acme@kernel.org
Subject: [tip:perf/urgent] perf report: Always honor callchain order for inlined nodes
Date: Wed, 24 May 2017 00:06:04 -0700	[thread overview]
Message-ID: <tip-28071f51839e393f697d0d1df0b223a4bc373606@git.kernel.org> (raw)
In-Reply-To: <20170524062129.32529-6-namhyung@kernel.org>

Commit-ID:  28071f51839e393f697d0d1df0b223a4bc373606
Gitweb:     http://git.kernel.org/tip/28071f51839e393f697d0d1df0b223a4bc373606
Author:     Milian Wolff <milian.wolff@kdab.com>
AuthorDate: Wed, 24 May 2017 15:21:27 +0900
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 May 2017 08:41:48 +0200

perf report: Always honor callchain order for inlined nodes

So far, the inlined nodes where only reversed when we built perf
against libbfd. If that was not available, the addr2line fallback
code path was missing the inline_list__reverse call.

Now we always add the nodes in the correct order within
inline_list__append. This removes the need to reverse the list
and also ensures that all callers construct the list in the right
order.

Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yao Jin <yao.jin@linux.intel.com>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170524062129.32529-6-namhyung@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 tools/perf/util/srcline.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index 5e376d6..6af0364 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -56,7 +56,10 @@ static int inline_list__append(char *filename, char *funcname, int line_nr,
 		}
 	}
 
-	list_add_tail(&ilist->list, &node->val);
+	if (callchain_param.order == ORDER_CALLEE)
+		list_add_tail(&ilist->list, &node->val);
+	else
+		list_add(&ilist->list, &node->val);
 
 	return 0;
 }
@@ -200,14 +203,6 @@ static void addr2line_cleanup(struct a2l_data *a2l)
 
 #define MAX_INLINE_NEST 1024
 
-static void inline_list__reverse(struct inline_node *node)
-{
-	struct inline_list *ilist, *n;
-
-	list_for_each_entry_safe_reverse(ilist, n, &node->val, list)
-		list_move_tail(&ilist->list, &node->val);
-}
-
 static int addr2line(const char *dso_name, u64 addr,
 		     char **file, unsigned int *line, struct dso *dso,
 		     bool unwind_inlines, struct inline_node *node)
@@ -250,11 +245,6 @@ static int addr2line(const char *dso_name, u64 addr,
 				ret = 1;
 			}
 		}
-
-		if ((node != NULL) &&
-		    (callchain_param.order != ORDER_CALLEE)) {
-			inline_list__reverse(node);
-		}
 	}
 
 	if (file) {

  reply	other threads:[~2017-05-24  7:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24  6:21 [GIT PULL 0/7] perf/urgent callchain fixes Namhyung Kim
2017-05-24  6:21 ` [PATCH 1/7] perf report: don't crash on invalid maps in `-g srcline` mode Namhyung Kim
2017-05-24  7:03   ` [tip:perf/urgent] perf report: Don't " tip-bot for Milian Wolff
2017-05-24  6:21 ` [PATCH 2/7] perf report: fix memory leak in addr2line when called by addr2inlines Namhyung Kim
2017-05-24  7:04   ` [tip:perf/urgent] perf report: Fix " tip-bot for Milian Wolff
2017-05-24  6:21 ` [PATCH 3/7] perf report: fix off-by-one for non-activation frames Namhyung Kim
2017-05-24  7:05   ` [tip:perf/urgent] perf report: Fix " tip-bot for Milian Wolff
2017-05-24  6:21 ` [PATCH 4/7] perf script: Add --inline option Namhyung Kim
2017-05-24  6:38   ` Ingo Molnar
2017-05-24  7:13     ` Namhyung Kim
2017-05-24  7:21       ` Ingo Molnar
2017-05-24  7:53         ` Milian Wolff
2017-05-24  8:06           ` Ingo Molnar
2017-05-24  7:05   ` [tip:perf/urgent] perf script: Add --inline option for debugging tip-bot for Namhyung Kim
2017-05-24  6:21 ` [PATCH 5/7] perf report: always honor callchain order for inlined nodes Namhyung Kim
2017-05-24  7:06   ` tip-bot for Milian Wolff [this message]
2017-05-24  6:21 ` [PATCH 6/7] perf report: do not drop last inlined frame Namhyung Kim
2017-05-24  7:06   ` [tip:perf/urgent] perf report: Do " tip-bot for Milian Wolff
2017-05-24  6:21 ` [PATCH 7/7] perf tools: Fix to put caller above callee in children mode Namhyung Kim
2017-05-24  7:07   ` [tip:perf/urgent] perf tools: Put caller above callee in --children mode tip-bot for Namhyung Kim
2017-05-24  6:53 ` [GIT PULL 0/7] perf/urgent callchain fixes Ingo Molnar
2017-05-24  6:57   ` [PATCH] tools/include: Sync kernel ABI headers with tooling headers Ingo Molnar
2017-05-24  7:07     ` [tip:perf/urgent] " tip-bot for Ingo Molnar
2017-06-08 13:15 ` [GIT PULL 0/7] perf/urgent callchain fixes Milian Wolff
2017-06-08 13:59   ` Arnaldo Carvalho de Melo
2017-06-08 14:34     ` Milian Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-28071f51839e393f697d0d1df0b223a4bc373606@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=milian.wolff@kdab.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).