From: gbastien+lttng@versatic.net (Geneviève Bastien)
Subject: [lttng-dev] [Patch LTTng-ust v2 7/7] Update the LTTng documentation with CTF global enumerations
Date: Tue, 11 Feb 2014 16:35:36 -0500 [thread overview]
Message-ID: <1392154536-31191-8-git-send-email-gbastien+lttng@versatic.net> (raw)
In-Reply-To: <1392154536-31191-1-git-send-email-gbastien+lttng@versatic.net>
Signed-off-by: Genevi?ve Bastien <gbastien+lttng at versatic.net>
---
doc/man/lttng-ust.3 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/doc/man/lttng-ust.3 b/doc/man/lttng-ust.3
index 7624e88..9958e59 100644
--- a/doc/man/lttng-ust.3
+++ b/doc/man/lttng-ust.3
@@ -158,6 +158,14 @@ TRACEPOINT_EVENT(
*/
ctf_float(float, floatfield, floatarg)
ctf_float(double, doublefield, doublearg)
+
+ /*
+ * ctf_enum: a field using a previously declared global enumeration
+ * args: (provider, enum name, field name, argument expression)
+ * The enumeration itself and its values must have been defined
+ * previously with the TRACEPOINT_ENUM macro, described below.
+ */
+ ctf_enum(sample_component, enumeration_name, enumfield, enumarg)
)
)
@@ -165,6 +173,55 @@ There can be an arbitrary number of tracepoint providers within an
application, but they must each have their own provider name. Duplicate
provider names are not allowed.
+The CTF specification also supports some global named basic and compound types
+that can be declared inside a tracepoint provider and used as fields in the
+tracepoint. This shows how to specify them and what they can be used for:
+
+The enumeration is a mapping between an integer, or a range of integers, and a
+string. It can be used to have a more compact trace in cases where the possible
+values for a field are limited:
+
+TRACEPOINT_ENUM(
+ /*
+ * The provider name, as described in the TRACEPOINT_EVENT macro.
+ */
+ sample_component,
+
+ /*
+ * The name of this enumeration, that will be used when using this
+ * global type in tracepoint fields.
+ */
+ enumeration_name,
+
+ /*
+ * Integer type by which this enumeration will be represented.
+ * It can be: char, int, long or any variant on those
+ */
+ type,
+
+ /*
+ * TP_ENUM_VALUES describe the values of this enumeration and what they
+ * map to.
+ */
+ TP_ENUM_VALUES(
+ /*
+ * Maps an integer with this string value. By default, enumerations
+ * start at 0 and increment 1 for each entry.
+ */
+ ctf_enum_value(string_value)
+
+ /*
+ * Maps the string value to integers in the range 'start' to 'end'
+ * inclusively. If 'start' == 'end', then the string is mapped to
+ * a specific value.
+ * Enumeration ranges may overlap, but the behavior is
+ * implementation-defined, each trace reader will handle overlapping
+ * as it wishes.
+ */
+ ctf_enum_range(start, end, string_value)
+ )
+)
+
.fi
.SH "ASSIGNING LOGLEVEL TO EVENTS"
--
1.8.5.4
prev parent 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 ` [lttng-dev] [Patch LTTng-ust v2 1/7] Update data structures to support CTF global type declarations Geneviève Bastien
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 ` Geneviève Bastien [this message]
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-8-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