int width = browser->width, printed;
        int i, pcnt_width = annotation__pcnt_width(notes),
               cycles_width = annotation__cycles_width(notes);
-       double percent_max = 0.0;
+       double percent_max = annotation_line__max_percent(al, notes);
        char bf[256];
        bool show_title = false;
 
-       for (i = 0; i < notes->nr_events; i++) {
-               if (al->samples[i].percent > percent_max)
-                       percent_max = al->samples[i].percent;
-       }
-
        if ((row == 0) && (al->offset == -1 || percent_max == 0.0)) {
                if (notes->have_cycles) {
                        if (al->ipc == 0.0 && al->cycles == 0)
 
        return use_browser == 1 && perf_hpp_list.sym;
 }
 
+
+double annotation_line__max_percent(struct annotation_line *al, struct annotation *notes)
+{
+       double percent_max = 0.0;
+       int i;
+
+       for (i = 0; i < notes->nr_events; i++) {
+               if (al->samples[i].percent > percent_max)
+                       percent_max = al->samples[i].percent;
+       }
+
+       return percent_max;
+}
+
 int symbol__annotate2(struct symbol *sym, struct map *map, struct perf_evsel *evsel,
                      struct annotation_options *options, struct arch **parch)
 {
 
 void disasm_line__free(struct disasm_line *dl);
 struct annotation_line *
 annotation_line__next(struct annotation_line *pos, struct list_head *head);
+
+double annotation_line__max_percent(struct annotation_line *al, struct annotation *notes);
+
 int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw);
 size_t disasm__fprintf(struct list_head *head, FILE *fp);
 void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel);