libbpf-tools/cachestat failed with error: `failed to find kernel BTF type ID of 'account_page_dirtied': -3`
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
When I try to run this tool on Fedora35 with kernel `6.0.5-100.fc35.x86_64`, the tool failed with this:
```
$ sudo ./cachestat
libbpf: prog 'account_page_dirtied': failed to find kernel BTF type ID of 'account_page_dirtied': -3
libbpf: prog 'account_page_dirtied': failed to prepare load attributes: -3
libbpf: prog 'account_page_dirtied': failed to load: -3
libbpf: failed to load object 'cachestat_bpf'
libbpf: failed to load BPF skeleton 'cachestat_bpf': -3
failed to load BPF object
```
The functions `account_page_dirtied` or `folio_account_dirtied` is not exported and not contained in BTF:
```
$ bpftool btf dump file /sys/kernel/btf/vmlinux format raw |grep add_to_page_cache_lru
[33922] FUNC 'add_to_page_cache_lru' type_id=33921 linkage=static
$ bpftool btf dump file /sys/kernel/btf/vmlinux format raw |grep folio_account_dirtied
$ bpftool btf dump file /sys/kernel/btf/vmlinux format raw |grep account_page_dirtied
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.