Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: gbastien+lttng@versatic.net (Geneviève Bastien)
Subject: [lttng-dev] [Patch LTTng-ust v2 1/7] Update data structures to support CTF global type declarations
Date: Tue, 11 Feb 2014 16:35:30 -0500	[thread overview]
Message-ID: <1392154536-31191-2-git-send-email-gbastien+lttng@versatic.net> (raw)
In-Reply-To: <1392154536-31191-1-git-send-email-gbastien+lttng@versatic.net>

The structures match those in LTTng-tools to support global type declarations
in general and CTF enumerations in particular.

Note: This patch uses the lttng_enum structure in ust-events.h and modifies
the container_type field. This structure was not used and has never been used
as far as we know.

Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
---
 include/lttng/ust-ctl.h    | 36 +++++++++++++++++++++++++++++++++++-
 include/lttng/ust-events.h | 20 +++++++++++++++++++-
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h
index 40e831e..783492b 100644
--- a/include/lttng/ust-ctl.h
+++ b/include/lttng/ust-ctl.h
@@ -295,13 +295,23 @@ struct ustctl_float_type {
 	char padding[USTCTL_UST_FLOAT_TYPE_PADDING];
 } LTTNG_PACKED;
 
-#define USTCTL_UST_BASIC_TYPE_PADDING	296
+#define USTCTL_UST_ENUM_ENTRY_PADDING	296
+struct ustctl_enum_entry {
+	unsigned long long start, end;	/* start and end are inclusive */
+	char string[LTTNG_UST_SYM_NAME_LEN];
+	char padding[USTCTL_UST_ENUM_ENTRY_PADDING];
+};
+
+#define USTCTL_UST_BASIC_TYPE_PADDING	40
 union _ustctl_basic_type {
 	struct ustctl_integer_type integer;
 	struct {
 		enum ustctl_string_encodings encoding;
 	} string;
 	struct ustctl_float_type _float;
+	struct {
+		char name[LTTNG_UST_SYM_NAME_LEN];
+	} enumeration;
 	char padding[USTCTL_UST_BASIC_TYPE_PADDING];
 } LTTNG_PACKED;
 
@@ -329,6 +339,30 @@ struct ustctl_type {
 	} u;
 } LTTNG_PACKED;
 
+#define USTCTL_UST_ENUM_TYPE_PADDING	296
+struct ustctl_enum {
+	char name[LTTNG_UST_SYM_NAME_LEN];
+	struct ustctl_integer_type container_type;
+	struct ustctl_enum_entry *entries;
+	unsigned int len;
+	char padding[USTCTL_UST_ENUM_TYPE_PADDING];
+} LTTNG_PACKED;
+
+/* CTF categories for global types declared outside event descriptions */
+enum ustctl_global_type_categories {
+	ustctl_mtype_enum,
+	NR_USTCTL_GLOBAL_TYPES,
+};
+
+#define USTCTL_UST_GLOBAL_TYPES_PADDING 640
+struct ustctl_global_type_decl {
+	uint32_t mtype;
+	union {
+		struct ustctl_enum ctf_enum;
+		char padding[USTCTL_UST_GLOBAL_TYPES_PADDING];
+	} u;
+};
+
 #define USTCTL_UST_FIELD_PADDING	28
 struct ustctl_field {
 	char name[LTTNG_UST_SYM_NAME_LEN];
diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h
index d93c912..a683de8 100644
--- a/include/lttng/ust-events.h
+++ b/include/lttng/ust-events.h
@@ -89,6 +89,12 @@ enum lttng_string_encodings {
 	NR_STRING_ENCODINGS,
 };
 
+/* CTF categories for global types declared outside event descriptions */
+enum lttng_global_type_categories {
+	mtype_enum,
+	NR_GLOBAL_TYPES,
+};
+
 #define LTTNG_UST_ENUM_ENTRY_PADDING	16
 struct lttng_enum_entry {
 	unsigned long long start, end;	/* start and end are inclusive */
@@ -204,12 +210,22 @@ struct lttng_type {
 #define LTTNG_UST_ENUM_TYPE_PADDING	24
 struct lttng_enum {
 	const char *name;
-	struct lttng_type container_type;
+	struct lttng_integer_type container_type;
 	const struct lttng_enum_entry *entries;
 	unsigned int len;
 	char padding[LTTNG_UST_ENUM_TYPE_PADDING];
 };
 
+#define LTTNG_UST_GLOBAL_TYPES_PADDING	60
+struct lttng_global_type_decl {
+	enum lttng_global_type_categories mtype;
+	unsigned int nowrite; /* inherited from the field using it */
+	union {
+		const struct lttng_enum *ctf_enum;
+		char padding[LTTNG_UST_GLOBAL_TYPES_PADDING];
+	} u;
+};
+
 /*
  * Event field description
  *
@@ -267,6 +283,8 @@ struct lttng_event_desc {
 	union {
 		struct {
 			const char **model_emf_uri;
+			unsigned int nr_global_type_decl;
+			const struct lttng_global_type_decl *global_type_decl;
 		} ext;
 		char padding[LTTNG_UST_EVENT_DESC_PADDING];
 	} u;
-- 
1.8.5.4




  reply	other threads:[~2014-02-11 21:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1390593885-7463-1-git-send-email-gbastien+lttng@versatic.net>
     [not found] ` <1390593885-7463-7-git-send-email-gbastien+lttng@versatic.net>
     [not found]   ` <1490865069.16181.1391132259063.JavaMail.zimbra@efficios.com>
     [not found]     ` <52EB0287.4000105@mentor.com>
2014-02-03 15:28       ` [lttng-dev] [Patch LTTng-ust 6/7] Add the macros to generate the data structures for CTF named enumerations Mathieu Desnoyers
2014-02-03 15:41         ` Stefan Seefeld
2014-02-03 16:17           ` Mathieu Desnoyers
     [not found] ` <1390593885-7463-2-git-send-email-gbastien+lttng@versatic.net>
     [not found]   ` <2139172576.16061.1391123211482.JavaMail.zimbra@efficios.com>
     [not found]     ` <52EC0746.2020200@versatic.net>
2014-02-03 15:31       ` [lttng-dev] [Patch LTTng-ust 1/7] Add or update data structures to support CTF named metadata Mathieu Desnoyers
2014-02-11 21:35 ` [lttng-dev] LTTng-ust: Add support of global types and CTF enumerations Geneviève Bastien
2014-02-11 21:35   ` Geneviève Bastien [this message]
2014-02-11 21:35   ` [lttng-dev] [Patch LTTng-ust v2 2/7] Add empty macros to support CTF global enumerations Geneviève Bastien
2014-02-11 21:35   ` [lttng-dev] [Patch LTTng-ust v2 3/7] Add an example using CTF global type enumerations Geneviève Bastien
2014-02-11 21:35   ` [lttng-dev] [Patch LTTng-ust v2 4/7] Serialize the CTF global enumerations data structures for ust-comm Geneviève Bastien
2014-02-11 21:35   ` [lttng-dev] [Patch LTTng-ust v2 5/7] Send and receive serialized data for CTF global enumerations Geneviève Bastien
2014-02-11 21:35   ` [lttng-dev] [Patch LTTng-ust v2 6/7] Add the macros to generate the data structures " Geneviève Bastien
2014-02-11 21:35   ` [lttng-dev] [Patch LTTng-ust v2 7/7] Update the LTTng documentation with " Geneviève Bastien

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=1392154536-31191-2-git-send-email-gbastien+lttng@versatic.net \
    --to=gbastien+lttng@versatic.net \
    /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