From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751143AbcFXHHl (ORCPT ); Fri, 24 Jun 2016 03:07:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40047 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbcFXHHk (ORCPT ); Fri, 24 Jun 2016 03:07:40 -0400 Date: Fri, 24 Jun 2016 09:07:36 +0200 From: Jiri Olsa To: Wang Nan Cc: acme@kernel.org, linux-kernel@vger.kernel.org, pi3orama@163.com, Arnaldo Carvalho de Melo Subject: Re: [PATCH 5/6] perf ctf: Add '--all' option for 'perf data convert' Message-ID: <20160624070736.GA10142@krava> References: <1466673383-105778-1-git-send-email-wangnan0@huawei.com> <1466673383-105778-6-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466673383-105778-6-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 24 Jun 2016 07:07:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2016 at 09:16:22AM +0000, Wang Nan wrote: > After this patch, 'perf data convert' convert comm events to output > CTF stream. > > Result: > > # perf record -a sleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.771 MB perf.data (79 samples) ] > > # perf data convert --to-ctf ./out.ctf > [ perf data convert: Converted 'perf.data' into CTF data './out.ctf' ] > [ perf data convert: Converted and wrote 0.004 MB (79 samples) ] > > # babeltrace ./out.ctf/ > [20:59:41.942633169] (+?.?????????) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81065AF4, perf_tid = 0, perf_pid = 0, perf_period = 1 } > [20:59:41.942636194] (+0.000003025) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81065AF4, perf_tid = 0, perf_pid = 0, perf_period = 1 } > ... // only sample event is converted > > # perf data convert --all --to-ctf ./out.ctf > [ perf data convert: Converted 'perf.data' into CTF data './out.ctf' ] > [ perf data convert: Converted and wrote 0.004 MB (79 samples) ] > > # babeltrace ./out.ctf/ > [00:00:00.000000000] (+?.?????????) perf_comm: { cpu_id = 0 }, { comm = "init", pid = 1, tid = 1 } > [00:00:00.000000000] (+0.000000000) perf_comm: { cpu_id = 0 }, { comm = "kthreadd", pid = 2, tid = 2 } > [00:00:00.000000000] (+0.000000000) perf_comm: { cpu_id = 0 }, { comm = "ksoftirqd/0", pid = 3, tid = 3 } > ... // comm events are converted > > Signed-off-by: Wang Nan > Cc: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > --- > tools/perf/Documentation/perf-data.txt | 5 ++++- > tools/perf/builtin-data.c | 1 + > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/Documentation/perf-data.txt b/tools/perf/Documentation/perf-data.txt > index be8fa1a..f8ada39 100644 > --- a/tools/perf/Documentation/perf-data.txt > +++ b/tools/perf/Documentation/perf-data.txt > @@ -34,7 +34,10 @@ OPTIONS for 'convert' > --verbose:: > Be more verbose (show counter open errors, etc). > > -SEE ALSO > +--all:: > + Convert all events, including non-sample events (comm, fork, ...), to output. > + Default is off, only convert samples. you removed the 'SEE ALSO' header ;-) > + > -------- > linkperf:perf[1] > [1] Common Trace Format - http://www.efficios.com/ctf > diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c > index a011a56..a87c964 100644 > --- a/tools/perf/builtin-data.c > +++ b/tools/perf/builtin-data.c > @@ -65,6 +65,7 @@ static int cmd_data_convert(int argc, const char **argv, > OPT_STRING(0, "to-ctf", &to_ctf, NULL, "Convert to CTF format"), > #endif > OPT_BOOLEAN('f', "force", &opts.force, "don't complain, do it"), > + OPT_BOOLEAN(0, "all", &opts.non_sample, "Convert all events"), IMO opts.all would suite better I think, but we can always change it if needed thanks, jirka