[tip:perf/core] perf env: Free memory nodes data
From: tip-bot for Jiri Olsa
Date: Tue Mar 20 2018 - 02:16:38 EST
Commit-ID: e725920cdb1c79fdc71f2f164f59be8c411cad68
Gitweb: https://git.kernel.org/tip/e725920cdb1c79fdc71f2f164f59be8c411cad68
Author: Jiri Olsa <jolsa@xxxxxxxxxx>
AuthorDate: Fri, 9 Mar 2018 11:14:34 +0100
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Fri, 16 Mar 2018 13:52:09 -0300
perf env: Free memory nodes data
Forgot to free env's memory nodes, adding needed code to perf_env__exit.
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/20180309101442.9224-2-jolsa@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/env.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 6d311868d850..4c842762e3f2 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -32,6 +32,10 @@ void perf_env__exit(struct perf_env *env)
for (i = 0; i < env->caches_cnt; i++)
cpu_cache_level__free(&env->caches[i]);
zfree(&env->caches);
+
+ for (i = 0; i < env->nr_memory_nodes; i++)
+ free(env->memory_nodes[i].set);
+ zfree(&env->memory_nodes);
}
int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[])