X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=probes%2Flttng-events.h;h=a6c36b088dfba22ab12a7cf162c7880087dff578;hb=9df04ec7ba1d0839821aff10e022cfb15e30274e;hp=e6d8f4477dfab459d744e92be27db55c20a96cea;hpb=cb1aa0c78c8a5a23e0648408c5f5bc5db978b7c1;p=lttng-modules.git diff --git a/probes/lttng-events.h b/probes/lttng-events.h index e6d8f447..a6c36b08 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -27,6 +27,7 @@ #include "lttng-probe-user.h" #include "../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "../wrapper/ringbuffer/frontend_types.h" +#include "../wrapper/rcu.h" #include "../lttng-events.h" #include "../lttng-tracer-core.h" @@ -138,6 +139,40 @@ void trace_##_name(void); #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) +/* + * Stage 1.1 of the trace events. + * + * Create dummy trace prototypes for each event class, and for each used + * template. This will allow checking whether the prototypes from the + * class and the instance using the class actually match. + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +#undef TP_PROTO +#define TP_PROTO(...) __VA_ARGS__ + +#undef TP_ARGS +#define TP_ARGS(...) __VA_ARGS__ + +#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP +#define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(_template, _name, _map, _proto, _args) \ +void __event_template_proto___##_template(_proto); + +#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS +#define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS(_template, _name, _map) \ +void __event_template_proto___##_template(void); + +#undef LTTNG_TRACEPOINT_EVENT_CLASS_CODE +#define LTTNG_TRACEPOINT_EVENT_CLASS_CODE(_name, _proto, _args, _locvar, _code, _fields) \ +void __event_template_proto___##_name(_proto); + +#undef LTTNG_TRACEPOINT_EVENT_CLASS_CODE_NOARGS +#define LTTNG_TRACEPOINT_EVENT_CLASS_CODE_NOARGS(_name, _locvar, _code, _fields) \ +void __event_template_proto___##_name(void); + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + /* * Stage 2 of the trace events. * @@ -292,10 +327,10 @@ static void __event_probe__##_name(void *__data); #define _ctf_string(_item, _src, _user, _nowrite) \ if (_user) \ __event_len += __dynamic_len[__dynamic_len_idx++] = \ - strlen(_src) + 1; \ + max_t(size_t, lttng_strlen_user_inatomic(_src), 1); \ else \ __event_len += __dynamic_len[__dynamic_len_idx++] = \ - max_t(size_t, lttng_strlen_user_inatomic(_src), 1); + strlen(_src) + 1; #undef TP_PROTO #define TP_PROTO(...) __VA_ARGS__ @@ -694,7 +729,7 @@ static void __event_probe__##_name(void *__data, _proto) \ return; \ if (unlikely(!ACCESS_ONCE(__event->enabled))) \ return; \ - __lpf = rcu_dereference(__session->pid_tracker); \ + __lpf = lttng_rcu_dereference(__session->pid_tracker); \ if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->pid))) \ return; \ _code \ @@ -704,7 +739,7 @@ static void __event_probe__##_name(void *__data, _proto) \ \ __event_prepare_filter_stack__##_name(__stackvar.__filter_stack_data, \ tp_locvar, _args); \ - list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \ + lttng_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \ if (unlikely(bc_runtime->filter(bc_runtime, \ __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) \ __filter_record = 1; \ @@ -753,7 +788,7 @@ static void __event_probe__##_name(void *__data) \ return; \ if (unlikely(!ACCESS_ONCE(__event->enabled))) \ return; \ - __lpf = rcu_dereference(__session->pid_tracker); \ + __lpf = lttng_rcu_dereference(__session->pid_tracker); \ if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->pid))) \ return; \ _code \ @@ -763,7 +798,7 @@ static void __event_probe__##_name(void *__data) \ \ __event_prepare_filter_stack__##_name(__stackvar.__filter_stack_data, \ tp_locvar); \ - list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \ + lttng_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \ if (unlikely(bc_runtime->filter(bc_runtime, \ __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) \ __filter_record = 1; \