perf hists: Clarify callchain disabling when available
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: e9de7e2f7e22989fefc760cf0920062c58b2b2b1 Gitweb: https://git.kernel.org/tip/e9de7e2f7e22989fefc760cf0920062c58b2b2b1 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Wed, 20 Jun 2018 15:58:20 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 24 Jul 2018 14:37:33 -0300
perf hists: Clarify callchain disabling when available
We want to allow having mixed events with/without callchains, not using a global flag to show callchains, but allowing supressing callchains when they are present.
So invert the logic of the last parameter to hists__fprint() to that effect.
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-c2c.c | 4 ++-- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-report.c | 4 ++-- tools/perf/builtin-top.c | 2 +- tools/perf/ui/stdio/hist.c | 8 ++++---- tools/perf/util/hist.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/builtin-c2c.c +2 -2
@@ -2193,7 +2193,7 @@ static void print_cacheline(struct c2c_hists *c2c_hists,fprintf (out,"%s\n" , bf);fprintf (out," -------------------------------------------------------------\n" ); -hists__fprintf (&c2c_hists->hists, false,0 ,0 ,0 , out, true); +hists__fprintf (&c2c_hists->hists, false,0 ,0 ,0 , out, false); }static void print_pareto (FILE *out)
@@ -2268,7 +2268,7 @@ static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session)fprintf (out,"=================================================\n" );fprintf (out,"#\n" ); -hists__fprintf (&c2c.hists.hists, true,0 ,0 ,0 , stdout, false); +hists__fprintf (&c2c.hists.hists, true,0 ,0 ,0 , stdout, true);fprintf (out,"\n" );fprintf (out,"=================================================\n" );
tools/perf/builtin-diff.c +1 -1
@@ -696,7 +696,7 @@ static void hists__process(struct hists *hists)hists__output_resort (hists,NULL );hists__fprintf (hists, !quiet,0 ,0 ,0 , stdout, - symbol_conf.use_callchain); + !symbol_conf.use_callchain); }static void data__fprintf (void )
tools/perf/builtin-report.c +2 -2
@@ -478,8 +478,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,hists__fprintf_nr_sample_events (hists, rep, evname, stdout);hists__fprintf (hists, !quiet,0 ,0 , rep->min_percent, stdout, - symbol_conf.use_callchain || - symbol_conf.show_branchflag_count); + !(symbol_conf.use_callchain || + symbol_conf.show_branchflag_count));fprintf (stdout,"\n\n" ); }
tools/perf/builtin-top.c +1 -1
@@ -307,7 +307,7 @@ static void perf_top__print_sym_table(struct perf_top *top)hists__output_recalc_col_len (hists, top->print_entries - printed);putchar ('\n' );hists__fprintf (hists, false, top->print_entries - printed, win_width, - top->min_percent, stdout, symbol_conf.use_callchain); + top->min_percent, stdout, !symbol_conf.use_callchain); }static void prompt_integer (int *target,const char *msg)
tools/perf/ui/stdio/hist.c +4 -4
@@ -529,7 +529,7 @@ out:static int hist_entry__fprintf (struct hist_entry *he,size_t size,char *bf,size_t bfsz,FILE *fp, -bool use_callchain) +bool ignore_callchains) {int ret;int callchain_ret =0 ;
@@ -550,7 +550,7 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size, ret =fprintf (fp,"%s\n" , bf); -if (hist_entry__has_callchains (he) && use_callchain) +if (hist_entry__has_callchains (he) && !ignore_callchains) callchain_ret =hist_entry_callchain__fprintf (he, total_period,0 , fp);
@@ -755,7 +755,7 @@ int hists__fprintf_headers(struct hists *hists, FILE *fp)size_t hists__fprintf (struct hists *hists,bool show_header,int max_rows,int max_cols,float min_pcnt,FILE *fp, -bool use_callchain) +bool ignore_callchains) {struct rb_node *nd;size_t ret =0 ;
@@ -799,7 +799,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,if (percent < min_pcnt)continue ; - ret +=hist_entry__fprintf (h, max_cols, line, linesz, fp, use_callchain); + ret +=hist_entry__fprintf (h, max_cols, line, linesz, fp, ignore_callchains);if (max_rows && ++nr_rows >= max_rows)break ;
tools/perf/util/hist.h +1 -1
@@ -181,7 +181,7 @@ size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);size_t hists__fprintf (struct hists *hists,bool show_header,int max_rows,int max_cols,float min_pcnt,FILE *fp, -bool use_callchain); +bool ignore_callchains);size_t perf_evlist__fprintf_nr_events (struct perf_evlist *evlist,FILE *fp);void hists__filter_by_dso (struct hists *hists);