lkml.org 
[lkml]   [2017]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/6] perf report: hint .perfconfig error when invalid sorting key
Date
My fat-fingering of sort keys in .perfconfig was a common cause of
perf report silently terminating without apparent error.

This was because 1) error in setup_sorting in cmd_report was ignored
and 2) no message was log in UI browser that would prevent UI from
exit before user prompt. Fix both.

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
---
tools/perf/builtin-report.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c18158b83eb1..19a69ca0e9c9 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -987,12 +987,15 @@ int cmd_report(int argc, const char **argv)
else
use_browser = 0;

- if (setup_sorting(session->evlist) < 0) {
+ ret = setup_sorting(session->evlist);
+ if (ret < 0) {
if (sort_order)
parse_options_usage(report_usage, options, "s", 1);
if (field_order)
parse_options_usage(sort_order ? NULL : report_usage,
options, "F", 1);
+ if (!sort_order && !field_order)
+ pr_err("Couldn't setup sort order. Is .perfconfig correct?\n");
goto error;
}

--
2.12.2.715.g7642488e1d-goog
\
 
 \ /
  Last update: 2017-04-12 08:51    [W:0.154 / U:6.604 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site