Commit f0c4801a authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Arnaldo Carvalho de Melo

perf probe: Fix to remove redundant close

Since dwfl_end() closes given fd with dwfl, caller doesn't need to close its fd
when finishing process.

Cc: 2nddept-manager@sdl.hitachi.co.jp
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20110330092547.2132.93728.stgit@ltc236.sdl.hitachi.co.jp>
Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7d21635a
...@@ -234,7 +234,6 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev, ...@@ -234,7 +234,6 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
/* Searching trace events corresponding to probe event */ /* Searching trace events corresponding to probe event */
ntevs = find_probe_trace_events(fd, pev, tevs, max_tevs); ntevs = find_probe_trace_events(fd, pev, tevs, max_tevs);
close(fd);
if (ntevs > 0) { /* Succeeded to find trace events */ if (ntevs > 0) { /* Succeeded to find trace events */
pr_debug("find %d probe_trace_events.\n", ntevs); pr_debug("find %d probe_trace_events.\n", ntevs);
...@@ -388,7 +387,6 @@ int show_line_range(struct line_range *lr, const char *module) ...@@ -388,7 +387,6 @@ int show_line_range(struct line_range *lr, const char *module)
} }
ret = find_line_range(fd, lr); ret = find_line_range(fd, lr);
close(fd);
if (ret == 0) { if (ret == 0) {
pr_warning("Specified source line is not found.\n"); pr_warning("Specified source line is not found.\n");
return -ENOENT; return -ENOENT;
...@@ -524,7 +522,6 @@ int show_available_vars(struct perf_probe_event *pevs, int npevs, ...@@ -524,7 +522,6 @@ int show_available_vars(struct perf_probe_event *pevs, int npevs,
ret = show_available_vars_at(fd, &pevs[i], max_vls, _filter, ret = show_available_vars_at(fd, &pevs[i], max_vls, _filter,
externs); externs);
close(fd);
return ret; return ret;
} }
......
...@@ -1455,6 +1455,7 @@ static int find_probes(int fd, struct probe_finder *pf) ...@@ -1455,6 +1455,7 @@ static int find_probes(int fd, struct probe_finder *pf)
if (!dbg) { if (!dbg) {
pr_warning("No debug information found in the vmlinux - " pr_warning("No debug information found in the vmlinux - "
"please rebuild with CONFIG_DEBUG_INFO=y.\n"); "please rebuild with CONFIG_DEBUG_INFO=y.\n");
close(fd); /* Without dwfl_end(), fd isn't closed. */
return -EBADF; return -EBADF;
} }
...@@ -1900,6 +1901,7 @@ int find_line_range(int fd, struct line_range *lr) ...@@ -1900,6 +1901,7 @@ int find_line_range(int fd, struct line_range *lr)
if (!dbg) { if (!dbg) {
pr_warning("No debug information found in the vmlinux - " pr_warning("No debug information found in the vmlinux - "
"please rebuild with CONFIG_DEBUG_INFO=y.\n"); "please rebuild with CONFIG_DEBUG_INFO=y.\n");
close(fd); /* Without dwfl_end(), fd isn't closed. */
return -EBADF; return -EBADF;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment