cachestat broken by recent kernel change
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
The BCC tool and libbpf-tool cachestat are broken on latest kernel.
Kernel commit [203a31516616 ("mm/writeback: Add __folio_mark_dirty()")](https://github.com/torvalds/linux/commit/203a31516616111b8eaaf00c16fa3fcaa25e6f81)
converted `account_page_dirtied` to `folio_account_dirtied`, so the
attach target of these tools disppeared, making them broken.
```shell
$ sudo ./cachestat
libbpf: failed to find kernel BTF type ID of 'account_page_dirtied': -3
libbpf: prog 'account_page_dirtied': failed to prepare load attributes: -3
libbpf: failed to load program 'account_page_dirtied'
libbpf: failed to load object 'cachestat_bpf'
libbpf: failed to load BPF skeleton 'cachestat_bpf': -3
failed to open and/or load BPF object
```
```shell
sudo ./cachestat.py
cannot attach kprobe, probe entry may not exist
Traceback (most recent call last):
File "./cachestat.py", line 99, in
b.attach_kprobe(event="account_page_dirtied", fn_name="do_count")
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 833, in attach_kprobe
(fn_name, event))
Exception: Failed to attach BPF program do_count to kprobe account_page_dirtied
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect the BCC cachestat tool and the libbpf-tool cachestat implementation, focusing on the kprobe attachment to account_page_dirtied. Update the attachment target for the folio_account_dirtied kernel change, then run both cachestat commands on a recent kernel and confirm that the BPF program loads and attaches successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux, python
- Domain
- observability-sre, operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100