From bd74137ec9aaca3df3ff22b92455fddf7afaced1 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 4 Jun 2009 14:13:04 +0200 Subject: perf_counter tools: Print out symbol parsing errors only if --verbose Also, add a suggestion to 'perf report', if the default sort order is used. Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Corey Ashford Cc: Marcelo Tosatti Cc: Arnaldo Carvalho de Melo Cc: Thomas Gleixner LKML-Reference: Signed-off-by: Ingo Molnar --- Documentation/perf_counter/builtin-report.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Documentation/perf_counter/builtin-report.c') diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c index 56c664d1b628..15fe9dae792b 100644 --- a/Documentation/perf_counter/builtin-report.c +++ b/Documentation/perf_counter/builtin-report.c @@ -26,7 +26,10 @@ static char const *input_name = "perf.data"; static char *vmlinux = NULL; -static char *sort_order = "comm,dso"; + +static char default_sort_order[] = "comm,dso"; +static char *sort_order = default_sort_order; + static int input; static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; @@ -103,9 +106,10 @@ static struct dso *dsos__findnew(const char *name) if (!dso) goto out_delete_dso; - nr = dso__load(dso, NULL); + nr = dso__load(dso, NULL, verbose); if (nr < 0) { - fprintf(stderr, "Failed to open: %s\n", name); + if (verbose) + fprintf(stderr, "Failed to open: %s\n", name); goto out_delete_dso; } if (!nr && verbose) { @@ -139,7 +143,7 @@ static int load_kernel(void) if (!kernel_dso) return -1; - err = dso__load_kernel(kernel_dso, vmlinux, NULL); + err = dso__load_kernel(kernel_dso, vmlinux, NULL, verbose); if (err) { dso__delete(kernel_dso); kernel_dso = NULL; @@ -741,6 +745,12 @@ static size_t output__fprintf(FILE *fp, uint64_t total_samples) ret += hist_entry__fprintf(fp, pos, total_samples); } + if (!strcmp(sort_order, default_sort_order)) { + fprintf(fp, "#\n"); + fprintf(fp, "# ( For more details, try: perf report --sort comm,dso,symbol )\n"); + fprintf(fp, "#\n"); + } + return ret; } -- cgit v1.2.2