diff options
author | Oleg Nesterov <[email protected]> | 2023-09-05 17:46:49 +0200 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2023-09-08 08:42:19 -0700 |
commit | 4981921350452a7639fac9ac8f19be4d25febdca (patch) | |
tree | 50019e301467b3abe0c35e9786db320fc545ce36 /tools/perf/scripts/python/gecko.py | |
parent | 1a00ef57d9f120b711b6b1193d12ba3789d47ec2 (diff) |
bpf: task_group_seq_get_next: cleanup the usage of get/put_task_struct
get_pid_task() makes no sense, the code does put_task_struct() soon after.
Use find_task_by_pid_ns() instead of find_pid_ns + get_pid_task and kill
put_task_struct(), this allows to do get_task_struct() only once before
return.
While at it, kill the unnecessary "if (!pid)" check in the "if (!*tid)"
block, this matches the next usage of find_pid_ns() + get_pid_task() in
this function.
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions