Skip to content

Commit 7a6710d

Browse files
namhyungacmel
authored andcommitted
perf mem: Display sort order only if it's available
IOW it's not used when -F option is used alone. Let's make it conditional to skip printing incorrect information. Reviewed-by: Leo Yan <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Stephane Eranian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 00a23c0 commit 7a6710d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/perf/builtin-report.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,10 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
529529

530530
if (rep->mem_mode) {
531531
ret += fprintf(fp, "\n# Total weight : %" PRIu64, nr_events);
532-
ret += fprintf(fp, "\n# Sort order : %s", sort_order ? : default_mem_sort_order);
532+
if (sort_order || !field_order) {
533+
ret += fprintf(fp, "\n# Sort order : %s",
534+
sort_order ? : default_mem_sort_order);
535+
}
533536
} else
534537
ret += fprintf(fp, "\n# Event count (approx.): %" PRIu64, nr_events);
535538

0 commit comments

Comments
 (0)