diff options
author | Andrii Nakryiko <[email protected]> | 2020-05-13 22:51:37 -0700 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2020-05-14 18:37:32 -0700 |
commit | c70f34a8ac66c2cb05593ef5760142e5f862a9b4 (patch) | |
tree | 8c0045ceb528c231cc94e10534e305f9d196cc3c /tools/perf/scripts/python/check-perf-trace.py | |
parent | 0645f7eb6f6af78aba2bdd37ae776bd8754bc8f0 (diff) |
bpf: Fix bpf_iter's task iterator logic
task_seq_get_next might stop prematurely if get_pid_task() fails to get
task_struct. Failure to do so doesn't mean that there are no more tasks with
higher pids. Procfs's iteration algorithm (see next_tgid in fs/proc/base.c)
does a retry in such case. After this fix, instead of stopping prematurely
after about 300 tasks on my server, bpf_iter program now returns >4000, which
sounds much closer to reality.
Fixes: eaaacd23910f ("bpf: Add task and task/file iterator targets")
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
0 files changed, 0 insertions, 0 deletions