perf/trace: call machine__exit() at exiting
PATCH 1/2 perf/trace: call machine__exit() at exiting
Otherwise perf trace leaves a temprary 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
--- tools/perf/builtin-trace.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
tools/perf/builtin-trace.c +10 -0
@@ -1164,6 +1164,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)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) {int idx;
@@ -2508,6 +2516,8 @@ static int trace__run(struct trace *trace, int argc, const char **argv) } out_delete_evlist: +trace__symbols__exit (trace); +perf_evlist__delete (evlist); trace->evlist =NULL ; trace->live = false;
Signature · 1 line
2.13.6
PATCH 2/2 perf/trace: fix an exit code of trace__symbols_init
Currently if trace_event__register_resolver() fails, we return -errno, but we can't be sure that errno isn't zero in this case.
--- tools/perf/builtin-trace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +4 -2
@@ -1152,12 +1152,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)if (trace->host ==NULL )return -ENOMEM ; -if (trace_event__register_resolver (trace->host, trace__machine__resolve_kernel_addr) <0 ) -return -errno; + err =trace_event__register_resolver (trace->host, trace__machine__resolve_kernel_addr); +if (err <0 ) + goto out; err =__machine__synthesize_threads (trace->host, &trace->tool, &trace->opts.target, evlist->threads, trace__tool_process, false, trace->opts.proc_map_timeout,1 ); +out:if (err)symbol__exit ();
Signature · 1 line
2.13.6
tip-bot for Andrei Vagin
merge bot[tip:perf/core] perf trace: Fix an exit code of trace__symbols_init
perf trace: Fix an exit code of trace__symbols_init
Commit-ID: cbd5c1787bab4643e5959522275b46de94eba5ac Gitweb: https://git.kernel.org/tip/cbd5c1787bab4643e5959522275b46de94eba5ac Author: Andrei Vagin <[email protected]> AuthorDate: Tue, 7 Nov 2017 16:22:46 -0800 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 16 Nov 2017 14:49:52 -0300
perf trace: Fix an exit code of trace__symbols_init
Currently if trace_event__register_resolver() fails, we return -errno, but we can't be sure that errno isn't zero in this case.
--- tools/perf/builtin-trace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +4 -2
@@ -1152,12 +1152,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)if (trace->host ==NULL )return -ENOMEM ; -if (trace_event__register_resolver (trace->host, trace__machine__resolve_kernel_addr) <0 ) -return -errno; + err =trace_event__register_resolver (trace->host, trace__machine__resolve_kernel_addr); +if (err <0 ) + goto out; err =__machine__synthesize_threads (trace->host, &trace->tool, &trace->opts.target, evlist->threads, trace__tool_process, false, trace->opts.proc_map_timeout,1 ); +out:if (err)symbol__exit ();
tip-bot for Andrei Vagin
merge bot[tip:perf/core] perf trace: Fix an exit code of trace__symbols_init
In reply to Andrei Vaginperf trace: Fix an exit code of trace__symbols_init
Commit-ID: 35c33633abc14b906e84b7b0115ede6df6830120 Gitweb: https://git.kernel.org/tip/35c33633abc14b906e84b7b0115ede6df6830120 Author: Andrei Vagin <[email protected]> AuthorDate: Tue, 7 Nov 2017 16:22:46 -0800 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 28 Nov 2017 14:20:15 -0300
perf trace: Fix an exit code of trace__symbols_init
Currently if trace_event__register_resolver() fails, we return -errno, but we can't be sure that errno isn't zero in this case.
--- tools/perf/builtin-trace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +4 -2
@@ -1152,12 +1152,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)if (trace->host ==NULL )return -ENOMEM ; -if (trace_event__register_resolver (trace->host, trace__machine__resolve_kernel_addr) <0 ) -return -errno; + err =trace_event__register_resolver (trace->host, trace__machine__resolve_kernel_addr); +if (err <0 ) + goto out; err =__machine__synthesize_threads (trace->host, &trace->tool, &trace->opts.target, evlist->threads, trace__tool_process, false, trace->opts.proc_map_timeout,1 ); +out:if (err)symbol__exit ();
Quoted 6 lines · Andrei Vagin
Otherwise perf trace leaves a temprary 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
Quoted 7 lines
Cc Peter Zijlstra <[email protected]>Cc Ingo Molnar <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Alexander Shishkin <[email protected]>Cc Jiri Olsa <[email protected]>Cc Namhyung Kim <[email protected]>Signed-off-by Andrei Vagin <[email protected]>
for patchset:
thanks,
jirka
Quoted 35 lines
--- tools/perf/builtin-trace.c | 10 ++++++++++ 1 file changed, 10 insertions(+)tools/perf/builtin-trace.c +10
-0@@ -1164,6 +1164,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)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) {int idx;@@ -2508,6 +2516,8 @@ static int trace__run(struct trace *trace, int argc, const char **argv) } out_delete_evlist: +trace__symbols__exit (trace); +perf_evlist__delete (evlist); trace->evlist =NULL ; trace->live = false;Signature · 1 line
2.13.6
Arnaldo Carvalho de Melo
maintainerEm Wed, Nov 08, 2017 at 11:39:27AM +0100, Jiri Olsa escreveu:
Quoted 15 lines · Andrei Vagin
Quoted 6 lines
Otherwise perf trace leaves a temprary 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-5bCpD0Quoted 7 lines
Cc Peter Zijlstra <[email protected]>Cc Ingo Molnar <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Alexander Shishkin <[email protected]>Cc Jiri Olsa <[email protected]>Cc Namhyung Kim <[email protected]>Signed-off-by Andrei Vagin <[email protected]>
Quoted 3 lines
for patchset:
Reviewed-by Jiri Olsa <[email protected]>
Thanks, will apply.
- Arnaldo
tip-bot for Andrei Vagin
merge bot[tip:perf/urgent] perf trace: Call machine__exit() at exit
In reply to Andrei Vaginperf trace: Call machine__exit() at exit
Commit-ID: 33974a414ce2324554f75dbd204ff0868f499e32 Gitweb: https://git.kernel.org/tip/33974a414ce2324554f75dbd204ff0868f499e32 Author: Andrei Vagin <[email protected]> AuthorDate: Tue, 7 Nov 2017 16:22:45 -0800 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 9 Nov 2017 10:17:32 -0300
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
--- tools/perf/builtin-trace.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
tools/perf/builtin-trace.c +10 -0
@@ -1138,6 +1138,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)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) {int idx;
@@ -2481,6 +2489,8 @@ out_disable: } out_delete_evlist: +trace__symbols__exit (trace); +perf_evlist__delete (evlist); trace->evlist =NULL ; trace->live = false;