]> www.infradead.org Git - users/hch/misc.git/commitdiff
perf annotate: Remove annotation_print_data.start
authorNamhyung Kim <namhyung@kernel.org>
Sat, 16 Aug 2025 03:16:25 +0000 (20:16 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 28 Aug 2025 15:32:08 +0000 (12:32 -0300)
The start field is to control whether the output shows full address or
offset from the function start.  But actually it can be changed
dynamically in annotation__toggle_full_addr().  The informaiton should
be available through struct annotation.  Let's use it directly.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250816031635.25318-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c

index 0dd475a744b6dfacd467c594172fd263c237add9..b699e14102b0587a41884d258f785253c2ce9d85 100644 (file)
@@ -770,7 +770,6 @@ struct annotation_print_data {
        struct evsel *evsel;
        struct arch *arch;
        struct debuginfo *dbg;
-       u64 start;
        int addr_fmt_width;
 };
 
@@ -845,7 +844,7 @@ annotation_line__print(struct annotation_line *al, struct annotation_print_data
 
                printf(" : ");
 
-               disasm_line__print(dl, apd->start, apd->addr_fmt_width);
+               disasm_line__print(dl, notes->src->start, apd->addr_fmt_width);
 
                if (opts->code_with_type && apd->dbg) {
                        struct annotated_data_type *data_type;
@@ -1230,7 +1229,6 @@ int hist_entry__annotate_printf(struct hist_entry *he, struct evsel *evsel)
        struct annotation_print_data apd = {
                .he = he,
                .evsel = evsel,
-               .start = map__rip_2objdump(map, sym->start),
        };
        int printed = 2, queue_len = 0;
        int more = 0;
@@ -1267,7 +1265,7 @@ int hist_entry__annotate_printf(struct hist_entry *he, struct evsel *evsel)
                symbol__annotate_hits(sym, evsel);
 
        apd.addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source,
-                                                             apd.start);
+                                                             notes->src->start);
        evsel__get_arch(evsel, &apd.arch);
        apd.dbg = debuginfo__new(filename);