Commit ab77df672cdbf7a0235a9de3289c173e2fce68e5

Authored by Namhyung Kim
Committed by Arnaldo Carvalho de Melo
1 parent 1491c22a5f

perf annotate browser: Make browser_disasm_line->percent an array

Make percent field of struct browser_disasm_line an array and move it to
the last.  This is a preparation of event group view feature.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1362462812-30885-10-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 1 changed file with 7 additions and 7 deletions Side-by-side Diff

tools/perf/ui/browsers/annotate.c
... ... @@ -14,10 +14,10 @@
14 14  
15 15 struct browser_disasm_line {
16 16 struct rb_node rb_node;
17   - double percent;
18 17 u32 idx;
19 18 int idx_asm;
20 19 int jump_sources;
  20 + double percent[1];
21 21 };
22 22  
23 23 static struct annotate_browser_opt {
... ... @@ -97,9 +97,9 @@
97 97 int width = browser->width, printed;
98 98 char bf[256];
99 99  
100   - if (dl->offset != -1 && bdl->percent != 0.0) {
101   - ui_browser__set_percent_color(browser, bdl->percent, current_entry);
102   - slsmg_printf("%6.2f ", bdl->percent);
  100 + if (dl->offset != -1 && bdl->percent[0] != 0.0) {
  101 + ui_browser__set_percent_color(browser, bdl->percent[0], current_entry);
  102 + slsmg_printf("%6.2f ", bdl->percent[0]);
103 103 } else {
104 104 ui_browser__set_percent_color(browser, 0, current_entry);
105 105 slsmg_write_nstring(" ", 7);
... ... @@ -283,7 +283,7 @@
283 283 while (*p != NULL) {
284 284 parent = *p;
285 285 l = rb_entry(parent, struct browser_disasm_line, rb_node);
286   - if (bdl->percent < l->percent)
  286 + if (bdl->percent[0] < l->percent[0])
287 287 p = &(*p)->rb_left;
288 288 else
289 289 p = &(*p)->rb_right;
... ... @@ -345,8 +345,8 @@
345 345  
346 346 list_for_each_entry(pos, &notes->src->source, node) {
347 347 struct browser_disasm_line *bpos = disasm_line__browser(pos);
348   - bpos->percent = disasm_line__calc_percent(pos, sym, evsel->idx);
349   - if (bpos->percent < 0.01) {
  348 + bpos->percent[0] = disasm_line__calc_percent(pos, sym, evsel->idx);
  349 + if (bpos->percent[0] < 0.01) {
350 350 RB_CLEAR_NODE(&bpos->rb_node);
351 351 continue;
352 352 }