Commit 8ee4c46c authored by Wang Nan's avatar Wang Nan Committed by Arnaldo Carvalho de Melo

perf data ctf: Prepare collect non-sample events

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: default avatarWang Nan <wangnan0@huawei.com>
Acked-by: default avatarJiri 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f02a6489
...@@ -77,6 +77,7 @@ struct convert { ...@@ -77,6 +77,7 @@ struct convert {
u64 events_size; u64 events_size;
u64 events_count; u64 events_count;
u64 non_sample_count;
/* Ordered events configured queue size. */ /* Ordered events configured queue size. */
u64 queue_size; u64 queue_size;
...@@ -1369,10 +1370,15 @@ int bt_convert__perf2ctf(const char *input, const char *path, ...@@ -1369,10 +1370,15 @@ int bt_convert__perf2ctf(const char *input, const char *path,
file.path, path); file.path, path);
fprintf(stderr, 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, (double) c.events_size / 1024.0 / 1024.0,
c.events_count); 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); cleanup_events(session);
perf_session__delete(session); perf_session__delete(session);
ctf_writer__cleanup(cw); ctf_writer__cleanup(cw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment