diff options
author | Wang Nan <wangnan0@huawei.com> | 2016-06-24 07:22:11 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-28 09:54:57 -0400 |
commit | 9e1a7ea19f9f8e3e40c5ad1a5cc3615c1746ae7b (patch) | |
tree | bbdec8fb4bf23b77f8c1fb68073bca0f49150e29 /tools | |
parent | f5a08ceda55bee91f879d2ac19edeb4a8916d04f (diff) |
perf data ctf: Add '--all' option for 'perf data convert'
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.378 MB perf.data (73 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.003 MB (73 samples) ]
# babeltrace --clock-seconds ./out.ctf/
[10627.402515791] (+?.?????????) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81065AF4, perf_tid = 0, perf_pid = 0, perf_period = 1 }
[10627.402518972] (+0.000003181) 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.023 MB (73 samples, 384 non-samples) ]
# babeltrace --clock-seconds ./out.ctf/
[ 0.000000000] (+?.?????????) perf_comm: { cpu_id = 0 }, { pid = 1, tid = 1, comm = "init" }
[ 0.000000000] (+0.000000000) perf_comm: { cpu_id = 0 }, { pid = 2, tid = 2, comm = "kthreadd" }
[ 0.000000000] (+0.000000000) perf_comm: { cpu_id = 0 }, { pid = 3, tid = 3, comm = "ksoftirqd/0" }
... // comm events are converted
[10627.402515791] (+10627.402515791) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81065AF4, perf_tid = 0, perf_pid = 0, perf_period = 1 }
[10627.402518972] (+0.000003181) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81065AF4, perf_tid = 0, perf_pid = 0, perf_period = 1 }
... // samples are also converted
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-7-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Documentation/perf-data.txt | 4 | ||||
-rw-r--r-- | tools/perf/builtin-data.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf-data.txt b/tools/perf/Documentation/perf-data.txt index be8fa1a0a97e..f0796a47dfa3 100644 --- a/tools/perf/Documentation/perf-data.txt +++ b/tools/perf/Documentation/perf-data.txt | |||
@@ -34,6 +34,10 @@ OPTIONS for 'convert' | |||
34 | --verbose:: | 34 | --verbose:: |
35 | Be more verbose (show counter open errors, etc). | 35 | Be more verbose (show counter open errors, etc). |
36 | 36 | ||
37 | --all:: | ||
38 | Convert all events, including non-sample events (comm, fork, ...), to output. | ||
39 | Default is off, only convert samples. | ||
40 | |||
37 | SEE ALSO | 41 | SEE ALSO |
38 | -------- | 42 | -------- |
39 | linkperf:perf[1] | 43 | linkperf:perf[1] |
diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c index ddfe3ac4c7f7..7ad6e17ac6b3 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, | |||
65 | OPT_STRING(0, "to-ctf", &to_ctf, NULL, "Convert to CTF format"), | 65 | OPT_STRING(0, "to-ctf", &to_ctf, NULL, "Convert to CTF format"), |
66 | #endif | 66 | #endif |
67 | OPT_BOOLEAN('f', "force", &opts.force, "don't complain, do it"), | 67 | OPT_BOOLEAN('f', "force", &opts.force, "don't complain, do it"), |
68 | OPT_BOOLEAN(0, "all", &opts.all, "Convert all events"), | ||
68 | OPT_END() | 69 | OPT_END() |
69 | }; | 70 | }; |
70 | 71 | ||