perf annotate TUI: Use sym_hist_entry in disasm_line_samples

Just paving the way to fix --show-total-period in the TUI, i.e. now
we save in struct disasm_line_samples not just the number of samples,
but also the total period.
Based-on-a-patch-by: default avatarTaeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-1sup5hkwrxocjvrmrmhs732o@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 48cc3308
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include <sys/ttydefaults.h> #include <sys/ttydefaults.h>
struct disasm_line_samples { struct disasm_line_samples {
double percent; double percent;
u64 nr; struct sym_hist_entry he;
}; };
#define IPC_WIDTH 6 #define IPC_WIDTH 6
...@@ -152,7 +152,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int ...@@ -152,7 +152,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
current_entry); current_entry);
if (annotate_browser__opts.show_total_period) { if (annotate_browser__opts.show_total_period) {
ui_browser__printf(browser, "%6" PRIu64 " ", ui_browser__printf(browser, "%6" PRIu64 " ",
bdl->samples[i].nr); bdl->samples[i].he.nr_samples);
} else { } else {
ui_browser__printf(browser, "%6.2f ", ui_browser__printf(browser, "%6.2f ",
bdl->samples[i].percent); bdl->samples[i].percent);
...@@ -457,7 +457,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, ...@@ -457,7 +457,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
pos->offset, pos->offset,
next ? next->offset : len, next ? next->offset : len,
&path, &sample); &path, &sample);
bpos->samples[i].nr = sample.nr_samples; bpos->samples[i].he = sample;
if (max_percent < bpos->samples[i].percent) if (max_percent < bpos->samples[i].percent)
max_percent = bpos->samples[i].percent; max_percent = bpos->samples[i].percent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment