Skip to content

Commit e9de7e2

Browse files
committed
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 <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-ohqyisr6qge79qa95ojslptx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 06dc5bf commit e9de7e2

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎tools/perf/builtin-c2c.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,7 @@ static void print_cacheline(struct c2c_hists *c2c_hists,
21932193
fprintf(out, "%s\n", bf);
21942194
fprintf(out, " -------------------------------------------------------------\n");
21952195

2196-
hists__fprintf(&c2c_hists->hists, false, 0, 0, 0, out, true);
2196+
hists__fprintf(&c2c_hists->hists, false, 0, 0, 0, out, false);
21972197
}
21982198

21992199
static void print_pareto(FILE *out)
@@ -2268,7 +2268,7 @@ static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session)
22682268
fprintf(out, "=================================================\n");
22692269
fprintf(out, "#\n");
22702270

2271-
hists__fprintf(&c2c.hists.hists, true, 0, 0, 0, stdout, false);
2271+
hists__fprintf(&c2c.hists.hists, true, 0, 0, 0, stdout, true);
22722272

22732273
fprintf(out, "\n");
22742274
fprintf(out, "=================================================\n");

‎tools/perf/builtin-diff.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ static void hists__process(struct hists *hists)
696696
hists__output_resort(hists, NULL);
697697

698698
hists__fprintf(hists, !quiet, 0, 0, 0, stdout,
699-
symbol_conf.use_callchain);
699+
!symbol_conf.use_callchain);
700700
}
701701

702702
static void data__fprintf(void)

‎tools/perf/builtin-report.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
478478

479479
hists__fprintf_nr_sample_events(hists, rep, evname, stdout);
480480
hists__fprintf(hists, !quiet, 0, 0, rep->min_percent, stdout,
481-
symbol_conf.use_callchain ||
482-
symbol_conf.show_branchflag_count);
481+
!(symbol_conf.use_callchain ||
482+
symbol_conf.show_branchflag_count));
483483
fprintf(stdout, "\n\n");
484484
}
485485

‎tools/perf/builtin-top.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
307307
hists__output_recalc_col_len(hists, top->print_entries - printed);
308308
putchar('\n');
309309
hists__fprintf(hists, false, top->print_entries - printed, win_width,
310-
top->min_percent, stdout, symbol_conf.use_callchain);
310+
top->min_percent, stdout, !symbol_conf.use_callchain);
311311
}
312312

313313
static void prompt_integer(int *target, const char *msg)

‎tools/perf/ui/stdio/hist.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ static int hist_entry__hierarchy_fprintf(struct hist_entry *he,
529529

530530
static int hist_entry__fprintf(struct hist_entry *he, size_t size,
531531
char *bf, size_t bfsz, FILE *fp,
532-
bool use_callchain)
532+
bool ignore_callchains)
533533
{
534534
int ret;
535535
int callchain_ret = 0;
@@ -550,7 +550,7 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
550550

551551
ret = fprintf(fp, "%s\n", bf);
552552

553-
if (hist_entry__has_callchains(he) && use_callchain)
553+
if (hist_entry__has_callchains(he) && !ignore_callchains)
554554
callchain_ret = hist_entry_callchain__fprintf(he, total_period,
555555
0, fp);
556556

@@ -755,7 +755,7 @@ int hists__fprintf_headers(struct hists *hists, FILE *fp)
755755

756756
size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
757757
int max_cols, float min_pcnt, FILE *fp,
758-
bool use_callchain)
758+
bool ignore_callchains)
759759
{
760760
struct rb_node *nd;
761761
size_t ret = 0;
@@ -799,7 +799,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
799799
if (percent < min_pcnt)
800800
continue;
801801

802-
ret += hist_entry__fprintf(h, max_cols, line, linesz, fp, use_callchain);
802+
ret += hist_entry__fprintf(h, max_cols, line, linesz, fp, ignore_callchains);
803803

804804
if (max_rows && ++nr_rows >= max_rows)
805805
break;

‎tools/perf/util/hist.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
181181

182182
size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
183183
int max_cols, float min_pcnt, FILE *fp,
184-
bool use_callchain);
184+
bool ignore_callchains);
185185
size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp);
186186

187187
void hists__filter_by_dso(struct hists *hists);

0 commit comments

Comments
 (0)