2023-09-19 14:20:35

by Xie XiuQi

[permalink] [raw]
Subject: [PATCH 0/3] scripts/export_report.pl: some bugfix for exported symbols checking

From: Xie XiuQi <[email protected]>

'make export_report' with CONFIG_MODVERSIONS enabled, but we get this warning
message and empty export-symbol-usage SECTION.

$ make export_report
...
WARNING:fs/efivarfs/efivarfs.o is not built with CONFIG_MODVERSIONS enabled
WARNING:drivers/thermal/intel/x86_pkg_temp_thermal.o is not built with CONFIG_MODVERSIONS enabled
WARNING:net/netfilter/nf_log_syslog.o is not built with CONFIG_MODVERSIONS enabled
WARNING:net/netfilter/xt_mark.o is not built with CONFIG_MODVERSIONS enabled
WARNING:net/netfilter/xt_nat.o is not built with CONFIG_MODVERSIONS enabled
WARNING:net/netfilter/xt_LOG.o is not built with CONFIG_MODVERSIONS enabled
WARNING:net/netfilter/xt_MASQUERADE.o is not built with CONFIG_MODVERSIONS enabled
WARNING:net/netfilter/xt_addrtype.o is not built with CONFIG_MODVERSIONS enabled
WARNING:net/ipv4/netfilter/iptable_nat.o is not built with CONFIG_MODVERSIONS enabled
...

SECTION 2:
This section reports export-symbol-usage of in-kernel
modules. Each module lists the modules, and the symbols from that module that
it uses. Each listed symbol reports the number of modules using it

NOTE: Got 9 CONFIG_MODVERSIONS warnings

The causes of the problem is that the formats of modules.order and .mod.c are
changed, but the modification for export_report.pl is missing. So, fix them.

Xie XiuQi (3):
scripts/export_report.pl: fix the path suffix of module
scripts/export_report.pl: use the module name in warning message
scripts/export_report.pl: fix modversion checking

scripts/export_report.pl | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--
2.25.1


2023-09-19 14:22:32

by Xie XiuQi

[permalink] [raw]
Subject: [PATCH 1/3] scripts/export_report.pl: fix the path suffix of module

From: Xie XiuQi <[email protected]>

Since commit f65a486821cf ("kbuild: change module.order to list *.o instead of *.ko"),
modules.order stores .o instead of .ko. Therefore, fix it in export_report.pl.
Otherwise, the corresponding .mod.c file cannot be found.

Fixes: f65a486821cf ("kbuild: change module.order to list *.o instead of *.ko")
Signed-off-by: Xie XiuQi <[email protected]>
---
scripts/export_report.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/export_report.pl b/scripts/export_report.pl
index feb3d5542a62..fa3e47ac7c3b 100755
--- a/scripts/export_report.pl
+++ b/scripts/export_report.pl
@@ -54,7 +54,7 @@ sub collectcfiles {
my @file;
open my $fh, '< modules.order' or die "cannot open modules.order: $!\n";
while (<$fh>) {
- s/\.ko$/.mod.c/;
+ s/\.o$/.mod.c/;
push (@file, $_)
}
close($fh);
--
2.25.1

2023-09-19 14:27:39

by Xie XiuQi

[permalink] [raw]
Subject: [PATCH 3/3] scripts/export_report.pl: fix modversion checking

From: Xie XiuQi <[email protected]>

The definition of the "__versions" section has changed, so use the
newest format. Otherwise, the list of export-symbol-usage is empty.

$ make export_report
...
SECTION 2:
This section reports export-symbol-usage of in-kernel
modules. Each module lists the modules, and the symbols from that module that
it uses. Each listed symbol reports the number of modules using it

NOTE: Got 9 CONFIG_MODVERSIONS warnings

Fixes: a3d0cb04f7df ("modpost: use __section in the output to *.mod.c"),
Fixes: 33def8498fdd ("treewide: Convert macro and uses of __section(foo) to __section("foo")")
Signed-off-by: Xie XiuQi <[email protected]>
---
scripts/export_report.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/export_report.pl b/scripts/export_report.pl
index eda570224a2d..54132a6a78ba 100755
--- a/scripts/export_report.pl
+++ b/scripts/export_report.pl
@@ -122,7 +122,7 @@ foreach my $thismod (@allcfiles) {
next;
}
if ($state == 1) {
- $state = 2 if ($_ =~ /__attribute__\(\(section\("__versions"\)\)\)/);
+ $state = 2 if ($_ =~ /__used __section\(\"__versions\"\)/);
next;
}
if ($state == 2) {
--
2.25.1

2023-09-19 15:00:01

by Xie XiuQi

[permalink] [raw]
Subject: [PATCH 2/3] scripts/export_report.pl: improve warning message

From: Xie XiuQi <[email protected]>

In this warning message, it's better to use the module name instead of .mod.c.

Before:
'WARNING:fs/efivarfs/efivarfs.mod.c is not built with CONFIG_MODVERSIONS enabled'

After:
'WARNING:fs/efivarfs/efivarfs.ko is not built with CONFIG_MODVERSIONS enabled'

Signed-off-by: Xie XiuQi <[email protected]>
---
scripts/export_report.pl | 2 ++
1 file changed, 2 insertions(+)

diff --git a/scripts/export_report.pl b/scripts/export_report.pl
index fa3e47ac7c3b..eda570224a2d 100755
--- a/scripts/export_report.pl
+++ b/scripts/export_report.pl
@@ -112,6 +112,8 @@ foreach my $thismod (@allcfiles) {
next;
}

+ $thismod =~ s/\.mod\.c/.ko/;
+
my $state=0;
while ( <$module> ) {
chomp;
--
2.25.1