[PATCH 04/11] perf evsel: Delete the event selectors at exit

Previous thread: linux-next: manual merge of the trivial tree with the net tree by Stephen Rothwell on Monday, January 3, 2011 - 8:22 pm. (1 message)

Next thread: [PATCH 03/11] perf util: Move do_read from session to util by Arnaldo Carvalho de Melo on Monday, January 3, 2011 - 8:48 pm. (1 message)
From: Arnaldo Carvalho de Melo
Date: Monday, January 3, 2011 - 8:48 pm

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Freeing all the possibly allocated resources, reducing complexity
on each tool exit path.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c    |    2 --
 tools/perf/builtin-stat.c      |    4 +---
 tools/perf/builtin-top.c       |    4 +---
 tools/perf/perf.c              |    2 ++
 tools/perf/util/parse-events.c |   11 +++++++++++
 tools/perf/util/parse-events.h |    1 +
 6 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index e68aee3..052de17 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -965,8 +965,6 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
 out_free_event_array:
 	free(event_array);
 out_free_fd:
-	list_for_each_entry(pos, &evsel_list, node)
-		perf_evsel__free_fd(pos);
 	free(all_tids);
 	all_tids = NULL;
 out_symbol_exit:
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 3e5f356..589ba3a 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -844,10 +844,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
 	if (status != -1)
 		print_stat(argc, argv);
 out_free_fd:
-	list_for_each_entry(pos, &evsel_list, node) {
-		perf_evsel__free_fd(pos);
+	list_for_each_entry(pos, &evsel_list, node)
 		perf_evsel__free_stat_priv(pos);
-	}
 out:
 	return status;
 }
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 13a836e..27b9c14 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1495,10 ...
Previous thread: linux-next: manual merge of the trivial tree with the net tree by Stephen Rothwell on Monday, January 3, 2011 - 8:22 pm. (1 message)

Next thread: [PATCH 03/11] perf util: Move do_read from session to util by Arnaldo Carvalho de Melo on Monday, January 3, 2011 - 8:48 pm. (1 message)