perf annotate: Move update_column_widths() to the generic lib
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Mar 2018 19:19:59 +0000 (16:19 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Mar 2018 16:19:29 +0000 (13:19 -0300)
Previous patch left it where it was to ease review, move it to its
right place.

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-ikdjr014p7k5kachgyjrgiey@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/annotate.c
tools/perf/util/annotate.c
tools/perf/util/annotate.h

index 07d0d22..ab4d004 100644 (file)
@@ -698,19 +698,6 @@ bool annotate_browser__continue_search_reverse(struct annotate_browser *browser,
        return __annotate_browser__search_reverse(browser);
 }
 
-static void annotation__update_column_widths(struct annotation *notes)
-{
-       if (notes->options->use_offset)
-               notes->widths.target = notes->widths.min_addr;
-       else
-               notes->widths.target = notes->widths.max_addr;
-
-       notes->widths.addr = notes->widths.target;
-
-       if (notes->options->show_nr_jumps)
-               notes->widths.addr += notes->widths.jumps + 1;
-}
-
 static int annotate_browser__run(struct annotate_browser *browser,
                                 struct perf_evsel *evsel,
                                 struct hist_browser_timer *hbt)
index b976e39..8a2fda8 100644 (file)
@@ -2084,6 +2084,19 @@ void annotation__set_offsets(struct annotation *notes, s64 size)
        }
 }
 
+void annotation__update_column_widths(struct annotation *notes)
+{
+       if (notes->options->use_offset)
+               notes->widths.target = notes->widths.min_addr;
+       else
+               notes->widths.target = notes->widths.max_addr;
+
+       notes->widths.addr = notes->widths.target;
+
+       if (notes->options->show_nr_jumps)
+               notes->widths.addr += notes->widths.jumps + 1;
+}
+
 static void annotation__calc_lines(struct annotation *notes, struct map *map,
                                  struct rb_root *root, u64 start)
 {
index 0aa77c1..a8bea75 100644 (file)
@@ -203,6 +203,7 @@ static inline int annotation__pcnt_width(struct annotation *notes)
 void annotation__set_offsets(struct annotation *notes, s64 size);
 void annotation__compute_ipc(struct annotation *notes, size_t size);
 void annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym);
+void annotation__update_column_widths(struct annotation *notes);
 
 static inline struct sym_hist *annotation__histogram(struct annotation *notes, int idx)
 {