Skip to content

Conversation

@HoyeonRhee
Copy link
Contributor

bcc CI has been red from shallow-clone builds emitting PEP 440–invalid
"128-NOTFOUND-…" versions, and from py_test_clang/py_test_tools_smoke
breakage on newer kernels. This series supersedes the prior PR #5414.

By first commit, cmake/version.cmake now falls back to a compliant
'0.0.0+<hash>' when tags are missing, satisfying newer python setuptools
in shallow-clone workflows.

The clang tests are fixed to use blk-mq (rq->q->disk in place of rq_disk)
and the percpu-counter layout for mm->rss_stat[MM_ANONPAGES].count,
and kmalloc kprobe are replaced with kmalloc_noprof for recent kernels.
[1] [2]

Additionally, smoke tests now only runs btrfs/f2fs tools when those
modules are loaded, and softirqslower.py is fixed with missing exec bit to
avoid error.

Together these changes clear the py_test_clang and py_test_tools_smoke
failures and restore CI.

1: commit torvalds/linux@f3fa33acca9f ("block: remove the ->rq_disk field in struct request")
2: commit torvalds/linux@f1a7941243c1 ("mm: convert mm's rss stats into percpu_counter")

bcc's GitHub workflow has been failing for a while when building from
a shallow clone (git clone --depth 1). In this case, git_describe()
from CMake returns an invalid version string (128-NOTFOUND-deadbeef).

Older setuptools versions used in Fedora 38 tolerated this format, but
with Ubuntu 24.04's newer setuptools enforces PEP 440 compliance and
treats it as an error, breaking the CI build.

This updates cmake/version.cmake to detect this case and fall back to a
compliant 0.0.0+<hash> version when tags are missing. Commit hash is
kept for traceability and behavior with full clone hasn't changed.

Signed-off-by: Hoyeon Lee <[email protected]>
Linux kernel commit f3fa33acca9f ("block: remove the ->rq_disk field in
struct request") dropped rq_disk in favor of rq->q->disk. The clang
tests still include <linux/blkdev.h> and read rq->rq_disk, which fails
on recent kernels.

    16: include/linux/blkdev.h:34:8: note: forward declaration of 'struct request'
    16: struct request;
    16:        ^
    16: /virtual/main.c:15:12: error: incomplete definition of type 'struct request'
    16:     if (!rq->rq_disk || rq->rq_disk->major != 5 ||
    16:          ~~^

Since blk-mq became default in linux 5.x, this commit includes
<linux/blk-mq.h> and fetch the disk via rq->q->disk so the tests stay
valid on current kernels.

Signed-off-by: Hoyeon Lee <[email protected]>
Linux Kernel commit f1a7941243c1 ("mm: convert mm's rss stats into
percpu_counter") replaced the old rss_stat.count[] layout. The clang
test still dereferences mm->rss_stat.count[MM_ANONPAGES].counter, which
is old approach.

    16: E../virtual/main.c:4:24: error: member reference base type 'struct percpu_counter[4]' is not a structure or union
    16:     return mm->rss_stat.count[MM_ANONPAGES].counter;
    16:            ~~~~~~~~~~~~^~~~~~
    16: 1 error generated.

This commit change access with mm->rss_stat[MM_ANONPAGES].count instead
so the test stay valid on modern kernels.

Signed-off-by: Hoyeon Lee <[email protected]>
@HoyeonRhee HoyeonRhee changed the title Fix BCC CI: shallow clone versioning, clang/tools smoke regressions Fix BCC CI: shallow-clone versioning, clang/tools_smoke test regressions Nov 25, 2025
As part of the Memory Allocation Profiling patchset, Linux commit
808e81d03bb8 ("mm/slab: enable slab allocation tagging for kmalloc and
friends") converted __kmalloc into a wrapper and moved the
actual implementation to __kmalloc_noprof, breaking kmalloc kprobes.

This commit update the clang/tools_smoke python test to attach to
__kmalloc_noprof instead, restoring the kmalloc kprobe test behavior
stay valid on modern kernels.

Signed-off-by: Hoyeon Lee <[email protected]>
btrfsdist/btrfsslower/f2fsslower fails on systems without the specific
modules. Check for a loaded btrfs or f2fs module before invoking the
scripts so the smoke test only runs when specific module is loaded.

Signed-off-by: Hoyeon Lee <[email protected]>
The smoke tool test runs tool directly, and especially softirqslower.py
lacked the exec bit and failed with "Permission denied". Set the mode
to 0755 so the script can be executed by the tests.

    29: ....
    timeout: failed to run command ‘/bcc/tools/softirqslower.py’: Permission denied

Signed-off-by: Hoyeon Lee <[email protected]>
@HoyeonRhee HoyeonRhee changed the title Fix BCC CI: shallow-clone versioning, clang/tools_smoke test regressions Draft: Fix BCC CI Nov 25, 2025
@HoyeonRhee HoyeonRhee closed this Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant