diff options
| author | Namhyung Kim <[email protected]> | 2024-10-30 22:28:18 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2024-11-01 18:08:32 +0000 |
| commit | 2e9a548009c2d804e55cdd5b0e9903756cf7d9b3 (patch) | |
| tree | fed0fee837e2a98507d9d178e122b99a40863fec /tools/testing/selftests/bpf/prog_tests/tracing_struct.c | |
| parent | selftests/bpf: drop unnecessary bpf_iter.h type duplication (diff) | |
| download | kernel-2e9a548009c2d804e55cdd5b0e9903756cf7d9b3.tar.gz kernel-2e9a548009c2d804e55cdd5b0e9903756cf7d9b3.zip | |
bpf: Add open coded version of kmem_cache iterator
Add a new open coded iterator for kmem_cache which can be called from a
BPF program like below. It doesn't take any argument and traverses all
kmem_cache entries.
struct kmem_cache *pos;
bpf_for_each(kmem_cache, pos) {
...
}
As it needs to grab slab_mutex, it should be called from sleepable BPF
programs only.
Also update the existing iterator code to use the open coded version
internally as suggested by Andrii.
Signed-off-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tracing_struct.c')
0 files changed, 0 insertions, 0 deletions
