Skip to content

Commit

Permalink
perf tools: sort_dimension__add shouldn't die
Browse files Browse the repository at this point in the history
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: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Apr 2, 2010
1 parent ad5b217 commit 2aefa4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
setup_sorting(report_usage, options);

if (parent_pattern != default_parent_pattern) {
sort_dimension__add("parent");
if (sort_dimension__add("parent") < 0)
return -1;
sort_parent.elide = 1;
} else
symbol_conf.exclude_other = false;
Expand Down
5 changes: 2 additions & 3 deletions tools/perf/util/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,8 @@ int sort_dimension__add(const char *tok)
char err[BUFSIZ];

regerror(ret, &parent_regex, err, sizeof(err));
fprintf(stderr, "Invalid regex: %s\n%s",
parent_pattern, err);
exit(-1);
pr_err("Invalid regex: %s\n%s", parent_pattern, err);
return -EINVAL;
}
sort__has_parent = 1;
}
Expand Down

0 comments on commit 2aefa4f

Please sign in to comment.