Commit-ID:  597e48c138632d1f55409dcfa5bee4e1152e7d4f
Gitweb:     http://git.kernel.org/tip/597e48c138632d1f55409dcfa5bee4e1152e7d4f
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 16 Oct 2014 13:25:01 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 17 Oct 2014 11:14:15 -0300

perf evsel: Move exit stuff from __delete to __exit

So that when an evsel is embedded into other struct it can free up
resources calling perf_evsel__exit().

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jean Pihet <[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]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/util/evsel.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index d1ecde0..786ea55 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -850,17 +850,17 @@ void perf_evsel__exit(struct perf_evsel *evsel)
        assert(list_empty(&evsel->node));
        perf_evsel__free_fd(evsel);
        perf_evsel__free_id(evsel);
+       close_cgroup(evsel->cgrp);
+       zfree(&evsel->group_name);
+       if (evsel->tp_format)
+               pevent_free_format(evsel->tp_format);
+       zfree(&evsel->name);
        perf_evsel__object.fini(evsel);
 }
 
 void perf_evsel__delete(struct perf_evsel *evsel)
 {
        perf_evsel__exit(evsel);
-       close_cgroup(evsel->cgrp);
-       zfree(&evsel->group_name);
-       if (evsel->tp_format)
-               pevent_free_format(evsel->tp_format);
-       zfree(&evsel->name);
        free(evsel);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to