Starting with v5.15, "-Wimplicit-fallthrough=5" was added to the build
flags which requires the use of "__attribute__((__fallthrough__))" to
annotate fallthrough case statements.
See upstream commit by the man himself:
commit
d936eb23874433caa3e3d841cfa16f5434b85dcf
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu Jul 15 18:05:31 2021 -0700
Revert "Makefile: Enable -Wimplicit-fallthrough for Clang"
This reverts commit
b7eb335e26a9c7f258c96b3962c283c379d3ede0.
It turns out that the problem with the clang -Wimplicit-fallthrough
warning is not about the kernel source code, but about clang itself, and
that the warning is unusable until clang fixes its broken ways.
In particular, when you enable this warning for clang, you not only get
warnings about implicit fallthroughs. You also get this:
warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough]
which is completely broken becasue it
(a) doesn't even tell you where the problem is (seriously: no line
numbers, no filename, no nothing).
(b) is fundamentally broken anyway, because there are perfectly valid
reasons to have a fallthrough statement even if it turns out that
it can perhaps not be reached.
In the kernel, an example of that second case is code in the scheduler:
switch (state) {
case cpuset:
if (IS_ENABLED(CONFIG_CPUSETS)) {
cpuset_cpus_allowed_fallback(p);
state = possible;
break;
}
fallthrough;
case possible:
where if CONFIG_CPUSETS is enabled you actually never hit the
fallthrough case at all. But that in no way makes the fallthrough
wrong.
So the warning is completely broken, and enabling it for clang is a very
bad idea.
In the meantime, we can keep the gcc option enabled, and make the gcc
build use
-Wimplicit-fallthrough=5
which means that we will at least continue to require a proper
fallthrough statement, and that gcc won't silently accept the magic
comment versions. Because gcc does this all correctly, and while the odd
"=5" part is kind of obscure, it's documented in [1]:
"-Wimplicit-fallthrough=5 doesn’t recognize any comments as
fallthrough comments, only attributes disable the warning"
so if clang ever fixes its bad behavior we can try enabling it there again.
Change-Id: Iea69849592fb69ac04fb9bb28efcd6b8dce8ba88
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#include <linux/bitops.h>
#include <counter/counter.h>
#include <counter/counter-internal.h>
+#include <wrapper/compiler_attributes.h>
#include <wrapper/limits.h>
/*
const size_t *dimension_indexes, int64_t v)
{
switch (config->alloc) {
- case COUNTER_ALLOC_PER_CPU: /* Fallthrough */
+ case COUNTER_ALLOC_PER_CPU:
+ lttng_fallthrough;
case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
return __lttng_counter_add_percpu(config, counter, dimension_indexes, v);
case COUNTER_ALLOC_GLOBAL:
#ifndef _LTTNG_EVENTS_INTERNAL_H
#define _LTTNG_EVENTS_INTERNAL_H
+#include <wrapper/compiler_attributes.h>
+
#include <lttng/events.h>
struct lttng_syscall_filter;
if (!type_integer)
return false;
switch (type_integer->size) {
- case 8: /* Fall-through. */
- case 16: /* Fall-through. */
- case 32: /* Fall-through. */
+ case 8:
+ lttng_fallthrough;
+ case 16:
+ lttng_fallthrough;
+ case 32:
+ lttng_fallthrough;
case 64:
break;
default:
--- /dev/null
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/compiler_attributes.h
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
+#define _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
+
+#include <lttng/kernel-version.h>
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0))
+#include <linux/compiler_attributes.h>
+#endif
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0))
+
+/*
+ * Use the kernel provided fallthrough attribute macro.
+ */
+#define lttng_fallthrough fallthrough
+
+#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
+
+/*
+ * Fallback to the comment for kernels pre 5.15 that don't build with
+ * '-Wimplicit-fallthrough=5'.
+ */
+#define lttng_fallthrough do {} while (0) /* fallthrough */
+
+#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
+
+#endif /* _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H */
#include <linux/cpumask.h>
#include <counter/counter.h>
#include <counter/counter-internal.h>
+#include <wrapper/compiler_attributes.h>
#include <wrapper/vmalloc.h>
#include <wrapper/limits.h>
*underflow = false;
switch (config->alloc) {
- case COUNTER_ALLOC_GLOBAL: /* Fallthrough */
+ case COUNTER_ALLOC_GLOBAL:
+ lttng_fallthrough;
case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
/* Read global counter. */
ret = lttng_counter_read(config, counter, dimension_indexes,
switch (config->alloc) {
case COUNTER_ALLOC_GLOBAL:
break;
- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */
+ case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
+ lttng_fallthrough;
case COUNTER_ALLOC_PER_CPU:
//TODO: integrate with CPU hotplug and online cpus
for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
int cpu, ret;
switch (config->alloc) {
- case COUNTER_ALLOC_GLOBAL: /* Fallthrough */
+ case COUNTER_ALLOC_GLOBAL:
+ lttng_fallthrough;
case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
/* Clear global counter. */
ret = lttng_counter_clear_cpu(config, counter, dimension_indexes, -1);
switch (config->alloc) {
case COUNTER_ALLOC_GLOBAL:
break;
- case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */
+ case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
+ lttng_fallthrough;
case COUNTER_ALLOC_PER_CPU:
//TODO: integrate with CPU hotplug and online cpus
for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
#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;
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;
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;
* Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
+#include <wrapper/compiler_attributes.h>
#include <wrapper/uaccess.h>
#include <wrapper/objtool.h>
#include <wrapper/types.h>
}
break;
case LOAD_ROOT_CONTEXT:
- case LOAD_ROOT_APP_CONTEXT: /* Fall-through */
+ lttng_fallthrough;
+ case LOAD_ROOT_APP_CONTEXT:
{
ret = context_get_index(lttng_probe_ctx,
&stack_top->u.ptr,
*/
#include <linux/slab.h>
+#include <wrapper/compiler_attributes.h>
+
#include <lttng/lttng-bytecode.h>
#include <lttng/align.h>
#include <lttng/events-internal.h>
}
case OBJECT_TYPE_STRUCT:
/* Only generated by the specialize phase. */
- case OBJECT_TYPE_VARIANT: /* Fall-through */
+ case OBJECT_TYPE_VARIANT:
+ lttng_fallthrough;
default:
printk(KERN_WARNING "LTTng: bytecode: Unexpected get index type %d",
(int) stack_top->load.object_type);
#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>
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,
if (ret)
goto error;
/* We still print the current char */
- /* Fallthrough */
+ lttng_fallthrough;
default:
ret = lttng_metadata_printf(session, "%c", cur);
break;
*/
#include <linux/types.h>
+#include <wrapper/compiler_attributes.h>
#include <lttng/string-utils.h>
p = pattern_get_char_at_cb(p_at,
pattern_get_char_at_cb_data);
- /* Fall-through. */
+ lttng_fallthrough;
default:
/*
* Default case which will compare the escaped
#include <lttng/events.h>
#include <lttng/events-internal.h>
#include <ringbuffer/frontend_types.h>
+#include <wrapper/compiler_attributes.h>
#include <wrapper/vmalloc.h>
#include <wrapper/irqflags.h>
#include <lttng/tracer.h>
return 0;
break;
}
- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}
chan->ops->event_commit(&ctx);
break;
}
- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}