diff options
author | Namhyung Kim <namhyung@kernel.org> | 2013-03-05 00:53:29 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-03-15 12:06:06 -0400 |
commit | ab77df672cdbf7a0235a9de3289c173e2fce68e5 (patch) | |
tree | 6c346ea3dca78f097e6b98719e2fca3934f745f7 /tools/perf | |
parent | 1491c22a5f8563951d3a798758f82b471ecbf501 (diff) |
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>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index cfae57f90146..62369f0b6608 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -14,10 +14,10 @@ | |||
14 | 14 | ||
15 | struct browser_disasm_line { | 15 | struct browser_disasm_line { |
16 | struct rb_node rb_node; | 16 | struct rb_node rb_node; |
17 | double percent; | ||
18 | u32 idx; | 17 | u32 idx; |
19 | int idx_asm; | 18 | int idx_asm; |
20 | int jump_sources; | 19 | int jump_sources; |
20 | double percent[1]; | ||
21 | }; | 21 | }; |
22 | 22 | ||
23 | static struct annotate_browser_opt { | 23 | static struct annotate_browser_opt { |
@@ -97,9 +97,9 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
97 | int width = browser->width, printed; | 97 | int width = browser->width, printed; |
98 | char bf[256]; | 98 | char bf[256]; |
99 | 99 | ||
100 | if (dl->offset != -1 && bdl->percent != 0.0) { | 100 | if (dl->offset != -1 && bdl->percent[0] != 0.0) { |
101 | ui_browser__set_percent_color(browser, bdl->percent, current_entry); | 101 | ui_browser__set_percent_color(browser, bdl->percent[0], current_entry); |
102 | slsmg_printf("%6.2f ", bdl->percent); | 102 | slsmg_printf("%6.2f ", bdl->percent[0]); |
103 | } else { | 103 | } else { |
104 | ui_browser__set_percent_color(browser, 0, current_entry); | 104 | ui_browser__set_percent_color(browser, 0, current_entry); |
105 | slsmg_write_nstring(" ", 7); | 105 | slsmg_write_nstring(" ", 7); |
@@ -283,7 +283,7 @@ static void disasm_rb_tree__insert(struct rb_root *root, struct browser_disasm_l | |||
283 | while (*p != NULL) { | 283 | while (*p != NULL) { |
284 | parent = *p; | 284 | parent = *p; |
285 | l = rb_entry(parent, struct browser_disasm_line, rb_node); | 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 | p = &(*p)->rb_left; | 287 | p = &(*p)->rb_left; |
288 | else | 288 | else |
289 | p = &(*p)->rb_right; | 289 | p = &(*p)->rb_right; |
@@ -345,8 +345,8 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, | |||
345 | 345 | ||
346 | list_for_each_entry(pos, ¬es->src->source, node) { | 346 | list_for_each_entry(pos, ¬es->src->source, node) { |
347 | struct browser_disasm_line *bpos = disasm_line__browser(pos); | 347 | struct browser_disasm_line *bpos = disasm_line__browser(pos); |
348 | bpos->percent = disasm_line__calc_percent(pos, sym, evsel->idx); | 348 | bpos->percent[0] = disasm_line__calc_percent(pos, sym, evsel->idx); |
349 | if (bpos->percent < 0.01) { | 349 | if (bpos->percent[0] < 0.01) { |
350 | RB_CLEAR_NODE(&bpos->rb_node); | 350 | RB_CLEAR_NODE(&bpos->rb_node); |
351 | continue; | 351 | continue; |
352 | } | 352 | } |