linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf data: Show error message when ctf setup failed
@ 2015-04-08  4:49 He Kuang
  2015-04-08  4:49 ` [PATCH 2/2] perf data: Fix ctf_writer setupenv failure He Kuang
  2015-04-08 17:45 ` [PATCH 1/2] perf data: Show error message when ctf setup failed Jiri Olsa
  0 siblings, 2 replies; 19+ messages in thread
From: He Kuang @ 2015-04-08  4:49 UTC (permalink / raw)
  To: bigeasy, jolsa, acme, a.p.zijlstra, mingo; +Cc: wangnan0, linux-kernel

Show message when errors occurred during ctf conversion setup.

Before this patch:
  $ ./perf data convert --to-ctf=ctf
  $ echo $?
  255

After this patch:
  $ ./perf data convert --to-ctf=ctf
  Error during CTF convert setup.

Signed-off-by: He Kuang <hekuang@huawei.com>
---
 tools/perf/util/data-convert-bt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index dd17c9a..a5b89b9 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -847,11 +847,15 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force)
 		(double) c.events_size / 1024.0 / 1024.0,
 		c.events_count);
 
-	/* its all good */
-free_session:
 	perf_session__delete(session);
+	ctf_writer__cleanup(cw);
+
+	return err;
 
+free_session:
+	perf_session__delete(session);
 free_writer:
 	ctf_writer__cleanup(cw);
+	pr_err("Error during CTF convert setup.\n");
 	return err;
 }
-- 
2.3.3.220.g9ab698f


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

end of thread, other threads:[~2015-04-18 14:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08  4:49 [PATCH 1/2] perf data: Show error message when ctf setup failed He Kuang
2015-04-08  4:49 ` [PATCH 2/2] perf data: Fix ctf_writer setupenv failure He Kuang
2015-04-08 17:59   ` Jiri Olsa
2015-04-09  7:38     ` He Kuang
2015-04-09 19:57       ` Jérémie Galarneau
2015-04-10  7:39         ` He Kuang
2015-04-10 12:38           ` Jiri Olsa
2015-04-08 17:45 ` [PATCH 1/2] perf data: Show error message when ctf setup failed Jiri Olsa
2015-04-09  7:56   ` [PATCHv2 1/2] perf data: Show error message when conversion failed He Kuang
2015-04-09  9:45     ` Jiri Olsa
2015-04-18 14:00       ` Jiri Olsa
2015-04-09  8:19   ` [PATCH 1/2] perf data: Show error message when ctf setup failed He Kuang
2015-04-09  9:46     ` Jiri Olsa
2015-04-09 14:37       ` Alexandre Montplaisir
2015-04-10 12:05         ` Jiri Olsa
2015-04-10 12:37           ` Jiri Olsa
2015-04-13 20:30             ` Jérémie Galarneau
2015-04-14 17:47               ` Jérémie Galarneau
2015-04-18 13:58                 ` Jiri Olsa

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).