Skip to content

Commit 33974a4

Browse files
avaginacmel
authored andcommitted
perf trace: Call machine__exit() at exit
Otherwise 'perf trace' leaves a temporary file /tmp/perf-vdso.so-XXXXXX. $ perf trace -o log true $ ls -l /tmp/perf-vdso.* -rw------- 1 root root 8192 Nov 8 03:08 /tmp/perf-vdso.so-5bCpD0 Signed-off-by: Andrei Vagin <[email protected]> Reviewed-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Vasily Averin <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent a271bfa commit 33974a4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/perf/builtin-trace.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)
11381138
return err;
11391139
}
11401140

1141+
static void trace__symbols__exit(struct trace *trace)
1142+
{
1143+
machine__exit(trace->host);
1144+
trace->host = NULL;
1145+
1146+
symbol__exit();
1147+
}
1148+
11411149
static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args)
11421150
{
11431151
int idx;
@@ -2481,6 +2489,8 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
24812489
}
24822490

24832491
out_delete_evlist:
2492+
trace__symbols__exit(trace);
2493+
24842494
perf_evlist__delete(evlist);
24852495
trace->evlist = NULL;
24862496
trace->live = false;

0 commit comments

Comments
 (0)