-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: Add wakeup_source iterators #6460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf: Add wakeup_source iterators #6460
Conversation
|
Upstream branch: ff34657 |
037d2fc to
8f722b4
Compare
|
Upstream branch: 8f7aa3d |
474c16e to
5d45eba
Compare
8f722b4 to
03e2ed2
Compare
|
Upstream branch: 835a507 |
5d45eba to
cab660a
Compare
03e2ed2 to
3ea267d
Compare
|
Upstream branch: 835a507 |
cab660a to
79268a5
Compare
3ea267d to
6d4eb64
Compare
Add a BPF iterator for traversing through wakeup_sources. Setup iterators to traverse through a SRCUs of wakeup_sources. This is a more elegant and efficient traversal than going through the options today, such as at /sys/class/wakeup, or through debugfs. Signed-off-by: Samuel Wu <[email protected]>
Add open coded BPF iterators for wakeup_sources, which opens up more options for BPF programs that need to traverse through wakeup_sources. Signed-off-by: Samuel Wu <[email protected]>
Sets up the framework to test wakeup_sources iterators using BPF, and adds a few basic tests. Adds several helper functions that for grabbing and releasing a wakelock, abstracting out key functions to setup a framework for testing wakeup_sources. Additionally, adds 3 tests: 1. check_active_count: Checks that stats related to active_count are properly set after several lock/unlock cycles 2. check_sleep_times: Checks that time accounting related to sleep are properly calculated 3. check_no_infinite_reads: Checks that the iterator traversal returns NULL at the end Signed-off-by: Samuel Wu <[email protected]>
This commit introduces a new selftest for the BPF wakeup_source iterator to verify the functionality of open-coded iteration. The test adds: - A new BPF map `test_ws_hash` to track iterated wakeup source names. - A BPF program `iter_ws_for_each` that iterates over wakeup sources and updates the `test_ws_hash` map with the names of found sources. - A new subtest `subtest_ws_iter_check_open_coded` to trigger the BPF program and assert that the expected wakeup sources are marked in the map. Signed-off-by: Samuel Wu <[email protected]>
|
Upstream branch: 835a507 |
79268a5 to
93cc837
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1030294 expired. Closing PR. |
Pull request for series with
subject: bpf: Add wakeup_source iterators
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1030294