path: root/tools/perf/perf.c
diff options
authorArnaldo Carvalho de Melo <>2015-09-09 10:37:01 -0300
committerArnaldo Carvalho de Melo <>2015-09-14 12:50:28 -0300
commitaa36ddd7afbb0a3db216c1391e28cd6d80ed1706 (patch)
treec4ade785d39be7b6ee6f63e2ed71f7f478a8b873 /tools/perf/perf.c
parent5d8cf721cb13be92e96f22846e5bcd31040d4d0b (diff)
perf env: Introduce read_cpu_topology_map() method
Out of the code to write the cpu topology map in the file header. Now if one needs the CPU topology map for the running machine, one needs to call perf_env__read_cpu_topology_map(perf_env) and the info will be stored in perf_env.cpu. For now we're using a global perf_env variable, that will have its contents freed after we run a builtin. v2: Check perf_env__read_cpu_topology_map() return in write_cpu_topology() (Kan Liang) Cc: Adrian Hunter <> Cc: Borislav Petkov <> Cc: David Ahern <> Cc: Frederic Weisbecker <> Cc: Jiri Olsa <> Cc: Kan Liang <> Cc: Namhyung Kim <> Cc: Stephane Eranian <> Cc: Wang Nan <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/perf.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index f2fc019b3671..1fded922bcc8 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -8,6 +8,7 @@
#include "builtin.h"
+#include "util/env.h"
#include "util/exec_cmd.h"
#include "util/cache.h"
#include "util/quote.h"
@@ -369,6 +370,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
status = p->fn(argc, argv, prefix);
+ perf_env__exit(&perf_env);
if (status)
return status & 0xff;