lkml.org 
[lkml]   [2022]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/3] bpf: optimize the bpf_kprobe_multi_link_attach function
Date
This patch series tries to optimize the bpf_kporbe_multi_link_attach
in bpf_trace.c

Firstly, there is only one 'error' tag to handle error code. But in one
'error' tag, there are three 'free' functions which is not efficient. So
I split this one tag to three tags to make it clear.

Secondly, I simplify double 'if' statements to one statement.

Finally, coccicheck reports an opportunity for vmemdup_user. So I use
vmemdup_user to make code cleaner.

Wan Jiabing (3):
bpf: use 'error_xxx' tags in bpf_kprobe_multi_link_attach
bpf: simplify if-if to if in bpf_kprobe_multi_link_attach
bpf: use vmemdup_user instead of kvmalloc and copy_from_user

kernel/trace/bpf_trace.c | 34 +++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)

--
2.35.1

\
 
 \ /
  Last update: 2022-05-12 16:18    [W:0.082 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site