Skip to contentSkip to conversation

bpftool: fix broken compile on s390 for linux-next repository

PATCH In review Thomas Richter 4 participants 5 messages Apr 12, 2023 – Apr 14, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpftool: fix broken compile on s390 for linux-next repository

Commit 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program") breaks the build of the perf tool on s390 in the linux-next repository.
Here is the make output:

make -C tools/perf
....
btf_dumper.c: In function 'dotlabel_puts':
DEBUG: btf_dumper.c:838:25: error: '__fallthrough' undeclared \
(first use in this function); did you mean 'fallthrough'?

DEBUG:   838 |                         __fallthrough;
DEBUG:       |                         ^~~~~~~~~~~~~
DEBUG:       |                         fallthrough
DEBUG: btf_dumper.c:838:25: note: each undeclared identifier is reported \
		only once for each function it appears in
DEBUG: btf_dumper.c:837:25: warning: this statement may fall through \
                [-Wimplicit-fallthrough=]
DEBUG:   837 |                         putchar('\\');
DEBUG:       |                         ^~~~~~~~~~~~~
DEBUG: btf_dumper.c:839:17: note: here
DEBUG:   839 |                 default:
DEBUG:       |                 ^~~~~~~
DEBUG: make[3]: *** [Makefile:247: /builddir/build/BUILD/kernel-6.2.fc37/\
		        linux-6.2/tools/perf/util/bpf_skel/ \
		        .tmp/bootstrap/btf_dumper.o] Error 1

The compile fails because symbol __fallthrough unknown, but symbol fallthrough is known and works fine.

Fix this and replace __fallthrough by fallthrough.

With this change, the compile works.

Output after:

 # make -C tools/perf
 ....
 CC      util/bpf-filter.o
 CC      util/bpf-filter-flex.o
 LD      util/perf-in.o
 LD      perf-in.o
 LINK    perf
 make: Leaving directory '/root/mirror-linux-next/tools/perf'
 #
Fixes 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program")
---
 tools/bpf/bpftool/btf_dumper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/btf_dumper.c +1 -1
index 6c5e0e82da22..1b7f69714604 100644
@@ -835,7 +835,7 @@ static void dotlabel_puts(const char *s)
 		case '|':
 		case ' ':
 			putchar('\\');
-			__fallthrough;
+			fallthrough;
 		default:
 			putchar(*s);
 		}
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw

2023-04-12 14:36 UTC+0200 ~ Thomas Richter <[email protected]>

Quoted 55 lines

Commit 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program") breaks the build of the perf tool on s390 in the linux-next repository.
Here is the make output:

make -C tools/perf
....
btf_dumper.c: In function 'dotlabel_puts':
DEBUG: btf_dumper.c:838:25: error: '__fallthrough' undeclared \
(first use in this function); did you mean 'fallthrough'?

DEBUG:   838 |                         __fallthrough;
DEBUG:       |                         ^~~~~~~~~~~~~
DEBUG:       |                         fallthrough
DEBUG: btf_dumper.c:838:25: note: each undeclared identifier is reported \
		only once for each function it appears in
DEBUG: btf_dumper.c:837:25: warning: this statement may fall through \
                [-Wimplicit-fallthrough=]
DEBUG:   837 |                         putchar('\\');
DEBUG:       |                         ^~~~~~~~~~~~~
DEBUG: btf_dumper.c:839:17: note: here
DEBUG:   839 |                 default:
DEBUG:       |                 ^~~~~~~
DEBUG: make[3]: *** [Makefile:247: /builddir/build/BUILD/kernel-6.2.fc37/\
		        linux-6.2/tools/perf/util/bpf_skel/ \
		        .tmp/bootstrap/btf_dumper.o] Error 1

The compile fails because symbol __fallthrough unknown, but symbol fallthrough is known and works fine.

Fix this and replace __fallthrough by fallthrough.

With this change, the compile works.

Output after:

 # make -C tools/perf
 ....
 CC      util/bpf-filter.o
 CC      util/bpf-filter-flex.o
 LD      util/perf-in.o
 LD      perf-in.o
 LINK    perf
 make: Leaving directory '/root/mirror-linux-next/tools/perf'
 #
Fixes 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program")
---
 tools/bpf/bpftool/btf_dumper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/btf_dumper.c +0 -0
index 6c5e0e82da22..1b7f69714604 100644

tools/bpf/bpftool/btf_dumper.c static void dotlabel_puts(const char *s) · line 841

Quoted 8 lines
tools/bpf/bpftool/btf_dumper.c +1 -1
@@ -835,7 +835,7 @@ static void dotlabel_puts(const char *s)
 		case '|':
 		case ' ':
 			putchar('\\');
-			__fallthrough;
+			fallthrough;
 		default:
 			putchar(*s);
 		}

Also reported by Sven Schnelle, and discussed at
https://lore.kernel.org/all/[email protected]/.

This is for linux-next, it cannot go through bpf-next given that commit f7a858bffcdd ("tools: Rename __fallthrough to fallthrough") is not in there yet.

Thanks!
Quentin

#2 lore raw

Full quote below for reference.

Mark or Stephen could you please add the patch below to linux-next?

This solves a merge conflict between perf tree commit f7a858bffcdd ("tools:
Rename __fallthrough to fallthrough") and bpf-next tree commit 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program").

FWIW, the perf tree commit also seems to have missed an additional occurence of __fallthrough in samples/bpf/hbm.c.

Thanks!

Quoted 76 lines · Quentin Monnet

2023-04-12 14:36 UTC+0200 ~ Thomas Richter <[email protected]>

Quoted 55 lines

Commit 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program") breaks the build of the perf tool on s390 in the linux-next repository.
Here is the make output:

make -C tools/perf
....
btf_dumper.c: In function 'dotlabel_puts':
DEBUG: btf_dumper.c:838:25: error: '__fallthrough' undeclared \
(first use in this function); did you mean 'fallthrough'?

DEBUG:   838 |                         __fallthrough;
DEBUG:       |                         ^~~~~~~~~~~~~
DEBUG:       |                         fallthrough
DEBUG: btf_dumper.c:838:25: note: each undeclared identifier is reported \
		only once for each function it appears in
DEBUG: btf_dumper.c:837:25: warning: this statement may fall through \
                [-Wimplicit-fallthrough=]
DEBUG:   837 |                         putchar('\\');
DEBUG:       |                         ^~~~~~~~~~~~~
DEBUG: btf_dumper.c:839:17: note: here
DEBUG:   839 |                 default:
DEBUG:       |                 ^~~~~~~
DEBUG: make[3]: *** [Makefile:247: /builddir/build/BUILD/kernel-6.2.fc37/\
		        linux-6.2/tools/perf/util/bpf_skel/ \
		        .tmp/bootstrap/btf_dumper.o] Error 1

The compile fails because symbol __fallthrough unknown, but symbol fallthrough is known and works fine.

Fix this and replace __fallthrough by fallthrough.

With this change, the compile works.

Output after:

 # make -C tools/perf
 ....
 CC      util/bpf-filter.o
 CC      util/bpf-filter-flex.o
 LD      util/perf-in.o
 LD      perf-in.o
 LINK    perf
 make: Leaving directory '/root/mirror-linux-next/tools/perf'
 #
Fixes 9fd496848b1c ("bpftool: Support inline annotations when dumping the CFG of a program")
---
 tools/bpf/bpftool/btf_dumper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/btf_dumper.c +0 -0
index 6c5e0e82da22..1b7f69714604 100644

tools/bpf/bpftool/btf_dumper.c static void dotlabel_puts(const char *s) · line 841

Quoted 8 lines
tools/bpf/bpftool/btf_dumper.c +1 -1
@@ -835,7 +835,7 @@ static void dotlabel_puts(const char *s)
 		case '|':
 		case ' ':
 			putchar('\\');
-			__fallthrough;
+			fallthrough;
 		default:
 			putchar(*s);
 		}

Also reported by Sven Schnelle, and discussed at
https://lore.kernel.org/all/[email protected]/.

This is for linux-next, it cannot go through bpf-next given that commit f7a858bffcdd ("tools: Rename __fallthrough to fallthrough") is not in there yet.

Thanks!
Quentin

maintainer
#3 lore raw
Quoted 3 lines · Heiko Carstens

Full quote below for reference.

Mark or Stephen could you please add the patch below to linux-next?

Could someone please send me whatever patch is being referenced here? This looks like a quoted backtrace of some discussion.

#4 lore raw

Hi Mark,

2023-04-14 17:53 UTC+0100 ~ Mark Brown <[email protected]>

Quoted 7 lines · Heiko Carstens
Quoted 3 lines

Full quote below for reference.

Mark or Stephen could you please add the patch below to linux-next?

Could someone please send me whatever patch is being referenced here? This looks like a quoted backtrace of some discussion.

Here it is on Patchwork:
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

Lore:
https://lore.kernel.org/all/[email protected]/

Thanks,
Quentin