#include <linux/vmalloc.h>
#include <linux/dmi.h>
+#include <wrapper/compiler_attributes.h>
#include <wrapper/uuid.h>
#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */
#include <wrapper/random.h>
void synchronize_trace(void)
{
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) || \
+ LTTNG_RHEL_KERNEL_RANGE(4,18,0,193,0,0, 4,19,0,0,0,0))
synchronize_rcu();
#else
synchronize_sched();
goto end;
}
switch (event->priv->instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
ret = -EINVAL;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
WRITE_ONCE(event->enabled, 1);
break;
ret = lttng_kretprobes_event_enable_state(event, 1);
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:
WARN_ON_ONCE(1);
ret = -EINVAL;
goto end;
}
switch (event->priv->instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
ret = -EINVAL;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
WRITE_ONCE(event->enabled, 0);
break;
ret = lttng_kretprobes_event_enable_state(event, 0);
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:
WARN_ON_ONCE(1);
ret = -EINVAL;
event_name = event_desc->event_name;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_UPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
event_name = event_param->name;
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:
WARN_ON_ONCE(1);
ret = -EINVAL;
WARN_ON_ONCE(!ret);
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:
WARN_ON_ONCE(1);
ret = -EINVAL;
event_name = event_desc->event_name;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_UPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
event_name = event_notifier_param->event.name;
break;
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
ret = -EINVAL;
WARN_ON_ONCE(!ret);
break;
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
ret = -EINVAL;
ret = lttng_syscall_filter_enable_event(event_recorder->chan, event_recorder);
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_UPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_KRETPROBE:
ret = 0;
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:
WARN_ON_ONCE(1);
}
ret = 0;
break;
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}
ret = lttng_syscall_filter_enable_event_notifier(event_notifier);
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
ret = 0;
break;
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}
ret = lttng_syscall_filter_disable_event_notifier(event_notifier);
break;
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}
lttng_uprobes_destroy_event_private(event_recorder);
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:
WARN_ON_ONCE(1);
}
lttng_uprobes_destroy_event_notifier_private(event_notifier);
break;
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}
int nr_filters = 0;
switch (event_recorder_priv->parent.instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
/* Enable events */
list_for_each_entry(enabler_ref,
int nr_filters = 0, nr_captures = 0;
switch (event_notifier_priv->parent.instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
/* Enable event_notifiers */
list_for_each_entry(enabler_ref,
* was written and a negative value on error.
*/
int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
- struct channel *chan, bool *coherent)
+ struct lttng_kernel_ring_buffer_channel *chan, bool *coherent)
{
struct lttng_kernel_ring_buffer_ctx ctx;
int ret = 0;
}
stream->transport->ops.event_write(&ctx,
stream->metadata_cache->data + stream->metadata_in,
- reserve_len);
+ reserve_len, 1);
stream->transport->ops.event_commit(&ctx);
stream->metadata_in += reserve_len;
if (reserve_len < len)
if (ret)
goto error;
/* We still print the current char */
- /* Fallthrough */
+ lttng_fallthrough;
default:
ret = lttng_metadata_printf(session, "%c", cur);
break;
#else
"");
#endif
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
+ printk(KERN_NOTICE "LTTng: Experimental bitwise enum enabled.\n");
+#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
return 0;
error_hotplug: