From: tip-bot for Wang Nan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com,
mingo@kernel.org, lizefan@huawei.com, wangnan0@huawei.com,
acme@redhat.com, jolsa@kernel.org
Subject: [tip:perf/core] perf data ctf: Generate fork and exit events to CTF output
Date: Wed, 29 Jun 2016 02:47:46 -0700 [thread overview]
Message-ID: <tip-ebccba3fe0a02f622f80e6be0e8ecb1a9a3ed983@git.kernel.org> (raw)
In-Reply-To: <1466767332-114472-8-git-send-email-wangnan0@huawei.com>
Commit-ID: ebccba3fe0a02f622f80e6be0e8ecb1a9a3ed983
Gitweb: http://git.kernel.org/tip/ebccba3fe0a02f622f80e6be0e8ecb1a9a3ed983
Author: Wang Nan <wangnan0@huawei.com>
AuthorDate: Fri, 24 Jun 2016 11:22:12 +0000
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 28 Jun 2016 10:54:58 -0300
perf data ctf: Generate fork and exit events to CTF output
If 'all' is selected, convert fork and exit events to output CTF stream.
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-8-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/data-convert-bt.c | 44 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index 5dd62ba..4f979bb 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -70,6 +70,8 @@ struct ctf_writer {
struct bt_ctf_field_type *array[6];
} data;
struct bt_ctf_event_class *comm_class;
+ struct bt_ctf_event_class *exit_class;
+ struct bt_ctf_event_class *fork_class;
};
struct convert {
@@ -812,6 +814,21 @@ __FUNC_PROCESS_NON_SAMPLE(comm,
__NON_SAMPLE_SET_FIELD(comm, u32, tid);
__NON_SAMPLE_SET_FIELD(comm, string, comm);
)
+__FUNC_PROCESS_NON_SAMPLE(fork,
+ __NON_SAMPLE_SET_FIELD(fork, u32, pid);
+ __NON_SAMPLE_SET_FIELD(fork, u32, ppid);
+ __NON_SAMPLE_SET_FIELD(fork, u32, tid);
+ __NON_SAMPLE_SET_FIELD(fork, u32, ptid);
+ __NON_SAMPLE_SET_FIELD(fork, u64, time);
+)
+
+__FUNC_PROCESS_NON_SAMPLE(exit,
+ __NON_SAMPLE_SET_FIELD(fork, u32, pid);
+ __NON_SAMPLE_SET_FIELD(fork, u32, ppid);
+ __NON_SAMPLE_SET_FIELD(fork, u32, tid);
+ __NON_SAMPLE_SET_FIELD(fork, u32, ptid);
+ __NON_SAMPLE_SET_FIELD(fork, u64, time);
+)
#undef __NON_SAMPLE_SET_FIELD
#undef __FUNC_PROCESS_NON_SAMPLE
@@ -1127,6 +1144,22 @@ __FUNC_ADD_NON_SAMPLE_EVENT_CLASS(comm,
__NON_SAMPLE_ADD_FIELD(string, comm);
)
+__FUNC_ADD_NON_SAMPLE_EVENT_CLASS(fork,
+ __NON_SAMPLE_ADD_FIELD(u32, pid);
+ __NON_SAMPLE_ADD_FIELD(u32, ppid);
+ __NON_SAMPLE_ADD_FIELD(u32, tid);
+ __NON_SAMPLE_ADD_FIELD(u32, ptid);
+ __NON_SAMPLE_ADD_FIELD(u64, time);
+)
+
+__FUNC_ADD_NON_SAMPLE_EVENT_CLASS(exit,
+ __NON_SAMPLE_ADD_FIELD(u32, pid);
+ __NON_SAMPLE_ADD_FIELD(u32, ppid);
+ __NON_SAMPLE_ADD_FIELD(u32, tid);
+ __NON_SAMPLE_ADD_FIELD(u32, ptid);
+ __NON_SAMPLE_ADD_FIELD(u64, time);
+)
+
#undef __NON_SAMPLE_ADD_FIELD
#undef __FUNC_ADD_NON_SAMPLE_EVENT_CLASS
@@ -1138,6 +1171,12 @@ static int setup_non_sample_events(struct ctf_writer *cw,
ret = add_comm_event(cw);
if (ret)
return ret;
+ ret = add_exit_event(cw);
+ if (ret)
+ return ret;
+ ret = add_fork_event(cw);
+ if (ret)
+ return ret;
return 0;
}
@@ -1436,8 +1475,11 @@ int bt_convert__perf2ctf(const char *input, const char *path,
struct ctf_writer *cw = &c.writer;
int err = -1;
- if (opts->all)
+ if (opts->all) {
c.tool.comm = process_comm_event;
+ c.tool.exit = process_exit_event;
+ c.tool.fork = process_fork_event;
+ }
perf_config(convert__config, &c);
next prev parent reply other threads:[~2016-06-29 9:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-24 11:22 [PATCH v2 0/7] perf ctf: Convert comm, fork and exit events to CTF Wang Nan
2016-06-24 11:22 ` [PATCH v2 1/7] perf ctf: Add value_set_string() helper Wang Nan
2016-06-29 9:45 ` [tip:perf/core] perf data " tip-bot for Wang Nan
2016-06-24 11:22 ` [PATCH v2 2/7] perf ctf: Pass convert options through opts structure Wang Nan
2016-06-29 9:45 ` [tip:perf/core] perf data " tip-bot for Wang Nan
2016-06-24 11:22 ` [PATCH v2 3/7] perf ctf: Add 'all' option Wang Nan
2016-06-29 9:46 ` [tip:perf/core] perf data " tip-bot for Wang Nan
2016-06-24 11:22 ` [PATCH v2 4/7] perf ctf: Prepare collect non-sample events Wang Nan
2016-06-29 9:46 ` [tip:perf/core] perf data " tip-bot for Wang Nan
2016-06-24 11:22 ` [PATCH v2 5/7] perf ctf: Generate comm event to CTF output Wang Nan
2016-06-29 9:46 ` [tip:perf/core] perf data " tip-bot for Wang Nan
2016-06-24 11:22 ` [PATCH v2 6/7] perf ctf: Add '--all' option for 'perf data convert' Wang Nan
2016-06-29 9:47 ` [tip:perf/core] perf data " tip-bot for Wang Nan
2016-06-24 11:22 ` [PATCH v2 7/7] perf ctf: Generate fork and exit events to CTF output Wang Nan
2016-06-29 9:47 ` tip-bot for Wang Nan [this message]
2016-06-24 12:28 ` [PATCH v2 0/7] perf ctf: Convert comm, fork and exit events to CTF Jiri Olsa
2016-06-27 19:03 ` Arnaldo Carvalho de Melo
2016-06-24 12:29 ` Jiri Olsa
2016-06-24 12:33 ` pi3orama
2016-06-24 12:55 ` Jiri Olsa
2016-06-24 12:41 ` Arnaldo Carvalho de Melo
2016-06-24 12:43 ` pi3orama
2016-06-24 13:08 ` Jiri Olsa
2016-06-24 12:44 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-ebccba3fe0a02f622f80e6be0e8ecb1a9a3ed983@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome