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 <leo.yan@arm.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20250523222157.1259998-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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)