linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf/trace: call machine__exit() at exiting
@ 2017-11-08  0:22 Andrei Vagin
  2017-11-08  0:22 ` [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init Andrei Vagin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrei Vagin @ 2017-11-08  0:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Vasily Averin, Andrei Vagin, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim

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

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Andrei Vagin <avagin@openvz.org>
---
 tools/perf/builtin-trace.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 505b871fdc82..f2757d38c7d7 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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;
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init
  2017-11-08  0:22 [PATCH 1/2] perf/trace: call machine__exit() at exiting Andrei Vagin
@ 2017-11-08  0:22 ` Andrei Vagin
  2017-11-18  8:25   ` [tip:perf/core] perf trace: Fix " tip-bot for Andrei Vagin
  2017-11-29  6:28   ` tip-bot for Andrei Vagin
  2017-11-08 10:39 ` [PATCH 1/2] perf/trace: call machine__exit() at exiting Jiri Olsa
  2017-11-11  8:13 ` [tip:perf/urgent] perf trace: Call machine__exit() at exit tip-bot for Andrei Vagin
  2 siblings, 2 replies; 7+ messages in thread
From: Andrei Vagin @ 2017-11-08  0:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Vasily Averin, Andrei Vagin, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim

Currently if trace_event__register_resolver() fails, we return -errno,
but we can't be sure that errno isn't zero in this case.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Andrei Vagin <avagin@openvz.org>
---
 tools/perf/builtin-trace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f2757d38c7d7..84debdbad327 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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();
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] perf/trace: call machine__exit() at exiting
  2017-11-08  0:22 [PATCH 1/2] perf/trace: call machine__exit() at exiting Andrei Vagin
  2017-11-08  0:22 ` [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init Andrei Vagin
@ 2017-11-08 10:39 ` Jiri Olsa
  2017-11-08 13:33   ` Arnaldo Carvalho de Melo
  2017-11-11  8:13 ` [tip:perf/urgent] perf trace: Call machine__exit() at exit tip-bot for Andrei Vagin
  2 siblings, 1 reply; 7+ messages in thread
From: Jiri Olsa @ 2017-11-08 10:39 UTC (permalink / raw)
  To: Andrei Vagin
  Cc: linux-kernel, Vasily Averin, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Namhyung Kim

On Tue, Nov 07, 2017 at 04:22:45PM -0800, Andrei Vagin wrote:
> 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
> 
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Andrei Vagin <avagin@openvz.org>

for patchset:

Reviewed-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

> ---
>  tools/perf/builtin-trace.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index 505b871fdc82..f2757d38c7d7 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -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;
> -- 
> 2.13.6
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] perf/trace: call machine__exit() at exiting
  2017-11-08 10:39 ` [PATCH 1/2] perf/trace: call machine__exit() at exiting Jiri Olsa
@ 2017-11-08 13:33   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-11-08 13:33 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Andrei Vagin, linux-kernel, Vasily Averin, Peter Zijlstra,
	Ingo Molnar, Alexander Shishkin, Namhyung Kim

Em Wed, Nov 08, 2017 at 11:39:27AM +0100, Jiri Olsa escreveu:
> On Tue, Nov 07, 2017 at 04:22:45PM -0800, Andrei Vagin wrote:
> > 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
> > 
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> > Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> > Cc: Jiri Olsa <jolsa@redhat.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Signed-off-by: Andrei Vagin <avagin@openvz.org>
> 
> for patchset:
> 
> Reviewed-by: Jiri Olsa <jolsa@kernel.org>

Thanks, will apply.

- Arnaldo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:perf/urgent] perf trace: Call machine__exit() at exit
  2017-11-08  0:22 [PATCH 1/2] perf/trace: call machine__exit() at exiting Andrei Vagin
  2017-11-08  0:22 ` [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init Andrei Vagin
  2017-11-08 10:39 ` [PATCH 1/2] perf/trace: call machine__exit() at exiting Jiri Olsa
@ 2017-11-11  8:13 ` tip-bot for Andrei Vagin
  2 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Andrei Vagin @ 2017-11-11  8:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: alexander.shishkin, hpa, jolsa, mingo, vvs, acme, tglx, peterz,
	linux-kernel, namhyung, avagin

Commit-ID:  33974a414ce2324554f75dbd204ff0868f499e32
Gitweb:     https://git.kernel.org/tip/33974a414ce2324554f75dbd204ff0868f499e32
Author:     Andrei Vagin <avagin@openvz.org>
AuthorDate: Tue, 7 Nov 2017 16:22:45 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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

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>
---
 tools/perf/builtin-trace.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 771ddab..d5d7fff 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip:perf/core] perf trace: Fix an exit code of trace__symbols_init
  2017-11-08  0:22 ` [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init Andrei Vagin
@ 2017-11-18  8:25   ` tip-bot for Andrei Vagin
  2017-11-29  6:28   ` tip-bot for Andrei Vagin
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Andrei Vagin @ 2017-11-18  8:25 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, linux-kernel, avagin, tglx, acme, mingo, hpa, namhyung,
	alexander.shishkin, peterz, vvs

Commit-ID:  cbd5c1787bab4643e5959522275b46de94eba5ac
Gitweb:     https://git.kernel.org/tip/cbd5c1787bab4643e5959522275b46de94eba5ac
Author:     Andrei Vagin <avagin@openvz.org>
AuthorDate: Tue, 7 Nov 2017 16:22:46 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

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-2-avagin@openvz.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f2757d3..84debdb 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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();
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip:perf/core] perf trace: Fix an exit code of trace__symbols_init
  2017-11-08  0:22 ` [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init Andrei Vagin
  2017-11-18  8:25   ` [tip:perf/core] perf trace: Fix " tip-bot for Andrei Vagin
@ 2017-11-29  6:28   ` tip-bot for Andrei Vagin
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Andrei Vagin @ 2017-11-29  6:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, acme, namhyung, mingo, peterz, tglx, avagin, jolsa,
	alexander.shishkin, vvs, linux-kernel

Commit-ID:  35c33633abc14b906e84b7b0115ede6df6830120
Gitweb:     https://git.kernel.org/tip/35c33633abc14b906e84b7b0115ede6df6830120
Author:     Andrei Vagin <avagin@openvz.org>
AuthorDate: Tue, 7 Nov 2017 16:22:46 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

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-2-avagin@openvz.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f2757d3..84debdb 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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();
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-29  6:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08  0:22 [PATCH 1/2] perf/trace: call machine__exit() at exiting Andrei Vagin
2017-11-08  0:22 ` [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init Andrei Vagin
2017-11-18  8:25   ` [tip:perf/core] perf trace: Fix " tip-bot for Andrei Vagin
2017-11-29  6:28   ` tip-bot for Andrei Vagin
2017-11-08 10:39 ` [PATCH 1/2] perf/trace: call machine__exit() at exiting Jiri Olsa
2017-11-08 13:33   ` Arnaldo Carvalho de Melo
2017-11-11  8:13 ` [tip:perf/urgent] perf trace: Call machine__exit() at exit tip-bot for Andrei Vagin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).