Skip to contentSkip to conversation

perf tests: Call machine__exit in the vmlinux matches kallsyms test

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jan 31, 2013 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  c0aab59f67ef47e52d151464c8dd16e7ae58d053
Gitweb:     http://git.kernel.org/tip/c0aab59f67ef47e52d151464c8dd16e7ae58d053
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 24 Jan 2013 23:01:50 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 25 Jan 2013 12:49:29 -0300

perf tests: Call machine__exit in the vmlinux matches kallsyms test

Removing leaks with valgrind.

Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[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/tests/vmlinux-kallsyms.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/tests/vmlinux-kallsyms.c +3 -1
index a1a8442..7b4c4d2 100644
@@ -44,7 +44,7 @@ int test__vmlinux_matches_kallsyms(void)
 	 */
 	if (machine__create_kernel_maps(&kallsyms) < 0) {
 		pr_debug("machine__create_kernel_maps ");
-		return -1;
+		goto out;
 	}
 
 	/*
@@ -227,5 +227,7 @@ detour:
 			map__fprintf(pos, stderr);
 	}
 out:
+	machine__exit(&kallsyms);
+	machine__exit(&vmlinux);
 	return err;
 }