Lines Matching refs:iterator
26 The BPF iterator solves the above problem by providing flexibility on what data
34 A BPF iterator is a type of BPF program that allows users to iterate over
40 For example, users can define a BPF iterator that iterates over every task on
42 them. Another BPF task iterator may instead dump the cgroup information for each
53 triggered in the main kernel. For BPF iterator programs, a ``bpf_link`` to the
66 a BPF iterator program. To begin, we’ll look at `bpf_iter.c
71 Loading a BPF iterator in the kernel from user space typically involves the
79 * Next, obtain a BPF iterator file descriptor (``bpf_iter_fd``) by calling the
83 * Close the iterator fd using ``close(bpf_iter_fd)``.
86 The following are a few examples of selftest BPF iterator programs:
97 represents a BPF iterator. The suffix ``<iter_name>`` represents the type of
98 iterator.
116 all BPF iterator programs. The rest of the fields are specific to different
157 the program is a BPF iterator program to iterate all files from all tasks. The
160 The user space program invokes the BPF iterator program running in the kernel
168 /proc/net/netlink`` after pinning the BPF iterator to the bpffs mount. Later,
169 use ``rm -f <path>`` to remove the pinned iterator.
171 For example, you can use the following command to create a BPF iterator from the
190 To implement a BPF iterator in the kernel, the developer must make a one-time
211 register the iterator to the main BPF iterator subsystem.
222 - Specifies the name of the BPF iterator. For example: ``bpf_map``,
229 info associated with the iterator.
231 - Permits a BPF iterator to access BPF helpers specific to the iterator.
234 the bpf iterator.
236 - Specifies certain action requests in the kernel BPF iterator
241 - Specifies the set of seq operations for the BPF iterator and helpers to
246 to see an implementation of the ``task_vma`` BPF iterator in the kernel.
256 specific process. Therefore, BPF iterator programs support filtering out objects
257 from iteration by allowing user space to configure the iterator program when it
264 The following code is a BPF iterator program to print files and task information
265 through the ``seq_file`` of the iterator. It is a standard BPF iterator program
266 that visits every file of an iterator. We will use this BPF program in our
297 Now, let us look at how to create an iterator that includes only files of a
311 ``linfo.task.pid``, if it is non-zero, directs the kernel to create an iterator
314 ``linfo.task.pid`` is zero, the iterator will visit every opened file of every
315 process. Similarly, ``linfo.task.tid`` directs the kernel to create an iterator
329 If both *tid* and *pid* are zero, an iterator created from this struct
418 Let us look at how a BPF iterator without parameters skips files of other
463 processes in the BPF program. When you parametrize a BPF iterator, the iterator
470 By default, a BPF VMA iterator includes every VMA in every process. However,
479 A BPF task iterator with *pid* includes all tasks (threads) of a process. The
481 iterator with *tid* parameter to include only the tasks that match the given