This set introduces bpf_iter for task_vma, which can be used to generate information similar to /proc/pid/maps or /proc/pid/smaps. Patch 4/4 adds an example that mimics /proc/pid/maps. Song Liu (4): bpf: introduce task_vma bpf_iter bpf: allow bpf_d_path in sleepable bpf_iter program libbpf: introduce section "iter.s/" for sleepable bpf_iter program selftests/bpf: add test for bpf_iter_task_vma include/linux/bpf.h | 2 +- include/uapi/linux/bpf.h | 7 + kernel/bpf/task_iter.c | 193 +++++++++++++++++- kernel/trace/bpf_trace.c | 5 + tools/lib/bpf/libbpf.c | 5 + .../selftests/bpf/prog_tests/bpf_iter.c | 106 +++++++++- tools/testing/selftests/bpf/progs/bpf_iter.h | 9 + .../selftests/bpf/progs/bpf_iter_task_vma.c | 55 +++++ 8 files changed, 370 insertions(+), 12 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/bpf_iter_task_vma.c -- 2.24.1