#include <ringbuffer/vfs.h>
#include <ringbuffer/backend.h>
#include <ringbuffer/frontend.h>
+#include <wrapper/compiler_attributes.h>
#include <wrapper/poll.h>
#include <wrapper/file.h>
#include <wrapper/kref.h>
*/
return -ENOSYS;
}
- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
*/
return -ENOSYS;
}
- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
switch (event_param->instrumentation) {
case LTTNG_KERNEL_ABI_SYSCALL:
switch (event_param->u.syscall.entryexit) {
- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
break;
default:
switch (event_param->u.kretprobe.entryexit) {
case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
break;
- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
+ lttng_fallthrough;
default:
return -EINVAL;
}
break;
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
break;
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
return -EINVAL;
}
}
switch (event_param->instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
fops = <tng_event_recorder_enabler_fops;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
fops = <tng_event_recorder_event_fops;
break;
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
return -EINVAL;
}
goto event_error;
switch (event_param->instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
{
struct lttng_event_enabler *event_enabler;
event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
event_param, channel);
}
+ if (event_enabler)
+ lttng_event_enabler_session_add(channel->parent.session, event_enabler);
priv = event_enabler;
break;
}
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
{
struct lttng_kernel_event_recorder *event;
+ struct lttng_event_enabler *event_enabler;
+ event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
+ event_param, channel);
+ if (!event_enabler) {
+ ret = -ENOMEM;
+ goto event_error;
+ }
/*
* We tolerate no failure path after event creation. It
* will stay invariant for the rest of the session.
*/
- event = lttng_kernel_event_recorder_create(channel, event_param,
- NULL, event_param->instrumentation);
+ event = lttng_kernel_event_recorder_create(event_enabler, NULL);
WARN_ON_ONCE(!event);
+ lttng_event_enabler_destroy(event_enabler);
if (IS_ERR(event)) {
ret = PTR_ERR(event);
goto event_error;
break;
}
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
ret = -EINVAL;
goto event_error;
}
switch (event_notifier_param->event.instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
fops = <tng_event_notifier_enabler_fops;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
fops = <tng_event_notifier_event_fops;
break;
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
ret = -EINVAL;
goto inval_instr;
goto event_notifier_error;
switch (event_notifier_param->event.instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
{
struct lttng_event_notifier_enabler *enabler;
break;
}
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
{
struct lttng_kernel_event_notifier *event_notifier;
break;
}
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
ret = -EINVAL;
goto event_notifier_error;