| // SPDX-License-Identifier: GPL-2.0 |
| /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */ |
| #include "bpf_experimental.h" |
| #include <bpf/bpf_helpers.h> |
| unsigned int vmas_seen = 0; |
| int iter_task_vma_for_each(const void *ctx) |
| struct task_struct *task = bpf_get_current_task_btf(); |
| struct vm_area_struct *vma; |
| if (task->pid != target_pid) |
| bpf_for_each(task_vma, vma, task, 0) { |
| if (bpf_cmp_unlikely(seen, >=, 1000)) |
| vm_ranges[seen].vm_start = vma->vm_start; |
| vm_ranges[seen].vm_end = vma->vm_end; |
| char _license[] SEC("license") = "GPL"; |