Move probe_ctx argument to align with lttng-ust
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Apr 2021 21:49:54 +0000 (17:49 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 Apr 2021 14:58:56 +0000 (10:58 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: If020f8a982ab66b7a041300b6dc11aa00ce803db

include/lttng/event-notifier-notification.h
include/lttng/events.h
include/lttng/lttng-bytecode.h
include/lttng/tracepoint-event-impl.h
include/ringbuffer/config.h
src/lttng-bytecode-interpreter.c
src/lttng-event-notifier-notification.c
src/lttng-events.c
src/probes/lttng-kprobes.c
src/probes/lttng-kretprobes.c
src/probes/lttng-uprobes.c

index a0eb7d70b23e805d7ac8a1a0b30908652d9f5d1c..539900b31417052df6b41be539395efb6218e166 100644 (file)
@@ -11,8 +11,8 @@
 #include <lttng/events.h>
 
 void lttng_event_notifier_notification_send(struct lttng_kernel_event_notifier *event_notifier,
-               struct lttng_probe_ctx *probe_ctx,
                const char *stack_data,
+               struct lttng_probe_ctx *probe_ctx,
                struct lttng_kernel_notification_ctx *notif_ctx);
 
 #endif /* _LTTNG_EVENT_NOTIFIER_NOTIFICATION_H */
index 2ceec317d604edc11c0a12d7b5cd3fd7b110ab86..c396e790d76e4663a0beac722c1112e9cc772535 100644 (file)
@@ -412,8 +412,8 @@ struct lttng_bytecode_runtime {
                                struct lttng_probe_ctx *lttng_probe_ctx,
                                const char *filter_stack_data);
                uint64_t (*capture)(void *filter_data,
-                               struct lttng_probe_ctx *lttng_probe_ctx,
                                const char *capture_stack_data,
+                               struct lttng_probe_ctx *lttng_probe_ctx,
                                struct lttng_interpreter_output *output);
        } interpreter_funcs;
        int link_failed;
@@ -497,8 +497,8 @@ struct lttng_kernel_event_notifier {
 
        int eval_capture;                               /* Need to evaluate capture */
        void (*notification_send)(struct lttng_kernel_event_notifier *event_notifier,
-               struct lttng_probe_ctx *probe_ctx,
                const char *stack_data,
+               struct lttng_probe_ctx *probe_ctx,
                struct lttng_kernel_notification_ctx *notif_ctx);
 };
 
index b72d9a2a8c590197e515a90a4c7278d7cfc2b09a..d2d5fea1d6f78cc8ee029836c1c47ce47f71dda3 100644 (file)
@@ -298,12 +298,12 @@ uint64_t lttng_bytecode_filter_interpret(void *filter_data,
                const char *filter_stack_data);
 
 uint64_t lttng_bytecode_capture_interpret_false(void *capture_data,
-               struct lttng_probe_ctx *lttng_probe_ctx,
                const char *capture_stack_data,
+               struct lttng_probe_ctx *lttng_probe_ctx,
                struct lttng_interpreter_output *output);
 uint64_t lttng_bytecode_capture_interpret(void *capture_data,
-               struct lttng_probe_ctx *lttng_probe_ctx,
                const char *capture_stack_data,
+               struct lttng_probe_ctx *lttng_probe_ctx,
                struct lttng_interpreter_output *output);
 
 #endif /* _LTTNG_FILTER_H */
index f23c2677a42795b21f0098d464c5accb93a0308f..d70c1f9743efbf3b10fbc091c87e4afc3daa5a39 100644 (file)
@@ -1101,8 +1101,8 @@ static void __event_probe__##_name(_data_proto)                                           \
                        goto __post;                                                    \
                }                                                                       \
                __event_align = __event_get_align__##_name(_locvar_args);               \
-               lib_ring_buffer_ctx_init(&__ctx, __chan->chan, &__lttng_probe_ctx, __event_len, \
-                                        __event_align, -1);                            \
+               lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event_len,             \
+                                        __event_align, -1, &__lttng_probe_ctx);        \
                __ret = __chan->ops->event_reserve(&__ctx, __event_recorder->priv->id); \
                if (__ret < 0)                                                          \
                        goto __post;                                                    \
@@ -1123,8 +1123,8 @@ static void __event_probe__##_name(_data_proto)                                           \
                                        _locvar_args);                                  \
                                                                                        \
                __event_notifier->notification_send(__event_notifier,                   \
-                               &__lttng_probe_ctx,                                     \
                                __stackvar.__interpreter_stack_data,                    \
+                               &__lttng_probe_ctx,                                     \
                                &__notif_ctx);                                          \
                break;                                                                  \
        }                                                                               \
index ccb683371cd9ec52176909f59e8a348dbfb01776..2019e14cbf4052c1789689c77e3bb59d24169a33 100644 (file)
@@ -204,9 +204,9 @@ struct lib_ring_buffer_ctx {
  */
 static inline
 void lib_ring_buffer_ctx_init(struct lib_ring_buffer_ctx *ctx,
-                             struct channel *chan, void *priv,
+                             struct channel *chan,
                              size_t data_size, int largest_align,
-                             int cpu)
+                             int cpu, void *priv)
 {
        ctx->chan = chan;
        ctx->priv = priv;
index 22c0ceb0d19ec9ad233437288b6c3deeccd019dd..ca836d15be1e1d2eb54d2b0a5470071a6f32700f 100644 (file)
@@ -216,8 +216,8 @@ uint64_t lttng_bytecode_filter_interpret_false(void *filter_data,
 }
 
 uint64_t lttng_bytecode_capture_interpret_false(void *filter_data,
-               struct lttng_probe_ctx *lttng_probe_ctx,
                const char *capture_stack_data,
+               struct lttng_probe_ctx *lttng_probe_ctx,
                struct lttng_interpreter_output *output)
 {
        return LTTNG_INTERPRETER_DISCARD;
@@ -760,8 +760,8 @@ void dbg_load_ref_user_str_printk(const struct estack_entry *user_str_reg)
  */
 static
 uint64_t bytecode_interpret(void *interpreter_data,
-               struct lttng_probe_ctx *lttng_probe_ctx,
                const char *interpreter_stack_data,
+               struct lttng_probe_ctx *lttng_probe_ctx,
                struct lttng_interpreter_output *output)
 {
        struct bytecode_runtime *bytecode = interpreter_data;
@@ -1828,17 +1828,17 @@ uint64_t lttng_bytecode_filter_interpret(void *filter_data,
                struct lttng_probe_ctx *lttng_probe_ctx,
                const char *filter_stack_data)
 {
-       return bytecode_interpret(filter_data, lttng_probe_ctx,
-                       filter_stack_data, NULL);
+       return bytecode_interpret(filter_data,
+                       filter_stack_data, lttng_probe_ctx, NULL);
 }
 
 uint64_t lttng_bytecode_capture_interpret(void *capture_data,
-               struct lttng_probe_ctx *lttng_probe_ctx,
                const char *capture_stack_data,
+               struct lttng_probe_ctx *lttng_probe_ctx,
                struct lttng_interpreter_output *output)
 {
-       return bytecode_interpret(capture_data, lttng_probe_ctx,
-                       capture_stack_data, output);
+       return bytecode_interpret(capture_data,
+                       capture_stack_data, lttng_probe_ctx, output);
 }
 
 #undef START_OP
index be481e4b7ca0689675ff3558e5f4295b4689d8c1..2286aa79f6fcb688b435031d12ed86754c0f2b5c 100644 (file)
@@ -426,8 +426,8 @@ void notification_send(struct lttng_event_notifier_notification *notif,
 }
 
 void lttng_event_notifier_notification_send(struct lttng_kernel_event_notifier *event_notifier,
-               struct lttng_probe_ctx *probe_ctx,
                const char *stack_data,
+               struct lttng_probe_ctx *probe_ctx,
                struct lttng_kernel_notification_ctx *notif_ctx)
 {
        struct lttng_event_notifier_notification notif = { 0 };
@@ -455,8 +455,8 @@ void lttng_event_notifier_notification_send(struct lttng_kernel_event_notifier *
                                &event_notifier->priv->capture_bytecode_runtime_head, node) {
                        struct lttng_interpreter_output output;
 
-                       if (capture_bc_runtime->interpreter_funcs.capture(capture_bc_runtime, probe_ctx,
-                                       stack_data, &output) & LTTNG_INTERPRETER_RECORD_FLAG)
+                       if (capture_bc_runtime->interpreter_funcs.capture(capture_bc_runtime,
+                                       stack_data, probe_ctx, &output) & LTTNG_INTERPRETER_RECORD_FLAG)
                                ret = notification_append_capture(&notif, &output);
                        else
                                ret = notification_append_empty_capture(&notif);
index d85b516c9dde7d1fec95165f204a4314a5f39a8e..0a36ccb390df2d43bb2d0b4ad6af7734d2c0a7ec 100644 (file)
@@ -2878,8 +2878,8 @@ int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
        reserve_len = min_t(size_t,
                        stream->transport->ops.packet_avail_size(chan),
                        len);
-       lib_ring_buffer_ctx_init(&ctx, chan, NULL, reserve_len,
-                       sizeof(char), -1);
+       lib_ring_buffer_ctx_init(&ctx, chan, reserve_len,
+                       sizeof(char), -1, NULL);
        /*
         * If reservation failed, return an error to the caller.
         */
index d3a5cf8a6bf13c62fbe2e80bea9b01bdc5be147f..238441f586410a9c28be9a445692543bc132fdc4 100644 (file)
@@ -63,8 +63,8 @@ int lttng_kprobes_event_handler_pre(struct kprobe *p, struct pt_regs *regs)
                struct lib_ring_buffer_ctx ctx;
                int ret;
 
-               lib_ring_buffer_ctx_init(&ctx, chan->chan, &lttng_probe_ctx, sizeof(data),
-                                        lttng_alignof(data), -1);
+               lib_ring_buffer_ctx_init(&ctx, chan->chan, sizeof(data),
+                                        lttng_alignof(data), -1, &lttng_probe_ctx);
                ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id);
                if (ret < 0)
                        return 0;
index 7bb9d5caa91d7a1acac21f2ccd83ac5e236d38d3..378a0e833d51bb2da2b42e193fd5a98153c7a981 100644 (file)
@@ -81,8 +81,8 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
                payload.ip = (unsigned long) lttng_get_kretprobe(krpi)->kp.addr;
                payload.parent_ip = (unsigned long) krpi->ret_addr;
 
-               lib_ring_buffer_ctx_init(&ctx, chan->chan, &lttng_probe_ctx, sizeof(payload),
-                                        lttng_alignof(payload), -1);
+               lib_ring_buffer_ctx_init(&ctx, chan->chan, sizeof(payload),
+                                        lttng_alignof(payload), -1, &lttng_probe_ctx);
                ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id);
                if (ret < 0)
                        return 0;
index 2507f43418c1cae6fcd1f75a10b7eb9c0ca84ae5..233813f0d6231dceaaee0e9024aaed63f8ea5546 100644 (file)
@@ -68,8 +68,8 @@ int lttng_uprobes_event_handler_pre(struct uprobe_consumer *uc, struct pt_regs *
                struct lib_ring_buffer_ctx ctx;
                int ret;
 
-               lib_ring_buffer_ctx_init(&ctx, chan->chan, &lttng_probe_ctx,
-                       sizeof(payload), lttng_alignof(payload), -1);
+               lib_ring_buffer_ctx_init(&ctx, chan->chan,
+                       sizeof(payload), lttng_alignof(payload), -1, &lttng_probe_ctx);
 
                ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id);
                if (ret < 0)
This page took 0.033195 seconds and 4 git commands to generate.