diff options
author | Oleg Nesterov <oleg@redhat.com> | 2023-09-05 18:46:49 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-09-08 18:42:19 +0300 |
commit | 4981921350452a7639fac9ac8f19be4d25febdca (patch) | |
tree | 50019e301467b3abe0c35e9786db320fc545ce36 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 1a00ef57d9f120b711b6b1193d12ba3789d47ec2 (diff) | |
download | linux-4981921350452a7639fac9ac8f19be4d25febdca.tar.xz |
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 <oleg@redhat.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230905154649.GA24935@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions