perf annotate: Move 'start' to struct annotation
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Mar 2018 18:46:22 +0000 (15:46 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Mar 2018 16:19:29 +0000 (13:19 -0300)
Another field that is not TUI specific.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-jj3dwswndft5mln8hu9k0idv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/annotate.c
tools/perf/util/annotate.h

index 50f8e671644f6655e9ae10a463a275e3064be74b..7ec441f93f7e4992c58f40a18f9b22ae38fde122 100644 (file)
@@ -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);
index 2018a47790c7a5f7a95ca98f72029fe6f6a95ad5..0424c127b0049ba57f17122ccec9392bb4281b7b 100644 (file)
@@ -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;