From a775608d0d1d6142c80c26b21ff79bf7e04d8e53 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 22 Apr 2021 17:49:54 -0400 Subject: [PATCH] Move probe_ctx argument to align with lttng-ust Signed-off-by: Mathieu Desnoyers Change-Id: If020f8a982ab66b7a041300b6dc11aa00ce803db --- include/lttng/event-notifier-notification.h | 2 +- include/lttng/events.h | 4 ++-- include/lttng/lttng-bytecode.h | 4 ++-- include/lttng/tracepoint-event-impl.h | 6 +++--- include/ringbuffer/config.h | 4 ++-- src/lttng-bytecode-interpreter.c | 14 +++++++------- src/lttng-event-notifier-notification.c | 6 +++--- src/lttng-events.c | 4 ++-- src/probes/lttng-kprobes.c | 4 ++-- src/probes/lttng-kretprobes.c | 4 ++-- src/probes/lttng-uprobes.c | 4 ++-- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/lttng/event-notifier-notification.h b/include/lttng/event-notifier-notification.h index a0eb7d70..539900b3 100644 --- a/include/lttng/event-notifier-notification.h +++ b/include/lttng/event-notifier-notification.h @@ -11,8 +11,8 @@ #include 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 */ diff --git a/include/lttng/events.h b/include/lttng/events.h index 2ceec317..c396e790 100644 --- a/include/lttng/events.h +++ b/include/lttng/events.h @@ -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); }; diff --git a/include/lttng/lttng-bytecode.h b/include/lttng/lttng-bytecode.h index b72d9a2a..d2d5fea1 100644 --- a/include/lttng/lttng-bytecode.h +++ b/include/lttng/lttng-bytecode.h @@ -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 */ diff --git a/include/lttng/tracepoint-event-impl.h b/include/lttng/tracepoint-event-impl.h index f23c2677..d70c1f97 100644 --- a/include/lttng/tracepoint-event-impl.h +++ b/include/lttng/tracepoint-event-impl.h @@ -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; \ } \ diff --git a/include/ringbuffer/config.h b/include/ringbuffer/config.h index ccb68337..2019e14c 100644 --- a/include/ringbuffer/config.h +++ b/include/ringbuffer/config.h @@ -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; diff --git a/src/lttng-bytecode-interpreter.c b/src/lttng-bytecode-interpreter.c index 22c0ceb0..ca836d15 100644 --- a/src/lttng-bytecode-interpreter.c +++ b/src/lttng-bytecode-interpreter.c @@ -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 diff --git a/src/lttng-event-notifier-notification.c b/src/lttng-event-notifier-notification.c index be481e4b..2286aa79 100644 --- a/src/lttng-event-notifier-notification.c +++ b/src/lttng-event-notifier-notification.c @@ -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(¬if, &output); else ret = notification_append_empty_capture(¬if); diff --git a/src/lttng-events.c b/src/lttng-events.c index d85b516c..0a36ccb3 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -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. */ diff --git a/src/probes/lttng-kprobes.c b/src/probes/lttng-kprobes.c index d3a5cf8a..238441f5 100644 --- a/src/probes/lttng-kprobes.c +++ b/src/probes/lttng-kprobes.c @@ -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, <tng_probe_ctx, sizeof(data), - lttng_alignof(data), -1); + lib_ring_buffer_ctx_init(&ctx, chan->chan, sizeof(data), + lttng_alignof(data), -1, <tng_probe_ctx); ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id); if (ret < 0) return 0; diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c index 7bb9d5ca..378a0e83 100644 --- a/src/probes/lttng-kretprobes.c +++ b/src/probes/lttng-kretprobes.c @@ -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, <tng_probe_ctx, sizeof(payload), - lttng_alignof(payload), -1); + lib_ring_buffer_ctx_init(&ctx, chan->chan, sizeof(payload), + lttng_alignof(payload), -1, <tng_probe_ctx); ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id); if (ret < 0) return 0; diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index 2507f434..233813f0 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -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, <tng_probe_ctx, - sizeof(payload), lttng_alignof(payload), -1); + lib_ring_buffer_ctx_init(&ctx, chan->chan, + sizeof(payload), lttng_alignof(payload), -1, <tng_probe_ctx); ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id); if (ret < 0) -- 2.34.1