Skip to contentSkip to conversation

perf tools: Fix random fd closing with no libelf

PATCH New Adrian Hunter 2 participants 2 messages Dec 4, 2013 – Dec 10, 2013 perf events

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

PATCH 1/1 perf tools: Fix random fd closing with no libelf

When built without libelf, perf tools was failing to initialize a file descriptor, but nevertheless closing it. That sometimes resulted in the output being truncated because the stdout file descriptor got closed.

---
 tools/perf/util/symbol-minimal.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/symbol-minimal.c +1 -0
index 2d2dd05..ac7070a 100644
@@ -253,6 +253,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused,
 	if (!ss->name)
 		goto out_close;
 
+	ss->fd = fd;
 	ss->type = type;
 
 	return 0;
Signature · 1 line
1.7.11.7
#1 lore raw

[tip:perf/core] perf symbols: Fix random fd closing with no libelf

perf symbols: Fix random fd closing with no libelf
Commit-ID:  779e24e2c777bffa9a6e3d5e821859e67008c98b
Gitweb:     http://git.kernel.org/tip/779e24e2c777bffa9a6e3d5e821859e67008c98b
Author:     Adrian Hunter <[email protected]>
AuthorDate: Wed, 4 Dec 2013 16:23:01 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 4 Dec 2013 15:08:19 -0300

perf symbols: Fix random fd closing with no libelf

When built without libelf, perf tools was failing to initialize a file descriptor, but nevertheless closing it. That sometimes resulted in the output being truncated because the stdout file descriptor got closed.

Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/util/symbol-minimal.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/symbol-minimal.c +1 -0
index 2d2dd05..ac7070a 100644
@@ -253,6 +253,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused,
 	if (!ss->name)
 		goto out_close;
 
+	ss->fd = fd;
 	ss->type = type;
 
 	return 0;