[PATCH] perf stat: Fix default logfd to use stderr

From: Robert Richter
Date: Thu Jun 07 2012 - 11:41:52 EST


When running perf-stat in certain shell environments with stdout
redirection there is a logging file descriptor setup failure:

Failed opening logfd: Invalid argument

Fixing this by setting the default fd to the correct value of 2.

Cc: Jim Cromie <jim.cromie@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # 3.2+
Signed-off-by: Robert Richter <robert.richter@xxxxxxx>
---
tools/perf/builtin-stat.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 2625899..c47e7d3 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -195,7 +195,7 @@ static bool csv_output = false;
static bool group = false;
static const char *output_name = NULL;
static FILE *output = NULL;
-static int output_fd;
+static int output_fd = 2;

static volatile int done = 0;

--
1.7.8.4



--
Advanced Micro Devices, Inc.
Operating System Research Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/