Skip to contentSkip to conversation

perf annotate: Move 'start' to struct annotation

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Mar 25, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  0ca693b315aa6893c9d3552fa6a5d536c38b6c4a
Gitweb:     https://git.kernel.org/tip/0ca693b315aa6893c9d3552fa6a5d536c38b6c4a
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 15 Mar 2018 15:46:22 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 20 Mar 2018 13:19:29 -0300

perf annotate: Move 'start' to struct annotation

Another field that is not TUI specific.

---
 tools/perf/ui/browsers/annotate.c | 5 ++---
 tools/perf/util/annotate.h        | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/ui/browsers/annotate.c +2 -3
index 50f8e671644f..7ec441f93f7e 100644
@@ -35,7 +35,6 @@ struct annotate_browser {
 	struct rb_node		   *curr_hot;
 	struct annotation_line	   *selection;
 	struct arch		   *arch;
-	u64			    start;
 	int			    nr_asm_entries;
 	int			    nr_entries;
 	bool			    searching_backwards;
@@ -208,7 +207,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 		int color = -1;
 
 		if (!notes->options->use_offset)
-			addr += ab->start;
+			addr += notes->start;
 
 		if (!notes->options->use_offset) {
 			printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
@@ -991,7 +990,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
 
 	ui_helpline__push("Press ESC to exit");
 
-	browser.start = map__rip_2objdump(map, sym->start);
+	notes->start = map__rip_2objdump(map, sym->start);
 
 	list_for_each_entry(al, &notes->src->source, node) {
 		size_t line_len = strlen(al->line);
tools/perf/util/annotate.h +1 -0
index 2018a47790c7..0424c127b004 100644
@@ -169,6 +169,7 @@ struct annotated_source {
 struct annotation {
 	pthread_mutex_t		lock;
 	u64			max_coverage;
+	u64			start;
 	struct annotation_options *options;
 	struct annotation_line	**offsets;
 	int			nr_events;