Commit 597e48c138632d1f55409dcfa5bee4e1152e7d4f
1 parent
691286b556
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
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 <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-n1w68pfe9m2vkhm4sqs8y1en@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff
tools/perf/util/evsel.c
... | ... | @@ -850,17 +850,17 @@ |
850 | 850 | assert(list_empty(&evsel->node)); |
851 | 851 | perf_evsel__free_fd(evsel); |
852 | 852 | perf_evsel__free_id(evsel); |
853 | + close_cgroup(evsel->cgrp); | |
854 | + zfree(&evsel->group_name); | |
855 | + if (evsel->tp_format) | |
856 | + pevent_free_format(evsel->tp_format); | |
857 | + zfree(&evsel->name); | |
853 | 858 | perf_evsel__object.fini(evsel); |
854 | 859 | } |
855 | 860 | |
856 | 861 | void perf_evsel__delete(struct perf_evsel *evsel) |
857 | 862 | { |
858 | 863 | perf_evsel__exit(evsel); |
859 | - close_cgroup(evsel->cgrp); | |
860 | - zfree(&evsel->group_name); | |
861 | - if (evsel->tp_format) | |
862 | - pevent_free_format(evsel->tp_format); | |
863 | - zfree(&evsel->name); | |
864 | 864 | free(evsel); |
865 | 865 | } |
866 | 866 |