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 <avagin@openvz.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Vasily Averin <vvs@virtuozzo.com>
Link: http://lkml.kernel.org/r/20171108002246.8924-1-avagin@openvz.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Andrei Vagin 2017-11-07 16:22:45 -08:00 committed by Arnaldo Carvalho de Melo
parent a271bfaf30
commit 33974a414c
1 changed files with 10 additions and 0 deletions

View File

@ -1138,6 +1138,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)
return err; return err;
} }
static void trace__symbols__exit(struct trace *trace)
{
machine__exit(trace->host);
trace->host = NULL;
symbol__exit();
}
static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args) static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args)
{ {
int idx; int idx;
@ -2481,6 +2489,8 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
} }
out_delete_evlist: out_delete_evlist:
trace__symbols__exit(trace);
perf_evlist__delete(evlist); perf_evlist__delete(evlist);
trace->evlist = NULL; trace->evlist = NULL;
trace->live = false; trace->live = false;