[PATCH 39/47] perf stat report: Move csv_sep initialization before report command

Jiri Olsa
2015-07-21T12:36:35Z

So we have csv_sep properly initialized before
report command leg.

Link: http://lkml.kernel.org/n/tip-i5mmbomj7lt4eg04awzocdd4@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/builtin-stat.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 6602323ecd43..a5c831a242a7 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1546,6 +1546,13 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
(const char **) stat_usage,
PARSE_OPT_STOP_AT_NON_OPTION);

+ if (csv_sep) {
+ csv_output = true;
+ if (!strcmp(csv_sep, "\\t"))
+ csv_sep = "\t";
+ } else
+ csv_sep = DEFAULT_SEPARATOR;
+
if (argc && !strncmp(argv[0], "rec", 3)) {
argc = __cmd_record(argc, argv);
if (argc < 0)
@@ -1593,13 +1600,6 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)

stat_config.output = output;

- if (csv_sep) {
- csv_output = true;
- if (!strcmp(csv_sep, "\\t"))
- csv_sep = "\t";
- } else
- csv_sep = DEFAULT_SEPARATOR;
-
/*
* let the spreadsheet do the pretty-printing
*/
--
2.4.3