From patchwork Mon Jun 27 21:01:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 70960 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1257479qgy; Mon, 27 Jun 2016 14:04:44 -0700 (PDT) X-Received: by 10.98.152.210 with SMTP id d79mr36664396pfk.2.1467061483171; Mon, 27 Jun 2016 14:04:43 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c86si28651262pfd.26.2016.06.27.14.04.42; Mon, 27 Jun 2016 14:04:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752499AbcF0VCk (ORCPT + 30 others); Mon, 27 Jun 2016 17:02:40 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:52778 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbcF0VCI (ORCPT ); Mon, 27 Jun 2016 17:02:08 -0400 Received: from [179.235.155.208] (helo=jouet.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHdfR-00069Z-AX; Mon, 27 Jun 2016 21:02:05 +0000 Received: by jouet.infradead.org (Postfix, from userid 1000) id 22F9414312F; Mon, 27 Jun 2016 18:01:58 -0300 (BRT) From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Wang Nan , Zefan Li , pi3orama@163.com, Arnaldo Carvalho de Melo Subject: [PATCH 15/18] perf data ctf: Prepare collect non-sample events Date: Mon, 27 Jun 2016 18:01:37 -0300 Message-Id: <1467061300-5170-16-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467061300-5170-1-git-send-email-acme@kernel.org> References: <1467061300-5170-1-git-send-email-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Nan Following commits are going to allow 'perf data convert' to collect not only samples, but also non-sample events like comm and fork. In this patch we count non-sample events using c.non_sample_count, and prepare to print number of both type of events like: # ~/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.846 MB (6508 samples, 686 non-samples) ] Signed-off-by: Wang Nan Acked-by: Jiri Olsa Cc: Zefan Li Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1466767332-114472-5-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/data-convert-bt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index 09571b39f58a..3b3ac7c143e1 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -77,6 +77,7 @@ struct convert { u64 events_size; u64 events_count; + u64 non_sample_count; /* Ordered events configured queue size. */ u64 queue_size; @@ -1369,10 +1370,15 @@ int bt_convert__perf2ctf(const char *input, const char *path, file.path, path); fprintf(stderr, - "[ perf data convert: Converted and wrote %.3f MB (%" PRIu64 " samples) ]\n", + "[ perf data convert: Converted and wrote %.3f MB (%" PRIu64 " samples", (double) c.events_size / 1024.0 / 1024.0, c.events_count); + if (!c.non_sample_count) + fprintf(stderr, ") ]\n"); + else + fprintf(stderr, ", %" PRIu64 " non-samples) ]\n", c.non_sample_count); + cleanup_events(session); perf_session__delete(session); ctf_writer__cleanup(cw);