perf tools: sort_dimension__add shouldn't die

Propagate error instead.

LKML-Reference: <new-submission>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 ad5b217b
...@@ -473,7 +473,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) ...@@ -473,7 +473,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
setup_sorting(report_usage, options); setup_sorting(report_usage, options);
if (parent_pattern != default_parent_pattern) { if (parent_pattern != default_parent_pattern) {
sort_dimension__add("parent"); if (sort_dimension__add("parent") < 0)
return -1;
sort_parent.elide = 1; sort_parent.elide = 1;
} else } else
symbol_conf.exclude_other = false; symbol_conf.exclude_other = false;
......
...@@ -264,9 +264,8 @@ int sort_dimension__add(const char *tok) ...@@ -264,9 +264,8 @@ int sort_dimension__add(const char *tok)
char err[BUFSIZ]; char err[BUFSIZ];
regerror(ret, &parent_regex, err, sizeof(err)); regerror(ret, &parent_regex, err, sizeof(err));
fprintf(stderr, "Invalid regex: %s\n%s", pr_err("Invalid regex: %s\n%s", parent_pattern, err);
parent_pattern, err); return -EINVAL;
exit(-1);
} }
sort__has_parent = 1; sort__has_parent = 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册