mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Taeung Song <treeze.taeung@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH/RFC 4/4] perf annotate: Support a 'o' key showing addresses on the new source code view
Date: Wed, 28 Jun 2017 12:14:24 +0900	[thread overview]
Message-ID: <1498619664-856-1-git-send-email-treeze.taeung@gmail.com> (raw)

Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
---
 tools/perf/ui/browsers/annotate.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 200ee0c..bb5a933 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -402,7 +402,17 @@ static int annotate_code_browser__show_matched_dl(struct ui_browser *browser,
 		} else
 			ui_browser__set_color(browser, HE_COLORSET_NORMAL);
 
-		ui_browser__printf(browser, " %*s - ", ab->addr_width + 4, " ");
+		if (!annotate_browser__opts.use_offset) {
+			u64 addr = dl->offset + ab->start;
+
+			ui_browser__printf(browser, " - ");
+
+			if (!current_entry)
+				ui_browser__set_color(browser, HE_COLORSET_ADDR);
+			ui_browser__printf(browser, "%" PRIx64 ": ", addr);
+		} else
+			ui_browser__printf(browser, " %*s - ",
+					   ab->addr_width + 4, " ");
 
 		disasm_line__scnprintf(dl, line, sizeof(line),
 				       !annotate_browser__opts.use_offset);
@@ -938,6 +948,7 @@ static int annotate_code_browser__run(struct annotate_browser *browser,
 		"PGDN/SPACE    Navigate\n"
 		"q/ESC/CTRL+C  Return to dissembly view\n\n"
 		"ENTER         Toggle showing partial disassembly lines\n"
+		"o             Toggle showing addresses for disassembly lines\n"
 		"t             Toggle total period view\n");
 			continue;
 		case K_ENTER:
@@ -953,6 +964,10 @@ static int annotate_code_browser__run(struct annotate_browser *browser,
 				annotate_code_browser__update_nr_entries(browser);
 			}
 			continue;
+		case 'o':
+			annotate_browser__opts.use_offset =
+				!annotate_browser__opts.use_offset;
+			continue;
 		case 't':
 			annotate_browser__opts.show_total_period =
 				!annotate_browser__opts.show_total_period;
-- 
2.7.4

                 reply	other threads:[~2017-06-28  3:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1498619664-856-1-git-send-email-treeze.taeung@gmail.com \
    --to=treeze.taeung@gmail.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /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

all inboxes | Powered by JetHome®