aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/stdio/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/ui/stdio/hist.c')
-rw-r--r--tools/perf/ui/stdio/hist.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 882461a42830..d7405f064e88 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -308,7 +308,7 @@ static size_t hist_entry__callchain_fprintf(struct hist_entry *he,
308 308
309static int hist_entry__fprintf(struct hist_entry *he, size_t size, 309static int hist_entry__fprintf(struct hist_entry *he, size_t size,
310 struct hists *hists, struct hists *pair_hists, 310 struct hists *hists, struct hists *pair_hists,
311 long displacement, u64 total_period, FILE *fp) 311 u64 total_period, FILE *fp)
312{ 312{
313 char bf[512]; 313 char bf[512];
314 int ret; 314 int ret;
@@ -316,7 +316,6 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
316 .buf = bf, 316 .buf = bf,
317 .size = size, 317 .size = size,
318 .total_period = total_period, 318 .total_period = total_period,
319 .displacement = displacement,
320 .ptr = pair_hists, 319 .ptr = pair_hists,
321 }; 320 };
322 bool color = !symbol_conf.field_sep; 321 bool color = !symbol_conf.field_sep;
@@ -337,15 +336,13 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
337} 336}
338 337
339size_t hists__fprintf(struct hists *hists, struct hists *pair, 338size_t hists__fprintf(struct hists *hists, struct hists *pair,
340 bool show_displacement, bool show_header, int max_rows, 339 bool show_header, int max_rows,
341 int max_cols, FILE *fp) 340 int max_cols, FILE *fp)
342{ 341{
343 struct sort_entry *se; 342 struct sort_entry *se;
344 struct rb_node *nd; 343 struct rb_node *nd;
345 size_t ret = 0; 344 size_t ret = 0;
346 u64 total_period; 345 u64 total_period;
347 unsigned long position = 1;
348 long displacement = 0;
349 unsigned int width; 346 unsigned int width;
350 const char *sep = symbol_conf.field_sep; 347 const char *sep = symbol_conf.field_sep;
351 const char *col_width = symbol_conf.col_width_list_str; 348 const char *col_width = symbol_conf.col_width_list_str;
@@ -449,15 +446,7 @@ print_entries:
449 if (h->filtered) 446 if (h->filtered)
450 continue; 447 continue;
451 448
452 if (show_displacement) { 449 ret += hist_entry__fprintf(h, max_cols, hists, pair,
453 if (h->pair != NULL)
454 displacement = ((long)h->pair->position -
455 (long)position);
456 else
457 displacement = 0;
458 ++position;
459 }
460 ret += hist_entry__fprintf(h, max_cols, hists, pair, displacement,
461 total_period, fp); 450 total_period, fp);
462 451
463 if (max_rows && ++nr_rows >= max_rows) 452 if (max_rows && ++nr_rows >= max_rows)