TRACEPOINT_EVENT: add *_nowrite fields for filter
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 13 Jul 2012 18:06:12 +0000 (14:06 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 13 Jul 2012 18:06:12 +0000 (14:06 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/Makefile.am
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event-nowrite.h [new file with mode: 0644]
include/lttng/ust-tracepoint-event-reset.h
include/lttng/ust-tracepoint-event-write.h [new file with mode: 0644]
include/lttng/ust-tracepoint-event.h
liblttng-ust/ltt-events.c
tests/hello/ust_tests_hello.h

index 571e32f92066d4a6f582f448195b8d67e7f623c6..633260baf8fe16d1392749ed025ed4fadbc9c7a9 100644 (file)
@@ -5,6 +5,8 @@ nobase_include_HEADERS = \
        lttng/tracepoint-event.h \
        lttng/ust-tracepoint-event.h \
        lttng/ust-tracepoint-event-reset.h \
+       lttng/ust-tracepoint-event-write.h \
+       lttng/ust-tracepoint-event-nowrite.h \
        lttng/ust-events.h \
        lttng/ust-ctl.h \
        lttng/ust-version.h \
index 1e2b349f1aa29ca9f389f7afac48f9382b013d2f..8a2fa14c04e1c5f2247c6f303d750c7d932e5246 100644 (file)
@@ -181,10 +181,11 @@ struct lttng_enum {
 
 /* Event field description */
 
-#define LTTNG_UST_EVENT_FIELD_PADDING  32
+#define LTTNG_UST_EVENT_FIELD_PADDING  28
 struct lttng_event_field {
        const char *name;
        struct lttng_type type;
+       unsigned int written;   /* written into trace */
        char padding[LTTNG_UST_EVENT_FIELD_PADDING];
 };
 
diff --git a/include/lttng/ust-tracepoint-event-nowrite.h b/include/lttng/ust-tracepoint-event-nowrite.h
new file mode 100644 (file)
index 0000000..7ddbc16
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ */
+
+#undef ctf_integer_nowrite
+#define ctf_integer_nowrite(_type, _item, _src)                        \
+       _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, 0)
+
+#undef ctf_float_nowrite
+#define ctf_float_nowrite(_type, _item, _src)                  \
+       _ctf_float_nowrite(_type, _item, _src, 0)
+
+#undef ctf_array_nowrite
+#define ctf_array_nowrite(_type, _item, _src, _length)         \
+       _ctf_array_encoded(_type, _item, _src, _length, none, 0)
+
+#undef ctf_array_text_nowrite
+#define ctf_array_text_nowrite(_type, _item, _src, _length)    \
+       _ctf_array_encoded(_type, _item, _src, _length, UTF8, 0)
+
+#undef ctf_sequence_nowrite
+#define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length) \
+       _ctf_sequence_encoded(_type, _item, _src,               \
+                       _length_type, _src_length, none, 0)
+
+#undef ctf_sequence_text_nowrite
+#define ctf_sequence_text_nowrite(_type, _item, _src, _length_type, _src_length) \
+       _ctf_sequence_encoded(_type, _item, _src,               \
+                       _length_type, _src_length, UTF8, 0)
+
+#undef ctf_string_nowrite
+#define ctf_string_nowrite(_item, _src)                                \
+       _ctf_string(_item, _src, 0)
index 31a533d5dcff61d0d10e718eb499b81a15d98766..25432fdc922466cf3b244879961512ae0ad44661 100644 (file)
 #undef TP_FIELDS
 #define TP_FIELDS(...)
 
-#undef ctf_integer_ext
-#define ctf_integer_ext(_type, _item, _src, _byte_order, _base)
+#undef  TRACEPOINT_LOGLEVEL_ENUM
+#define TRACEPOINT_LOGLEVEL_ENUM(...)
+
+#undef TRACEPOINT_LOGLEVEL
+#define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
+
+#undef _ctf_integer_ext
+#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, \
+                       _written)
+
+#undef _ctf_float
+#define _ctf_float(_type, _item, _src, _written)
+
+#undef _ctf_array_encoded
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, \
+                       _written)
+
+#undef _ctf_sequence_encoded
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
+                       _src_length, _encoding, _written)
+
+#undef _ctf_string
+#define _ctf_string(_item, _src, _written)
+
+/* "write" */
+#undef ctf_integer
+#define ctf_integer(_type, _item, _src)
+
+#undef ctf_integer_hex
+#define ctf_integer_hex(_type, _item, _src)
+
+#undef ctf_integer_network
+#define ctf_integer_network(_type, _item, _src)
+
+#undef ctf_integer_network_hex
+#define ctf_integer_network_hex(_type, _item, _src)
 
 #undef ctf_float
 #define ctf_float(_type, _item, _src)
 
-#undef ctf_array_encoded
-#define ctf_array_encoded(_type, _item, _src, _length, _encoding)
+#undef ctf_array
+#define ctf_array(_type, _item, _src, _length)
+
+#undef ctf_array_text
+#define ctf_array_text(_type, _item, _src, _length)
+
+#undef ctf_sequence
+#define ctf_sequence(_type, _item, _src, _length_type, _src_length)
 
-#undef ctf_sequence_encoded
-#define ctf_sequence_encoded(_type, _item, _src, _length_type, \
-                       _src_length, _encoding)
+#undef ctf_sequence_text
+#define ctf_sequence_text(_type, _item, _src, _length_type, _src_length)
 
 #undef ctf_string
 #define ctf_string(_item, _src)
 
-#undef  TRACEPOINT_LOGLEVEL_ENUM
-#define TRACEPOINT_LOGLEVEL_ENUM(...)
+/* "nowrite" */
+#undef ctf_integer_nowrite
+#define ctf_integer_nowrite(_type, _item, _src)
 
-#undef TRACEPOINT_LOGLEVEL
-#define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
+#undef ctf_float_nowrite
+#define ctf_float_nowrite(_type, _item, _src)
+
+#undef ctf_array_nowrite
+#define ctf_array_nowrite(_type, _item, _src, _length)
+
+#undef ctf_array_text_nowrite
+#define ctf_array_text_nowrite(_type, _item, _src, _length)
+
+#undef ctf_sequence_nowrite
+#define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length)
+
+#undef ctf_sequence_text_nowrite
+#define ctf_sequence_text_nowrite(_type, _item, _src, _length_type, _src_length)
+
+#undef ctf_string_nowrite
+#define ctf_string_nowrite(_item, _src)
diff --git a/include/lttng/ust-tracepoint-event-write.h b/include/lttng/ust-tracepoint-event-write.h
new file mode 100644 (file)
index 0000000..a23cab6
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ */
+
+#undef ctf_integer
+#define ctf_integer(_type, _item, _src)                                \
+       _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, 1)
+
+#undef ctf_integer_hex
+#define ctf_integer_hex(_type, _item, _src)                    \
+       _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 16, 1)
+
+#undef ctf_integer_network
+#define ctf_integer_network(_type, _item, _src)                        \
+       _ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 10, 1)
+
+#undef ctf_integer_network_hex
+#define ctf_integer_network_hex(_type, _item, _src)            \
+       _ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 16, 1)
+
+#undef ctf_float
+#define ctf_float(_type, _item, _src)                          \
+       _ctf_float(_type, _item, _src, 1)
+
+#undef ctf_array
+#define ctf_array(_type, _item, _src, _length)                 \
+       _ctf_array_encoded(_type, _item, _src, _length, none, 1)
+
+#undef ctf_array_text
+#define ctf_array_text(_type, _item, _src, _length)            \
+       _ctf_array_encoded(_type, _item, _src, _length, UTF8, 1)
+
+#undef ctf_sequence
+#define ctf_sequence(_type, _item, _src, _length_type, _src_length) \
+       _ctf_sequence_encoded(_type, _item, _src,               \
+                       _length_type, _src_length, none, 1)
+
+#undef ctf_sequence_text
+#define ctf_sequence_text(_type, _item, _src, _length_type, _src_length) \
+       _ctf_sequence_encoded(_type, _item, _src,               \
+                       _length_type, _src_length, UTF8, 1)
+
+#undef ctf_string
+#define ctf_string(_item, _src)                                        \
+       _ctf_string(_item, _src, 1)
index 4130b7cb8f794e6310efd5b75b584c82728cce67..8db1e688fb8ff3d9dba3d8dcd1242be62ebc0cdf 100644 (file)
 #include <lttng/ringbuffer-config.h>
 #include <string.h>
 
-/*
- * Macro declarations used for all stages.
- */
-
-#undef ctf_integer
-#define ctf_integer(_type, _item, _src)                                \
-       ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10)
-
-#undef ctf_integer_hex
-#define ctf_integer_hex(_type, _item, _src)                    \
-       ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 16)
-
-#undef ctf_integer_network
-#define ctf_integer_network(_type, _item, _src)                        \
-       ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 10)
-
-#undef ctf_integer_network_hex
-#define ctf_integer_network_hex(_type, _item, _src)            \
-       ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 16)
-
-/* ctf_float is redefined at each step */
-
-#undef ctf_array
-#define ctf_array(_type, _item, _src, _length)                 \
-       ctf_array_encoded(_type, _item, _src, _length, none)
-
-#undef ctf_array_text
-#define ctf_array_text(_type, _item, _src, _length)            \
-       ctf_array_encoded(_type, _item, _src, _length, UTF8)
-
-#undef ctf_sequence
-#define ctf_sequence(_type, _item, _src, _length_type, _src_length)    \
-       ctf_sequence_encoded(_type, _item, _src,                        \
-                       _length_type, _src_length, none)
-
-#undef ctf_sequence_text
-#define ctf_sequence_text(_type, _item, _src, _length_type, _src_length) \
-       ctf_sequence_encoded(_type, _item, _src,                         \
-                       _length_type, _src_length, UTF8)
-
-/* ctf_string is redefined at each step */
-
 /*
  * TRACEPOINT_EVENT_CLASS declares a class of tracepoints receiving the
  * same arguments and having the same field layout.
@@ -146,23 +104,27 @@ static const char                                                 \
 
 /* Reset all macros within TRACEPOINT_EVENT */
 #include <lttng/ust-tracepoint-event-reset.h>
+#include <lttng/ust-tracepoint-event-write.h>
+#include <lttng/ust-tracepoint-event-nowrite.h>
 
-#undef ctf_integer_ext
-#define ctf_integer_ext(_type, _item, _src, _byte_order, _base)        \
+#undef _ctf_integer_ext
+#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _written)     \
        {                                                       \
          .name = #_item,                                       \
          .type = __type_integer(_type, _byte_order, _base, none),\
+         .written = _written,                                  \
        },
 
-#undef ctf_float
-#define ctf_float(_type, _item, _src)                          \
+#undef _ctf_float
+#define _ctf_float(_type, _item, _src, _written)               \
        {                                                       \
          .name = #_item,                                       \
          .type = __type_float(_type),                          \
+         .written = _written,                                  \
        },
 
-#undef ctf_array_encoded
-#define ctf_array_encoded(_type, _item, _src, _length, _encoding) \
+#undef _ctf_array_encoded
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _written) \
        {                                                       \
          .name = #_item,                                       \
          .type =                                               \
@@ -174,11 +136,12 @@ static const char                                                 \
                            .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
                        },                                      \
                },                                              \
+         .written = _written,                                  \
        },
 
-#undef ctf_sequence_encoded
-#define ctf_sequence_encoded(_type, _item, _src,       \
-                       _length_type, _src_length, _encoding)   \
+#undef _ctf_sequence_encoded
+#define _ctf_sequence_encoded(_type, _item, _src,      \
+                       _length_type, _src_length, _encoding, _written) \
        {                                                       \
          .name = #_item,                                       \
          .type =                                               \
@@ -190,10 +153,11 @@ static const char                                                 \
                            .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
                        },                                      \
                },                                              \
+         .written = _written,                                  \
        },
 
-#undef ctf_string
-#define ctf_string(_item, _src)                                        \
+#undef _ctf_string
+#define _ctf_string(_item, _src, _written)                     \
        {                                                       \
          .name = #_item,                                       \
          .type =                                               \
@@ -201,6 +165,7 @@ static const char                                                   \
                  .atype = atype_string,                        \
                  .u.basic.string.encoding = lttng_encode_UTF8, \
                },                                              \
+         .written = _written,                                  \
        },
 
 #undef TP_FIELDS
@@ -240,25 +205,26 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
 
 /* Reset all macros within TRACEPOINT_EVENT */
 #include <lttng/ust-tracepoint-event-reset.h>
+#include <lttng/ust-tracepoint-event-write.h>
 
-#undef ctf_integer_ext
-#define ctf_integer_ext(_type, _item, _src, _byte_order, _base)                       \
+#undef _ctf_integer_ext
+#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _written)       \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
        __event_len += sizeof(_type);
 
-#undef ctf_float
-#define ctf_float(_type, _item, _src)                                         \
+#undef _ctf_float
+#define _ctf_float(_type, _item, _src, _written)                                \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
        __event_len += sizeof(_type);
 
-#undef ctf_array_encoded
-#define ctf_array_encoded(_type, _item, _src, _length, _encoding)             \
+#undef _ctf_array_encoded
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _written)     \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
        __event_len += sizeof(_type) * (_length);
 
-#undef ctf_sequence_encoded
-#define ctf_sequence_encoded(_type, _item, _src, _length_type, \
-                       _src_length, _encoding)                 \
+#undef _ctf_sequence_encoded
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type,        \
+                       _src_length, _encoding, _written)       \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_length_type));   \
        __event_len += sizeof(_length_type);                                   \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
@@ -266,8 +232,8 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
        __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx];       \
        __dynamic_len_idx++;
 
-#undef ctf_string
-#define ctf_string(_item, _src)                                                       \
+#undef _ctf_string
+#define _ctf_string(_item, _src, _written)                                    \
        __event_len += __dynamic_len[__dynamic_len_idx++] = strlen(_src) + 1;
 
 #undef TP_ARGS
@@ -295,41 +261,44 @@ static inline size_t __event_get_size__##_provider##___##_name(size_t *__dynamic
  * Stage 3.1 of tracepoint event generation.
  *
  * Create static inline function that layout the filter stack data.
+ * We make both write and nowrite data available to the filter.
  */
 
 /* Reset all macros within TRACEPOINT_EVENT */
 #include <lttng/ust-tracepoint-event-reset.h>
+#include <lttng/ust-tracepoint-event-write.h>
+#include <lttng/ust-tracepoint-event-nowrite.h>
 
-#undef ctf_integer_ext
-#define ctf_integer_ext(_type, _item, _src, _byte_order, _base)                       \
+#undef _ctf_integer_ext
+#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _written)     \
        if (lttng_is_signed_type(_type))                                       \
                *(int64_t *) __stack_data = (int64_t) (_type) (_src);          \
        else                                                                   \
                *(uint64_t *) __stack_data = (uint64_t) (_type) (_src);        \
        __stack_data += sizeof(int64_t);
 
-#undef ctf_float
-#define ctf_float(_type, _item, _src)                                         \
+#undef _ctf_float
+#define _ctf_float(_type, _item, _src, _written)                              \
        *(double *) __stack_data = (double) (_type) (_src);                    \
        __stack_data += sizeof(double);
 
-#undef ctf_array_encoded
-#define ctf_array_encoded(_type, _item, _src, _length, _encoding)             \
+#undef _ctf_array_encoded
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _written)   \
        *(unsigned long *) __stack_data = (unsigned long) (_length);           \
        __stack_data += sizeof(unsigned long);                                 \
        *(const void **) __stack_data = (_src);                                \
        __stack_data += sizeof(void *);
 
-#undef ctf_sequence_encoded
-#define ctf_sequence_encoded(_type, _item, _src, _length_type,                \
-                       _src_length, _encoding)                                \
+#undef _ctf_sequence_encoded
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type,                       \
+                       _src_length, _encoding, _written)                      \
        *(unsigned long *) __stack_data = (unsigned long) (_src_length);       \
        __stack_data += sizeof(unsigned long);                                 \
        *(const void **) __stack_data = (_src);                                \
        __stack_data += sizeof(void *);
 
-#undef ctf_string
-#define ctf_string(_item, _src)                                                       \
+#undef _ctf_string
+#define _ctf_string(_item, _src, _written)                                    \
        *(const void **) __stack_data = (_src);                                \
        __stack_data += sizeof(void *);
 
@@ -360,27 +329,28 @@ void __event_prepare_filter_stack__##_provider##___##_name(char *__stack_data,\
 
 /* Reset all macros within TRACEPOINT_EVENT */
 #include <lttng/ust-tracepoint-event-reset.h>
+#include <lttng/ust-tracepoint-event-write.h>
 
-#undef ctf_integer_ext
-#define ctf_integer_ext(_type, _item, _src, _byte_order, _base)                       \
+#undef _ctf_integer_ext
+#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _written)     \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
 
-#undef ctf_float
-#define ctf_float(_type, _item, _src)                                         \
+#undef _ctf_float
+#define _ctf_float(_type, _item, _src, _written)                              \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
 
-#undef ctf_array_encoded
-#define ctf_array_encoded(_type, _item, _src, _length, _encoding)             \
+#undef _ctf_array_encoded
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _written)   \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
 
-#undef ctf_sequence_encoded
-#define ctf_sequence_encoded(_type, _item, _src, _length_type, \
-                       _src_length, _encoding)                 \
+#undef _ctf_sequence_encoded
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type,        \
+                       _src_length, _encoding, _written)       \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_length_type));    \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
 
-#undef ctf_string
-#define ctf_string(_item, _src)
+#undef _ctf_string
+#define _ctf_string(_item, _src, _written)
 
 #undef TP_ARGS
 #define TP_ARGS(...) __VA_ARGS__
@@ -410,31 +380,32 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
 
 /* Reset all macros within TRACEPOINT_EVENT */
 #include <lttng/ust-tracepoint-event-reset.h>
+#include <lttng/ust-tracepoint-event-write.h>
 
-#undef ctf_integer_ext
-#define ctf_integer_ext(_type, _item, _src, _byte_order, _base)                \
+#undef _ctf_integer_ext
+#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _written) \
        {                                                               \
                _type __tmp = (_src);                                   \
                lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\
                __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\
        }
 
-#undef ctf_float
-#define ctf_float(_type, _item, _src)                                  \
+#undef _ctf_float
+#define _ctf_float(_type, _item, _src, _written)                       \
        {                                                               \
                _type __tmp = (_src);                                   \
                lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\
                __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\
        }
 
-#undef ctf_array_encoded
-#define ctf_array_encoded(_type, _item, _src, _length, _encoding)       \
+#undef _ctf_array_encoded
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _written) \
        lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type));        \
        __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length));
 
-#undef ctf_sequence_encoded
-#define ctf_sequence_encoded(_type, _item, _src, _length_type,         \
-                       _src_length, _encoding)                 \
+#undef _ctf_sequence_encoded
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type,                \
+                       _src_length, _encoding, _written)               \
        {                                                               \
                _length_type __tmpl = __stackvar.__dynamic_len[__dynamic_len_idx]; \
                lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
@@ -444,8 +415,8 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
        __chan->ops->event_write(&__ctx, _src,                          \
                sizeof(_type) * __get_dynamic_len(dest));
 
-#undef ctf_string
-#define ctf_string(_item, _src)                                                \
+#undef _ctf_string
+#define _ctf_string(_item, _src, _written)                             \
        lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(*(_src)));      \
        __chan->ops->event_write(&__ctx, _src, __get_dynamic_len(dest));
 
index 120dffff3070f59bd8aea367270d538ac8e9752c..2bc5a1597b3ed15812a543f78c60ddcaad7263ec 100644 (file)
@@ -726,6 +726,9 @@ int _ltt_field_statedump(struct ltt_session *session,
 {
        int ret = 0;
 
+       if (!field->written)
+               return 0;
+
        switch (field->type.atype) {
        case atype_integer:
                ret = lttng_metadata_printf(session,
index b06dea00138dc5b62619814741c56b85d3b9890e..8ac681c2917c05b145a21ecdb2dd3c8fdb27e441 100644 (file)
@@ -46,6 +46,7 @@ TRACEPOINT_EVENT(ust_tests_hello, tptest,
                ctf_float(float, floatfield, floatarg)
                ctf_float(double, doublefield, doublearg)
                ctf_integer(bool, boolfield, boolarg)
+               ctf_integer_nowrite(int, filterfield, anint)
        )
 )
 
This page took 0.034085 seconds and 4 git commands to generate.