fix: removal of [smp_]read_barrier_depends (v5.9)
[lttng-modules.git] / probes / lttng-tracepoint-event-impl.h
index 97f0b3db3add67e7f77ee0b8d6fe4f6ebb85db0c..9adf2afa61c9608dc695514a615f9d6e2d62c638 100644 (file)
@@ -1,22 +1,9 @@
-/*
+/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
+ *
  * lttng-tracepoint-event-impl.h
  *
  * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
  * Copyright (C) 2009-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; only
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <linux/uaccess.h>
@@ -28,7 +15,7 @@
 #include <probes/lttng.h>
 #include <probes/lttng-types.h>
 #include <probes/lttng-probe-user.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/ringbuffer/frontend_types.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/rcu.h>
@@ -275,7 +262,7 @@ void __event_template_proto___##_name(void);
        },
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
        {                                                       \
          .name = #_item,                                       \
          .type =                                               \
@@ -285,7 +272,7 @@ void __event_template_proto___##_name(void);
                        {                                       \
                          .array =                              \
                                {                               \
-                                 .elem_type = __type_integer(_type, 0, 0, 0, __BYTE_ORDER, 10, _encoding), \
+                                 .elem_type = __type_integer(_type, 0, 0, 0, _byte_order, _base, _encoding), \
                                  .length = _length,            \
                                }                               \
                        }                                       \
@@ -300,7 +287,7 @@ void __event_template_proto___##_name(void);
          .name = #_item,                                       \
          .type =                                               \
                {                                               \
-                 .atype = atype_array,                         \
+                 .atype = atype_array_bitfield,                \
                  .u =                                          \
                        {                                       \
                          .array =                              \
@@ -346,7 +333,7 @@ void __event_template_proto___##_name(void);
          .name = #_item,                                       \
          .type =                                               \
                {                                               \
-                 .atype = atype_sequence,                      \
+                 .atype = atype_sequence_bitfield,             \
                  .u =                                          \
                        {                                       \
                          .sequence =                           \
@@ -476,13 +463,13 @@ static void __event_probe__##_name(void *__data);
        __event_len += sizeof(_type);
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
        __event_len += sizeof(_type) * (_length);
 
 #undef _ctf_array_bitfield
 #define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
-       _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite)
+       _ctf_array_encoded(_type, _item, _src, _length, none, __LITTLE_ENDIAN, 0, _user, _nowrite)
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _length_type,                        \
@@ -698,7 +685,7 @@ error:                                                                            \
        _ctf_integer_ext_isuser##_user(_type, _item, _user_src, _byte_order, _base, _nowrite)
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
        {                                                                      \
                unsigned long __ctf_tmp_ulong = (unsigned long) (_length);     \
                const void *__ctf_tmp_ptr = (_src);                            \
@@ -710,7 +697,7 @@ error:                                                                            \
 
 #undef _ctf_array_bitfield
 #define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
-       _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite)
+       _ctf_array_encoded(_type, _item, _src, _length, none, __LITTLE_ENDIAN, 0, _user, _nowrite)
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _length_type,                       \
@@ -792,12 +779,12 @@ void __event_prepare_filter_stack__##_name(char *__stack_data,                  \
        __event_align = max_t(size_t, __event_align, lttng_alignof(_type));
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
        __event_align = max_t(size_t, __event_align, lttng_alignof(_type));
 
 #undef _ctf_array_bitfield
 #define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
-       _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite)
+       _ctf_array_encoded(_type, _item, _src, _length, none, __LITTLE_ENDIAN, 0, _user, _nowrite)
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _length_type,                        \
@@ -906,7 +893,7 @@ static inline size_t __event_get_align__##_name(void *__tp_locvar)        \
        _ctf_integer_ext_isuser##_user(_type, _item, _user_src, _byte_order, _base, _nowrite)
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
        lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type));        \
        if (_user) {                                                    \
                __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length)); \
@@ -1144,11 +1131,11 @@ static void __event_probe__##_name(void *__data, _proto)                      \
                                                                              \
        if (!_TP_SESSION_CHECK(session, __session))                           \
                return;                                                       \
-       if (unlikely(!READ_ONCE(__session->active)))                          \
+       if (unlikely(!LTTNG_READ_ONCE(__session->active)))                    \
                return;                                                       \
-       if (unlikely(!READ_ONCE(__chan->enabled)))                            \
+       if (unlikely(!LTTNG_READ_ONCE(__chan->enabled)))                      \
                return;                                                       \
-       if (unlikely(!READ_ONCE(__event->enabled)))                           \
+       if (unlikely(!LTTNG_READ_ONCE(__event->enabled)))                     \
                return;                                                       \
        __lpf = lttng_rcu_dereference(__session->pid_tracker);                \
        if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->tgid))) \
@@ -1218,11 +1205,11 @@ static void __event_probe__##_name(void *__data)                              \
                                                                              \
        if (!_TP_SESSION_CHECK(session, __session))                           \
                return;                                                       \
-       if (unlikely(!READ_ONCE(__session->active)))                          \
+       if (unlikely(!LTTNG_READ_ONCE(__session->active)))                    \
                return;                                                       \
-       if (unlikely(!READ_ONCE(__chan->enabled)))                            \
+       if (unlikely(!LTTNG_READ_ONCE(__chan->enabled)))                      \
                return;                                                       \
-       if (unlikely(!READ_ONCE(__event->enabled)))                           \
+       if (unlikely(!LTTNG_READ_ONCE(__event->enabled)))                     \
                return;                                                       \
        __lpf = lttng_rcu_dereference(__session->pid_tracker);                \
        if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->tgid)))  \
@@ -1365,7 +1352,7 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
 #ifndef TP_MODULE_NOINIT
 static int TP_ID(__lttng_events_init__, TRACE_SYSTEM)(void)
 {
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return lttng_probe_register(&TP_ID(__probe_desc___, TRACE_SYSTEM));
 }
 
This page took 0.026765 seconds and 4 git commands to generate.