linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [perf] fix annotation loading when symbol sort order not used.
@ 2011-06-11 18:09 Sam Liao
  2011-06-14 22:03 ` Arun Sharma
  0 siblings, 1 reply; 2+ messages in thread
From: Sam Liao @ 2011-06-11 18:09 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel

When "symbol" is not in "-s" sort order options, the hist entry's
ms.sym is not equal to sample's addr_location.sym where we should
not load annotation. This fix check if symbol sort order used, if
not, disable symbol annonation for report command in tui mode.
---
 tools/perf/builtin-report.c |    2 +-
 tools/perf/util/sort.c      |    5 +++++
 tools/perf/util/sort.h      |    1 +
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2ceac45..83ba06b 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -79,7 +79,7 @@ static int perf_session__add_hist_entry(struct
perf_session *session,
 	 * so we don't allocated the extra space needed because the stdio
 	 * code will not use it.
 	 */
-	if (al->sym != NULL && use_browser > 0) {
+	if (sort__has_symbol && al->sym != NULL && use_browser > 0) {
 		struct annotation *notes = symbol__annotation(he->ms.sym);

 		assert(evsel != NULL);
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index f44fa54..a6e1e13 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -8,6 +8,7 @@ const char	default_sort_order[] = "comm,dso,symbol";
 const char	*sort_order = default_sort_order;
 int		sort__need_collapse = 0;
 int		sort__has_parent = 0;
+int		sort__has_symbol = 0;

 enum sort_type	sort__first_dimension;

@@ -294,6 +295,10 @@ int sort_dimension__add(const char *tok)
 			sort__has_parent = 1;
 		}

+		if (sd->entry == &sort_sym) {
+			sort__has_symbol = 1;
+		}
+
 		if (list_empty(&hist_entry__sort_list)) {
 			if (!strcmp(sd->name, "pid"))
 				sort__first_dimension = SORT_PID;
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 0b91053..404de31 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -31,6 +31,7 @@ extern const char *parent_pattern;
 extern const char default_sort_order[];
 extern int sort__need_collapse;
 extern int sort__has_parent;
+extern int sort__has_symbol;
 extern char *field_sep;
 extern struct sort_entry sort_comm;
 extern struct sort_entry sort_dso;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [perf] fix annotation loading when symbol sort order not used.
  2011-06-11 18:09 [PATCH] [perf] fix annotation loading when symbol sort order not used Sam Liao
@ 2011-06-14 22:03 ` Arun Sharma
  0 siblings, 0 replies; 2+ messages in thread
From: Arun Sharma @ 2011-06-14 22:03 UTC (permalink / raw)
  To: Sam Liao; +Cc: linux-perf-users, linux-kernel

On Sun, Jun 12, 2011 at 02:09:40AM +0800, Sam Liao wrote:
> When "symbol" is not in "-s" sort order options, the hist entry's
> ms.sym is not equal to sample's addr_location.sym where we should
> not load annotation. This fix check if symbol sort order used, if
> not, disable symbol annonation for report command in tui mode.

Thanks for taking care of this. Works well for me.

 -Arun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-14 22:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-11 18:09 [PATCH] [perf] fix annotation loading when symbol sort order not used Sam Liao
2011-06-14 22:03 ` Arun Sharma

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).