All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Geneviève Bastien" <gbastien+lttng@versatic.net>
To: lttng-dev@lists.lttng.org
Subject: [RFC Patch Ust 4/5] Update the ctf-global-type example to show the usage of a global structure
Date: Wed, 26 Mar 2014 10:47:11 -0400	[thread overview]
Message-ID: <1395845232-17669-5-git-send-email-gbastien+lttng__4820.04142036221$1395845461$gmane$org@versatic.net> (raw)
In-Reply-To: <1395845232-17669-1-git-send-email-gbastien+lttng@versatic.net>

Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
---
 tests/ctf-global-types/ctf-global-types.c          |  8 ++++++--
 .../ctf-global-types/ust_tests_ctf_global_types.h  | 22 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/tests/ctf-global-types/ctf-global-types.c b/tests/ctf-global-types/ctf-global-types.c
index 81b69e1..55c2ad0 100644
--- a/tests/ctf-global-types/ctf-global-types.c
+++ b/tests/ctf-global-types/ctf-global-types.c
@@ -25,6 +25,7 @@ int main(int argc, char **argv)
 {
 	int i;
 	int delay = 0;
+	char text[10] = "test";
 
 	if (argc == 2)
 		delay = atoi(argv[1]);
@@ -34,8 +35,11 @@ int main(int argc, char **argv)
 	sleep(delay);
 
 	fprintf(stderr, "Tracing... ");
-	for (i = 0; i < 100; i++) {
-		tracepoint(ust_tests_ctf_global_types, tptest, i, (i % 6));
+	for (i = 0; i < 20; i++) {
+		tracepoint(ust_tests_ctf_global_types, tptest, i, (i % 6), text, strlen(text));
+		if (i == 10) {
+			strcpy(text, "abcdefgh");
+		}
 	}
 
 	for (i = 0; i < 10; i++) {
diff --git a/tests/ctf-global-types/ust_tests_ctf_global_types.h b/tests/ctf-global-types/ust_tests_ctf_global_types.h
index 6fe2058..7b704d2 100644
--- a/tests/ctf-global-types/ust_tests_ctf_global_types.h
+++ b/tests/ctf-global-types/ust_tests_ctf_global_types.h
@@ -38,16 +38,36 @@ TRACEPOINT_ENUM(ust_tests_ctf_global_types, testenum,
 	)
 )
 
+TRACEPOINT_STRUCT(ust_tests_ctf_global_types, inner,
+	TP_ARGS(char *, text, size_t, textlen,
+		int, enumvalue),
+	TP_FIELDS(
+		ctf_array(char, arrfield, text, 10)
+		ctf_sequence(char, seqfield, text, size_t, textlen)
+		ctf_enum(ust_tests_ctf_global_types, testenum, enumfield, enumvalue)
+	)
+)
+
+TRACEPOINT_STRUCT(ust_tests_ctf_global_types, outer,
+	TP_ARGS(char *, text, size_t, textlen,
+		int, enumvalue),
+	TP_FIELDS(
+		ctf_string(stringfield, text)
+		ctf_struct(ust_tests_ctf_global_types, inner, structfield, text, textlen, enumvalue)
+	)
+)
+
 /*
  * Enumeration field is used twice to make sure the global type declaration
  * is entered only once in the metadata file.
  */
 TRACEPOINT_EVENT(ust_tests_ctf_global_types, tptest,
-	TP_ARGS(int, anint, int, enumval),
+	TP_ARGS(int, anint, int, enumval, char *, text, size_t, textlen),
 	TP_FIELDS(
 		ctf_integer(int, intfield, anint)
 		ctf_enum(ust_tests_ctf_global_types, testenum, enumfield, enumval)
 		ctf_enum(ust_tests_ctf_global_types, testenum, enumfield_bis, enumval)
+		ctf_struct(ust_tests_ctf_global_types, outer, structfield, text, textlen, enumval)
 	)
 )
 
-- 
1.9.1


_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

  parent reply	other threads:[~2014-03-26 14:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1395845232-17669-1-git-send-email-gbastien+lttng@versatic.net>
2014-03-26 14:47 ` [RFC Patch Ust 1/5] Update data structures to support CTF global structures Geneviève Bastien
2014-03-26 14:47 ` [RFC Patch Ust 2/5] Serialize the CTF global structures for ust-comm Geneviève Bastien
2014-03-26 14:47 ` [RFC Patch Ust 3/5] Add the macros to generate the data structures for CTF global structures Geneviève Bastien
2014-03-26 14:47 ` Geneviève Bastien [this message]
2014-03-26 14:47 ` [RFC Patch Ust 5/5] Update the LTTng documentation with " Geneviève Bastien
     [not found] ` <1395845232-17669-2-git-send-email-gbastien+lttng@versatic.net>
2014-04-09 15:36   ` [RFC Patch Ust 1/5] Update data structures to support " Mathieu Desnoyers
     [not found]   ` <953381139.1247.1397057797666.JavaMail.zimbra@efficios.com>
2014-04-09 17:29     ` Geneviève Bastien
     [not found]     ` <5345836A.1090509@versatic.net>
2014-04-27 11:24       ` Mathieu Desnoyers
     [not found] ` <1395845232-17669-3-git-send-email-gbastien+lttng@versatic.net>
2014-04-09 15:42   ` [RFC Patch Ust 2/5] Serialize the CTF global structures for ust-comm Mathieu Desnoyers
     [not found]   ` <224451157.1253.1397058138828.JavaMail.zimbra@efficios.com>
2014-04-09 17:33     ` Geneviève Bastien
     [not found]     ` <53458452.8030905@versatic.net>
2014-04-27  8:34       ` Mathieu Desnoyers
     [not found]       ` <2087397408.8083.1398587642565.JavaMail.zimbra@efficios.com>
2014-05-01  1:05         ` Geneviève Bastien
     [not found]         ` <53619DDF.5060909@versatic.net>
2014-05-02  9:29           ` Mathieu Desnoyers

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='1395845232-17669-5-git-send-email-gbastien+lttng__4820.04142036221$1395845461$gmane$org@versatic.net' \
    --to=gbastien+lttng@versatic.net \
    --cc=lttng-dev@lists.lttng.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.