1 From c570be0da77e963d77bac099d468bc0cd5f1bd63 Mon Sep 17 00:00:00 2001
2 From: Michael Jeanson <mjeanson@efficios.com>
3 Date: Mon, 13 Sep 2021 14:16:22 -0400
4 Subject: [PATCH 2/2] fix: Revert "Makefile: Enable -Wimplicit-fallthrough for
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Starting with v5.15, "-Wimplicit-fallthrough=5" was added to the build
11 flags which requires the use of "__attribute__((__fallthrough__))" to
12 annotate fallthrough case statements.
14 See upstream commit by the man himself:
16 commit d936eb23874433caa3e3d841cfa16f5434b85dcf
17 Author: Linus Torvalds <torvalds@linux-foundation.org>
18 Date: Thu Jul 15 18:05:31 2021 -0700
20 Revert "Makefile: Enable -Wimplicit-fallthrough for Clang"
22 This reverts commit b7eb335e26a9c7f258c96b3962c283c379d3ede0.
24 It turns out that the problem with the clang -Wimplicit-fallthrough
25 warning is not about the kernel source code, but about clang itself, and
26 that the warning is unusable until clang fixes its broken ways.
28 In particular, when you enable this warning for clang, you not only get
29 warnings about implicit fallthroughs. You also get this:
31 warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough]
33 which is completely broken becasue it
35 (a) doesn't even tell you where the problem is (seriously: no line
36 numbers, no filename, no nothing).
38 (b) is fundamentally broken anyway, because there are perfectly valid
39 reasons to have a fallthrough statement even if it turns out that
40 it can perhaps not be reached.
42 In the kernel, an example of that second case is code in the scheduler:
46 if (IS_ENABLED(CONFIG_CPUSETS)) {
47 cpuset_cpus_allowed_fallback(p);
54 where if CONFIG_CPUSETS is enabled you actually never hit the
55 fallthrough case at all. But that in no way makes the fallthrough
58 So the warning is completely broken, and enabling it for clang is a very
61 In the meantime, we can keep the gcc option enabled, and make the gcc
64 -Wimplicit-fallthrough=5
66 which means that we will at least continue to require a proper
67 fallthrough statement, and that gcc won't silently accept the magic
68 comment versions. Because gcc does this all correctly, and while the odd
69 "=5" part is kind of obscure, it's documented in [1]:
71 "-Wimplicit-fallthrough=5 doesn’t recognize any comments as
72 fallthrough comments, only attributes disable the warning"
74 so if clang ever fixes its bad behavior we can try enabling it there again.
76 Upstream-Status: Backport [https://git.lttng.org/?p=lttng-modules.git;a=commit;h=c190d76e8c7b44d62b3651ab845b765c1b1f8104]
78 Change-Id: Iea69849592fb69ac04fb9bb28efcd6b8dce8ba88
79 Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
80 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
82 include/counter/counter-api.h | 4 +-
83 include/lttng/events-internal.h | 11 ++-
84 include/wrapper/compiler_attributes.h | 34 +++++++
85 src/lib/counter/counter.c | 13 ++-
86 src/lttng-abi.c | 91 ++++++++++++------
87 src/lttng-bytecode-interpreter.c | 4 +-
88 src/lttng-bytecode-specialize.c | 5 +-
89 src/lttng-events.c | 129 +++++++++++++++++---------
90 src/lttng-string-utils.c | 3 +-
91 src/probes/lttng-kretprobes.c | 7 +-
92 10 files changed, 215 insertions(+), 86 deletions(-)
93 create mode 100644 include/wrapper/compiler_attributes.h
95 diff --git a/include/counter/counter-api.h b/include/counter/counter-api.h
96 index fbc65818..c9f2b141 100644
97 --- a/include/counter/counter-api.h
98 +++ b/include/counter/counter-api.h
100 #include <linux/bitops.h>
101 #include <counter/counter.h>
102 #include <counter/counter-internal.h>
103 +#include <wrapper/compiler_attributes.h>
104 #include <wrapper/limits.h>
107 @@ -256,7 +257,8 @@ static __always_inline int lttng_counter_add(const struct lib_counter_config *co
108 const size_t *dimension_indexes, int64_t v)
110 switch (config->alloc) {
111 - case COUNTER_ALLOC_PER_CPU: /* Fallthrough */
112 + case COUNTER_ALLOC_PER_CPU:
114 case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
115 return __lttng_counter_add_percpu(config, counter, dimension_indexes, v);
116 case COUNTER_ALLOC_GLOBAL:
117 diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h
118 index cd560de8..ca2190c4 100644
119 --- a/include/lttng/events-internal.h
120 +++ b/include/lttng/events-internal.h
122 #ifndef _LTTNG_EVENTS_INTERNAL_H
123 #define _LTTNG_EVENTS_INTERNAL_H
125 +#include <wrapper/compiler_attributes.h>
127 #include <lttng/events.h>
129 struct lttng_syscall_filter;
130 @@ -561,9 +563,12 @@ static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kern
133 switch (type_integer->size) {
134 - case 8: /* Fall-through. */
135 - case 16: /* Fall-through. */
136 - case 32: /* Fall-through. */
146 diff --git a/include/wrapper/compiler_attributes.h b/include/wrapper/compiler_attributes.h
148 index 00000000..c2c96e76
150 +++ b/include/wrapper/compiler_attributes.h
152 +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
154 + * wrapper/compiler_attributes.h
156 + * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
159 +#ifndef _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
160 +#define _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
162 +#include <lttng/kernel-version.h>
164 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0))
165 +#include <linux/compiler_attributes.h>
168 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0))
171 + * Use the kernel provided fallthrough attribute macro.
173 +#define lttng_fallthrough fallthrough
175 +#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
178 + * Fallback to the comment for kernels pre 5.15 that don't build with
179 + * '-Wimplicit-fallthrough=5'.
181 +#define lttng_fallthrough do {} while (0) /* fallthrough */
183 +#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
185 +#endif /* _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H */
186 diff --git a/src/lib/counter/counter.c b/src/lib/counter/counter.c
187 index a4500a0e..bf038aac 100644
188 --- a/src/lib/counter/counter.c
189 +++ b/src/lib/counter/counter.c
191 #include <linux/cpumask.h>
192 #include <counter/counter.h>
193 #include <counter/counter-internal.h>
194 +#include <wrapper/compiler_attributes.h>
195 #include <wrapper/vmalloc.h>
196 #include <wrapper/limits.h>
198 @@ -324,7 +325,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config,
201 switch (config->alloc) {
202 - case COUNTER_ALLOC_GLOBAL: /* Fallthrough */
203 + case COUNTER_ALLOC_GLOBAL:
205 case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
206 /* Read global counter. */
207 ret = lttng_counter_read(config, counter, dimension_indexes,
208 @@ -342,7 +344,8 @@ int lttng_counter_aggregate(const struct lib_counter_config *config,
209 switch (config->alloc) {
210 case COUNTER_ALLOC_GLOBAL:
212 - case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */
213 + case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
215 case COUNTER_ALLOC_PER_CPU:
216 //TODO: integrate with CPU hotplug and online cpus
217 for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
218 @@ -448,7 +451,8 @@ int lttng_counter_clear(const struct lib_counter_config *config,
221 switch (config->alloc) {
222 - case COUNTER_ALLOC_GLOBAL: /* Fallthrough */
223 + case COUNTER_ALLOC_GLOBAL:
225 case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
226 /* Clear global counter. */
227 ret = lttng_counter_clear_cpu(config, counter, dimension_indexes, -1);
228 @@ -462,7 +466,8 @@ int lttng_counter_clear(const struct lib_counter_config *config,
229 switch (config->alloc) {
230 case COUNTER_ALLOC_GLOBAL:
232 - case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL: /* Fallthrough */
233 + case COUNTER_ALLOC_PER_CPU | COUNTER_ALLOC_GLOBAL:
235 case COUNTER_ALLOC_PER_CPU:
236 //TODO: integrate with CPU hotplug and online cpus
237 for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
238 diff --git a/src/lttng-abi.c b/src/lttng-abi.c
239 index cc453894..eac1afd1 100644
240 --- a/src/lttng-abi.c
241 +++ b/src/lttng-abi.c
243 #include <ringbuffer/vfs.h>
244 #include <ringbuffer/backend.h>
245 #include <ringbuffer/frontend.h>
246 +#include <wrapper/compiler_attributes.h>
247 #include <wrapper/poll.h>
248 #include <wrapper/file.h>
249 #include <wrapper/kref.h>
250 @@ -1332,7 +1333,8 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
254 - case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
255 + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
257 case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
259 struct lttng_metadata_stream *stream = filp->private_data;
260 @@ -1441,7 +1443,8 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
264 - case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
265 + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
267 case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
269 struct lttng_metadata_stream *stream = filp->private_data;
270 @@ -1758,8 +1761,10 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
271 switch (event_param->instrumentation) {
272 case LTTNG_KERNEL_ABI_SYSCALL:
273 switch (event_param->u.syscall.entryexit) {
274 - case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
275 - case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
276 + case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
278 + case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
280 case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
283 @@ -1783,20 +1788,26 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
284 switch (event_param->u.kretprobe.entryexit) {
285 case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
287 - case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
288 - case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
289 + case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
291 + case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
298 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
299 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
300 + case LTTNG_KERNEL_ABI_TRACEPOINT:
302 + case LTTNG_KERNEL_ABI_KPROBE:
304 case LTTNG_KERNEL_ABI_UPROBE:
307 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
308 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
309 + case LTTNG_KERNEL_ABI_FUNCTION:
311 + case LTTNG_KERNEL_ABI_NOOP:
316 @@ -1830,18 +1841,23 @@ int lttng_abi_create_event(struct file *channel_file,
319 switch (event_param->instrumentation) {
320 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
321 + case LTTNG_KERNEL_ABI_TRACEPOINT:
323 case LTTNG_KERNEL_ABI_SYSCALL:
324 fops = <tng_event_recorder_enabler_fops;
326 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
327 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
328 + case LTTNG_KERNEL_ABI_KPROBE:
330 + case LTTNG_KERNEL_ABI_KRETPROBE:
332 case LTTNG_KERNEL_ABI_UPROBE:
333 fops = <tng_event_recorder_event_fops;
336 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
337 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
338 + case LTTNG_KERNEL_ABI_FUNCTION:
340 + case LTTNG_KERNEL_ABI_NOOP:
345 @@ -1867,7 +1883,8 @@ int lttng_abi_create_event(struct file *channel_file,
348 switch (event_param->instrumentation) {
349 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
350 + case LTTNG_KERNEL_ABI_TRACEPOINT:
352 case LTTNG_KERNEL_ABI_SYSCALL:
354 struct lttng_event_enabler *event_enabler;
355 @@ -1887,8 +1904,10 @@ int lttng_abi_create_event(struct file *channel_file,
359 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
360 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
361 + case LTTNG_KERNEL_ABI_KPROBE:
363 + case LTTNG_KERNEL_ABI_KRETPROBE:
365 case LTTNG_KERNEL_ABI_UPROBE:
367 struct lttng_kernel_event_recorder *event;
368 @@ -1908,8 +1927,10 @@ int lttng_abi_create_event(struct file *channel_file,
372 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
373 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
374 + case LTTNG_KERNEL_ABI_FUNCTION:
376 + case LTTNG_KERNEL_ABI_NOOP:
381 @@ -2043,18 +2064,23 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
384 switch (event_notifier_param->event.instrumentation) {
385 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
386 + case LTTNG_KERNEL_ABI_TRACEPOINT:
388 case LTTNG_KERNEL_ABI_SYSCALL:
389 fops = <tng_event_notifier_enabler_fops;
391 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
392 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
393 + case LTTNG_KERNEL_ABI_KPROBE:
395 + case LTTNG_KERNEL_ABI_KRETPROBE:
397 case LTTNG_KERNEL_ABI_UPROBE:
398 fops = <tng_event_notifier_event_fops;
401 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
402 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
403 + case LTTNG_KERNEL_ABI_FUNCTION:
405 + case LTTNG_KERNEL_ABI_NOOP:
410 @@ -2086,7 +2112,8 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
411 goto event_notifier_error;
413 switch (event_notifier_param->event.instrumentation) {
414 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
415 + case LTTNG_KERNEL_ABI_TRACEPOINT:
417 case LTTNG_KERNEL_ABI_SYSCALL:
419 struct lttng_event_notifier_enabler *enabler;
420 @@ -2110,8 +2137,10 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
424 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
425 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
426 + case LTTNG_KERNEL_ABI_KPROBE:
428 + case LTTNG_KERNEL_ABI_KRETPROBE:
430 case LTTNG_KERNEL_ABI_UPROBE:
432 struct lttng_kernel_event_notifier *event_notifier;
433 @@ -2135,8 +2164,10 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
437 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
438 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
439 + case LTTNG_KERNEL_ABI_FUNCTION:
441 + case LTTNG_KERNEL_ABI_NOOP:
445 goto event_notifier_error;
446 diff --git a/src/lttng-bytecode-interpreter.c b/src/lttng-bytecode-interpreter.c
447 index b46a23b7..a2a932c6 100644
448 --- a/src/lttng-bytecode-interpreter.c
449 +++ b/src/lttng-bytecode-interpreter.c
451 * Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
454 +#include <wrapper/compiler_attributes.h>
455 #include <wrapper/uaccess.h>
456 #include <wrapper/objtool.h>
457 #include <wrapper/types.h>
458 @@ -421,7 +422,8 @@ static int dynamic_get_index(struct lttng_kernel_probe_ctx *lttng_probe_ctx,
461 case LOAD_ROOT_CONTEXT:
462 - case LOAD_ROOT_APP_CONTEXT: /* Fall-through */
464 + case LOAD_ROOT_APP_CONTEXT:
466 ret = context_get_index(lttng_probe_ctx,
468 diff --git a/src/lttng-bytecode-specialize.c b/src/lttng-bytecode-specialize.c
469 index c4b9d04b..f8b5f19d 100644
470 --- a/src/lttng-bytecode-specialize.c
471 +++ b/src/lttng-bytecode-specialize.c
475 #include <linux/slab.h>
476 +#include <wrapper/compiler_attributes.h>
478 #include <lttng/lttng-bytecode.h>
479 #include <lttng/align.h>
480 #include <lttng/events-internal.h>
481 @@ -271,7 +273,8 @@ static int specialize_get_index(struct bytecode_runtime *runtime,
483 case OBJECT_TYPE_STRUCT:
484 /* Only generated by the specialize phase. */
485 - case OBJECT_TYPE_VARIANT: /* Fall-through */
486 + case OBJECT_TYPE_VARIANT:
489 printk(KERN_WARNING "LTTng: bytecode: Unexpected get index type %d",
490 (int) stack_top->load.object_type);
491 diff --git a/src/lttng-events.c b/src/lttng-events.c
492 index e785fe4d..230e3934 100644
493 --- a/src/lttng-events.c
494 +++ b/src/lttng-events.c
496 #include <linux/vmalloc.h>
497 #include <linux/dmi.h>
499 +#include <wrapper/compiler_attributes.h>
500 #include <wrapper/uuid.h>
501 #include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */
502 #include <wrapper/random.h>
503 @@ -659,12 +660,14 @@ int lttng_event_enable(struct lttng_kernel_event_common *event)
506 switch (event->priv->instrumentation) {
507 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
508 + case LTTNG_KERNEL_ABI_TRACEPOINT:
510 case LTTNG_KERNEL_ABI_SYSCALL:
514 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
515 + case LTTNG_KERNEL_ABI_KPROBE:
517 case LTTNG_KERNEL_ABI_UPROBE:
518 WRITE_ONCE(event->enabled, 1);
520 @@ -673,8 +676,10 @@ int lttng_event_enable(struct lttng_kernel_event_common *event)
521 ret = lttng_kretprobes_event_enable_state(event, 1);
524 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
525 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
526 + case LTTNG_KERNEL_ABI_FUNCTION:
528 + case LTTNG_KERNEL_ABI_NOOP:
533 @@ -719,12 +724,14 @@ int lttng_event_disable(struct lttng_kernel_event_common *event)
536 switch (event->priv->instrumentation) {
537 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
538 + case LTTNG_KERNEL_ABI_TRACEPOINT:
540 case LTTNG_KERNEL_ABI_SYSCALL:
544 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
545 + case LTTNG_KERNEL_ABI_KPROBE:
547 case LTTNG_KERNEL_ABI_UPROBE:
548 WRITE_ONCE(event->enabled, 0);
550 @@ -733,8 +740,10 @@ int lttng_event_disable(struct lttng_kernel_event_common *event)
551 ret = lttng_kretprobes_event_enable_state(event, 0);
554 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
555 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
556 + case LTTNG_KERNEL_ABI_FUNCTION:
558 + case LTTNG_KERNEL_ABI_NOOP:
563 @@ -873,15 +882,20 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
564 event_name = event_desc->event_name;
567 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
568 - case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
569 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
570 + case LTTNG_KERNEL_ABI_KPROBE:
572 + case LTTNG_KERNEL_ABI_UPROBE:
574 + case LTTNG_KERNEL_ABI_KRETPROBE:
576 case LTTNG_KERNEL_ABI_SYSCALL:
577 event_name = event_param->name;
580 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
581 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
582 + case LTTNG_KERNEL_ABI_FUNCTION:
584 + case LTTNG_KERNEL_ABI_NOOP:
589 @@ -1093,8 +1107,10 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
593 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
594 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
595 + case LTTNG_KERNEL_ABI_FUNCTION:
597 + case LTTNG_KERNEL_ABI_NOOP:
602 @@ -1141,15 +1157,20 @@ struct lttng_kernel_event_notifier *_lttng_event_notifier_create(
603 event_name = event_desc->event_name;
606 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
607 - case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
608 + case LTTNG_KERNEL_ABI_KPROBE:
610 + case LTTNG_KERNEL_ABI_UPROBE:
612 case LTTNG_KERNEL_ABI_SYSCALL:
613 event_name = event_notifier_param->event.name;
616 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
617 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
618 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
619 + case LTTNG_KERNEL_ABI_KRETPROBE:
621 + case LTTNG_KERNEL_ABI_FUNCTION:
623 + case LTTNG_KERNEL_ABI_NOOP:
628 @@ -1296,9 +1317,12 @@ struct lttng_kernel_event_notifier *_lttng_event_notifier_create(
632 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
633 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
634 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
635 + case LTTNG_KERNEL_ABI_KRETPROBE:
637 + case LTTNG_KERNEL_ABI_FUNCTION:
639 + case LTTNG_KERNEL_ABI_NOOP:
644 @@ -1423,14 +1447,18 @@ void register_event(struct lttng_kernel_event_recorder *event_recorder)
645 ret = lttng_syscall_filter_enable_event(event_recorder->chan, event_recorder);
648 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
649 - case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */
650 + case LTTNG_KERNEL_ABI_KPROBE:
652 + case LTTNG_KERNEL_ABI_UPROBE:
654 case LTTNG_KERNEL_ABI_KRETPROBE:
658 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
659 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
660 + case LTTNG_KERNEL_ABI_FUNCTION:
662 + case LTTNG_KERNEL_ABI_NOOP:
667 @@ -1481,7 +1509,8 @@ int _lttng_event_unregister(struct lttng_kernel_event_recorder *event_recorder)
671 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
672 + case LTTNG_KERNEL_ABI_FUNCTION:
677 @@ -1512,14 +1541,18 @@ void register_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
678 ret = lttng_syscall_filter_enable_event_notifier(event_notifier);
681 - case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
682 + case LTTNG_KERNEL_ABI_KPROBE:
684 case LTTNG_KERNEL_ABI_UPROBE:
688 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
689 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
690 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
691 + case LTTNG_KERNEL_ABI_KRETPROBE:
693 + case LTTNG_KERNEL_ABI_FUNCTION:
695 + case LTTNG_KERNEL_ABI_NOOP:
700 @@ -1559,9 +1592,12 @@ int _lttng_event_notifier_unregister(
701 ret = lttng_syscall_filter_disable_event_notifier(event_notifier);
704 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
705 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
706 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
707 + case LTTNG_KERNEL_ABI_KRETPROBE:
709 + case LTTNG_KERNEL_ABI_FUNCTION:
711 + case LTTNG_KERNEL_ABI_NOOP:
716 @@ -1614,8 +1650,10 @@ void _lttng_event_destroy(struct lttng_kernel_event_common *event)
717 lttng_uprobes_destroy_event_private(event_recorder);
720 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
721 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
722 + case LTTNG_KERNEL_ABI_FUNCTION:
724 + case LTTNG_KERNEL_ABI_NOOP:
729 @@ -1647,9 +1685,12 @@ void _lttng_event_destroy(struct lttng_kernel_event_common *event)
730 lttng_uprobes_destroy_event_notifier_private(event_notifier);
733 - case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
734 - case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
735 - case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
736 + case LTTNG_KERNEL_ABI_KRETPROBE:
738 + case LTTNG_KERNEL_ABI_FUNCTION:
740 + case LTTNG_KERNEL_ABI_NOOP:
745 @@ -2713,7 +2754,8 @@ void lttng_session_sync_event_enablers(struct lttng_kernel_session *session)
748 switch (event_recorder_priv->parent.instrumentation) {
749 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
750 + case LTTNG_KERNEL_ABI_TRACEPOINT:
752 case LTTNG_KERNEL_ABI_SYSCALL:
754 list_for_each_entry(enabler_ref,
755 @@ -2807,7 +2849,8 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group
756 int nr_filters = 0, nr_captures = 0;
758 switch (event_notifier_priv->parent.instrumentation) {
759 - case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
760 + case LTTNG_KERNEL_ABI_TRACEPOINT:
762 case LTTNG_KERNEL_ABI_SYSCALL:
763 /* Enable event_notifiers */
764 list_for_each_entry(enabler_ref,
765 @@ -3877,7 +3920,7 @@ int print_escaped_ctf_string(struct lttng_kernel_session *session, const char *s
768 /* We still print the current char */
772 ret = lttng_metadata_printf(session, "%c", cur);
774 diff --git a/src/lttng-string-utils.c b/src/lttng-string-utils.c
775 index d9447903..65946193 100644
776 --- a/src/lttng-string-utils.c
777 +++ b/src/lttng-string-utils.c
781 #include <linux/types.h>
782 +#include <wrapper/compiler_attributes.h>
784 #include <lttng/string-utils.h>
786 @@ -302,7 +303,7 @@ retry:
787 p = pattern_get_char_at_cb(p_at,
788 pattern_get_char_at_cb_data);
790 - /* Fall-through. */
794 * Default case which will compare the escaped
795 diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c
796 index 0fa6a1bf..1d0a5ecb 100644
797 --- a/src/probes/lttng-kretprobes.c
798 +++ b/src/probes/lttng-kretprobes.c
800 #include <lttng/events.h>
801 #include <lttng/events-internal.h>
802 #include <ringbuffer/frontend_types.h>
803 +#include <wrapper/compiler_attributes.h>
804 #include <wrapper/vmalloc.h>
805 #include <wrapper/irqflags.h>
806 #include <lttng/tracer.h>
807 @@ -61,7 +62,8 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
811 - case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
812 + case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
817 @@ -90,7 +92,8 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
818 chan->ops->event_commit(&ctx);
821 - case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
822 + case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: