Commit 55309985 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

perf sort: Make setup_sorting returns an error code



Currently the setup_sorting() is called for parsing sort keys and exits
if it failed to add the sort key.  As it's included in libperf it'd be
better returning an error code rather than exiting application inside of
the library.

Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Suggested-by: default avatarArnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1360130237-9963-2-git-send-email-namhyung@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 51f27d14
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -309,7 +309,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
	if (symbol__init() < 0)
		return -1;

	setup_sorting(annotate_usage, options);
	if (setup_sorting() < 0)
		usage_with_options(annotate_usage, options);

	if (argc) {
		/*
+3 −1
Original line number Diff line number Diff line
@@ -605,7 +605,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)

	ui_init();

	setup_sorting(diff_usage, options);
	if (setup_sorting() < 0)
		usage_with_options(diff_usage, options);

	setup_pager();

	sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, "dso", NULL);
+2 −1
Original line number Diff line number Diff line
@@ -751,7 +751,8 @@ repeat:

	}

	setup_sorting(report_usage, options);
	if (setup_sorting() < 0)
		usage_with_options(report_usage, options);

	/*
	 * Only in the newt browser we are doing integrated annotation,
+2 −1
Original line number Diff line number Diff line
@@ -1129,7 +1129,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
	if (sort_order == default_sort_order)
		sort_order = "dso,symbol";

	setup_sorting(top_usage, options);
	if (setup_sorting() < 0)
		usage_with_options(top_usage, options);

	if (top.use_stdio)
		use_browser = 0;
+2 −1
Original line number Diff line number Diff line
@@ -449,7 +449,8 @@ int test__hists_link(void)
		goto out;

	/* default sort order (comm,dso,sym) will be used */
	setup_sorting(NULL, NULL);
	if (setup_sorting() < 0)
		goto out;

	machines__init(&machines);

Loading