Browse Source

perf tools: Make the tool's warning messages optional

I want to display the pure events status coming in the next patch and
the tool's warnings are superfluous in the output. Making it optional,
enabled by default.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180107160356.28203-11-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Jiri Olsa 7 years ago
parent
commit
075ca1ebb2
2 changed files with 5 additions and 2 deletions
  1. 4 2
      tools/perf/util/session.c
  2. 1 0
      tools/perf/util/tool.h

+ 4 - 2
tools/perf/util/session.c

@@ -1773,7 +1773,8 @@ done:
 	err = perf_session__flush_thread_stacks(session);
 	err = perf_session__flush_thread_stacks(session);
 out_err:
 out_err:
 	free(buf);
 	free(buf);
-	perf_session__warn_about_errors(session);
+	if (!tool->no_warn)
+		perf_session__warn_about_errors(session);
 	ordered_events__free(&session->ordered_events);
 	ordered_events__free(&session->ordered_events);
 	auxtrace__free_events(session);
 	auxtrace__free_events(session);
 	return err;
 	return err;
@@ -1929,7 +1930,8 @@ out:
 	err = perf_session__flush_thread_stacks(session);
 	err = perf_session__flush_thread_stacks(session);
 out_err:
 out_err:
 	ui_progress__finish();
 	ui_progress__finish();
-	perf_session__warn_about_errors(session);
+	if (!tool->no_warn)
+		perf_session__warn_about_errors(session);
 	/*
 	/*
 	 * We may switching perf.data output, make ordered_events
 	 * We may switching perf.data output, make ordered_events
 	 * reusable.
 	 * reusable.

+ 1 - 0
tools/perf/util/tool.h

@@ -76,6 +76,7 @@ struct perf_tool {
 	bool		ordered_events;
 	bool		ordered_events;
 	bool		ordering_requires_timestamps;
 	bool		ordering_requires_timestamps;
 	bool		namespace_events;
 	bool		namespace_events;
+	bool		no_warn;
 	enum show_feature_header show_feat_hdr;
 	enum show_feature_header show_feat_hdr;
 };
 };