Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1432323
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 15/18] perf data ctf: Prepare collect non-sample events |
| Date | 2016-06-27 23:10 +0200 |
| Message-ID | <rOLX4-5DX-41@gated-at.bofh.it> (permalink) |
| References | <rOLX3-5DX-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Wang Nan <wangnan0@huawei.com>
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 <wangnan0@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
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 <acme@redhat.com>
---
tools/perf/util/data-convert-bt.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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);
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 09/18] perf record: Prepare reading from multiple evlists in record__mmap_read_all() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 16/18] perf data ctf: Generate comm event to CTF output Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 06/18] perf build: Add libbabeltrace to build-test Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 08/18] perf record: Move mmap setup block to separate function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 11/18] perf symbols: Use proper dso name for is_regular_file Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 13/18] perf data ctf: Pass convert options through opts structure Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 07/18] perf data convert: Include config.h header Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 15/18] perf data ctf: Prepare collect non-sample events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 12/18] perf data ctf: Add value_set_string() helper Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 18/18] perf data ctf: Generate fork and exit events to CTF output Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 17/18] perf data ctf: Add '--all' option for 'perf data convert' Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
[PATCH 02/18] perf tools: Update makefile message for installing slang devel package Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 23:10 +0200
Re: [GIT PULL 00/18] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-06-28 09:10 +0200
Re: [GIT PULL 00/18] perf/core improvements and fixes Jiri Olsa <jolsa@redhat.com> - 2016-06-28 10:30 +0200
Re: [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-28 16:10 +0200
Re: [GIT PULL 00/18] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-28 16:20 +0200
Re: [GIT PULL 00/18] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-06-29 11:40 +0200
csiph-web