mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
bpf: Consolidate task_struct BTF_ID declarations
No need to have it defined 5 times. Once is enough. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/6dcefa5bed26fe1226f26683f36819bb53ec19a2.1629772842.git.dxu@dxuuu.xyz
This commit is contained in:
parent
1b07d00a15
commit
33c5cb3601
5 changed files with 12 additions and 15 deletions
|
@ -525,7 +525,6 @@ static const struct seq_operations task_vma_seq_ops = {
|
|||
};
|
||||
|
||||
BTF_ID_LIST(btf_task_file_ids)
|
||||
BTF_ID(struct, task_struct)
|
||||
BTF_ID(struct, file)
|
||||
BTF_ID(struct, vm_area_struct)
|
||||
|
||||
|
@ -591,19 +590,19 @@ static int __init task_iter_init(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
task_reg_info.ctx_arg_info[0].btf_id = btf_task_file_ids[0];
|
||||
task_reg_info.ctx_arg_info[0].btf_id = btf_task_struct_ids[0];
|
||||
ret = bpf_iter_reg_target(&task_reg_info);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
task_file_reg_info.ctx_arg_info[0].btf_id = btf_task_file_ids[0];
|
||||
task_file_reg_info.ctx_arg_info[1].btf_id = btf_task_file_ids[1];
|
||||
task_file_reg_info.ctx_arg_info[0].btf_id = btf_task_struct_ids[0];
|
||||
task_file_reg_info.ctx_arg_info[1].btf_id = btf_task_file_ids[0];
|
||||
ret = bpf_iter_reg_target(&task_file_reg_info);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
task_vma_reg_info.ctx_arg_info[0].btf_id = btf_task_file_ids[0];
|
||||
task_vma_reg_info.ctx_arg_info[1].btf_id = btf_task_file_ids[2];
|
||||
task_vma_reg_info.ctx_arg_info[0].btf_id = btf_task_struct_ids[0];
|
||||
task_vma_reg_info.ctx_arg_info[1].btf_id = btf_task_file_ids[1];
|
||||
return bpf_iter_reg_target(&task_vma_reg_info);
|
||||
}
|
||||
late_initcall(task_iter_init);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue