perf report: Add --percentage option
The --percentage option is for controlling overhead percentage displayed. It can only receive either of "relative" or "absolute". "relative" means it's relative to filtered entries only so that the sum of shown entries will be always 100%. "absolute" means it retains the original value before and after the filter is applied. $ perf report -s comm # Overhead Command # ........ ............ # 74.19% cc1 7.61% gcc 6.11% as 4.35% sh 4.14% make 1.13% fixdep ... $ perf report -s comm -c cc1,gcc --percentage absolute # Overhead Command # ........ ............ # 74.19% cc1 7.61% gcc $ perf report -s comm -c cc1,gcc --percentage relative # Overhead Command # ........ ............ # 90.69% cc1 9.31% gcc Note that it has zero effect if no filter was applied. Suggested-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1397145720-8063-3-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Este cometimento está contido em:

cometido por
Jiri Olsa

ascendente
1ab1fa5dfb
cometimento
f214833054
@@ -321,9 +321,11 @@ void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h)
|
||||
{
|
||||
if (!h->filtered) {
|
||||
hists__calc_col_len(hists, h);
|
||||
++hists->nr_entries;
|
||||
hists->stats.total_period += h->stat.period;
|
||||
hists->nr_non_filtered_entries++;
|
||||
hists->stats.total_non_filtered_period += h->stat.period;
|
||||
}
|
||||
hists->nr_entries++;
|
||||
hists->stats.total_period += h->stat.period;
|
||||
}
|
||||
|
||||
static u8 symbol__parent_filter(const struct symbol *parent)
|
||||
@@ -674,8 +676,9 @@ void hists__output_resort(struct hists *hists)
|
||||
next = rb_first(root);
|
||||
hists->entries = RB_ROOT;
|
||||
|
||||
hists->nr_entries = hists->nr_non_filtered_entries = 0;
|
||||
hists->stats.total_period = hists->stats.total_non_filtered_period = 0;
|
||||
hists->nr_non_filtered_entries = 0;
|
||||
hists->stats.total_period = 0;
|
||||
hists->stats.total_non_filtered_period = 0;
|
||||
hists__reset_col_len(hists);
|
||||
|
||||
while (next) {
|
||||
@@ -694,16 +697,11 @@ static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h
|
||||
if (h->filtered)
|
||||
return;
|
||||
|
||||
++hists->nr_entries;
|
||||
++hists->nr_non_filtered_entries;
|
||||
if (h->ms.unfolded) {
|
||||
hists->nr_entries += h->nr_rows;
|
||||
if (h->ms.unfolded)
|
||||
hists->nr_non_filtered_entries += h->nr_rows;
|
||||
}
|
||||
h->row_offset = 0;
|
||||
hists->stats.total_period += h->stat.period;
|
||||
hists->stats.total_non_filtered_period += h->stat.period;
|
||||
hists->stats.nr_events[PERF_RECORD_SAMPLE] += h->stat.nr_events;
|
||||
hists->stats.nr_non_filtered_samples += h->stat.nr_events;
|
||||
|
||||
hists__calc_col_len(hists, h);
|
||||
@@ -726,9 +724,8 @@ void hists__filter_by_dso(struct hists *hists)
|
||||
{
|
||||
struct rb_node *nd;
|
||||
|
||||
hists->nr_entries = hists->stats.total_period = 0;
|
||||
hists->nr_non_filtered_entries = hists->stats.total_non_filtered_period = 0;
|
||||
hists->stats.nr_events[PERF_RECORD_SAMPLE] = 0;
|
||||
hists->nr_non_filtered_entries = 0;
|
||||
hists->stats.total_non_filtered_period = 0;
|
||||
hists->stats.nr_non_filtered_samples = 0;
|
||||
hists__reset_col_len(hists);
|
||||
|
||||
@@ -761,9 +758,8 @@ void hists__filter_by_thread(struct hists *hists)
|
||||
{
|
||||
struct rb_node *nd;
|
||||
|
||||
hists->nr_entries = hists->stats.total_period = 0;
|
||||
hists->nr_non_filtered_entries = hists->stats.total_non_filtered_period = 0;
|
||||
hists->stats.nr_events[PERF_RECORD_SAMPLE] = 0;
|
||||
hists->nr_non_filtered_entries = 0;
|
||||
hists->stats.total_non_filtered_period = 0;
|
||||
hists->stats.nr_non_filtered_samples = 0;
|
||||
hists__reset_col_len(hists);
|
||||
|
||||
@@ -794,9 +790,8 @@ void hists__filter_by_symbol(struct hists *hists)
|
||||
{
|
||||
struct rb_node *nd;
|
||||
|
||||
hists->nr_entries = hists->stats.total_period = 0;
|
||||
hists->nr_non_filtered_entries = hists->stats.total_non_filtered_period = 0;
|
||||
hists->stats.nr_events[PERF_RECORD_SAMPLE] = 0;
|
||||
hists->nr_non_filtered_entries = 0;
|
||||
hists->stats.total_non_filtered_period = 0;
|
||||
hists->stats.nr_non_filtered_samples = 0;
|
||||
hists__reset_col_len(hists);
|
||||
|
||||
@@ -942,3 +937,9 @@ int hists__link(struct hists *leader, struct hists *other)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 hists__total_period(struct hists *hists)
|
||||
{
|
||||
return symbol_conf.filter_relative ? hists->stats.total_non_filtered_period :
|
||||
hists->stats.total_period;
|
||||
}
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador