koverstreet / bcachefs

Other
662 stars 70 forks source link

Unable to build on Arch Linux due to Kernel Config Issue #590

Closed demizer closed 1 year ago

demizer commented 1 year ago

Hello!

We are unable to build the kernel in AUR land with the following output:

  MODPOST Module.symvers
ERROR: modpost: "__SCT__tp_func_contention_begin" [fs/bcachefs/bcachefs.ko] undefined!
ERROR: modpost: "__SCT__tp_func_contention_end" [fs/bcachefs/bcachefs.ko] undefined!
ERROR: modpost: "__tracepoint_contention_begin" [fs/bcachefs/bcachefs.ko] undefined!
ERROR: modpost: "__tracepoint_contention_end" [fs/bcachefs/bcachefs.ko] undefined!
ERROR: modpost: "__SCK__tp_func_contention_end" [fs/bcachefs/bcachefs.ko] undefined!
ERROR: modpost: "__SCK__tp_func_contention_begin" [fs/bcachefs/bcachefs.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:136: Module.symvers] Error 1
make: *** [Makefile:1978: modpost] Error 2

A user has posted the workaround on the AUR:

CONFIG_LOCK_STAT=y

Another user reports the following code changes are needed:

diff --git a/fs/bcachefs/six.c b/fs/bcachefs/six.c
index 581aee565e95..4fce655a94e9 100644
--- a/fs/bcachefs/six.c
+++ b/fs/bcachefs/six.c
@@ -456,7 +456,6 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type,
                smp_mb__after_atomic();
        }

-       trace_contention_begin(lock, 0);
        lock_contended(&lock->dep_map, ip);

        if (six_optimistic_spin(lock, type))
@@ -526,7 +525,6 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type,
                six_clear_bitmask(lock, SIX_LOCK_HELD_write);
                six_lock_wakeup(lock, atomic_read(&lock->state), SIX_LOCK_read);
        }
-       trace_contention_end(lock, 0);

        return ret;
 }

The kernel config being used has the following recommended items enabled:

Output generated by a bash script that looks at the kernel config used for the recommended values.

Actual: CONFIG_PREEMPT=y
PASS: CONFIG_PREEMPT is found in config

Actual: NOT FOUND
FAIL: CONFIG_BCACHEFS_DEBUG is NOT found in config

Actual: CONFIG_KALLSYMS=y
PASS: CONFIG_KALLSYMS is found in config

Actual: CONFIG_KALLSYMS_ALL=y
PASS: CONFIG_KALLSYMS_ALL is found in config

Actual: CONFIG_DEBUG_FS=y
PASS: CONFIG_DEBUG_FS is found in config

Actual: CONFIG_DYNAMIC_FTRACE=y
PASS: CONFIG_DYNAMIC_FTRACE is found in config

Actual: CONFIG_FTRACE=y
PASS: CONFIG_FTRACE is found in config

I will keep attempting to rebuild the kernel as new commits appear.

koverstreet commented 1 year ago

Those tracepoints should be exported - by c269358b84 locking: export contention tracepoints for bcachefs six locks.

I just tried a module build with matching kernel config options - what else are you doing differently?

demizer commented 1 year ago

The issue was we didn't have the latest linux-bcachefs commit in the PKGBUILD. My apologies for the noise. It's building today after the kernel version was updated to 6.5.1.