Re: [RFC PATCH bpf-next 2/6] bpf: add bpf_get_stack helper

2018-04-09 Thread Yonghong Song
On 4/9/18 3:01 AM, Daniel Borkmann wrote: On 04/09/2018 07:02 AM, Alexei Starovoitov wrote: On 4/8/18 9:53 PM, Yonghong Song wrote: @@ -1004,7 +1007,8 @@ static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock) bpf_prog_kallsyms_del(prog->aux->func[i]); bpf_

Re: [RFC PATCH bpf-next 2/6] bpf: add bpf_get_stack helper

2018-04-09 Thread Daniel Borkmann
On 04/09/2018 07:02 AM, Alexei Starovoitov wrote: > On 4/8/18 9:53 PM, Yonghong Song wrote: @@ -1004,7 +1007,8 @@ static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock) bpf_prog_kallsyms_del(prog->aux->func[i]); bpf_prog_kallsyms_del(prog); >>>

Re: [RFC PATCH bpf-next 2/6] bpf: add bpf_get_stack helper

2018-04-08 Thread Alexei Starovoitov
On 4/8/18 9:53 PM, Yonghong Song wrote: @@ -1004,7 +1007,8 @@ static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock) bpf_prog_kallsyms_del(prog->aux->func[i]); bpf_prog_kallsyms_del(prog); -call_rcu(&prog->aux->rcu, __bpf_prog_put_rcu); +synchro

Re: [RFC PATCH bpf-next 2/6] bpf: add bpf_get_stack helper

2018-04-08 Thread Yonghong Song
On 4/8/18 8:34 PM, Alexei Starovoitov wrote: On 4/6/18 2:48 PM, Yonghong Song wrote: Currently, stackmap and bpf_get_stackid helper are provided for bpf program to get the stack trace. This approach has a limitation though. If two stack traces have the same hash, only one will get stored in th

Re: [RFC PATCH bpf-next 2/6] bpf: add bpf_get_stack helper

2018-04-08 Thread Alexei Starovoitov
On 4/6/18 2:48 PM, Yonghong Song wrote: Currently, stackmap and bpf_get_stackid helper are provided for bpf program to get the stack trace. This approach has a limitation though. If two stack traces have the same hash, only one will get stored in the stackmap table, so some stack traces are missi

[RFC PATCH bpf-next 2/6] bpf: add bpf_get_stack helper

2018-04-06 Thread Yonghong Song
Currently, stackmap and bpf_get_stackid helper are provided for bpf program to get the stack trace. This approach has a limitation though. If two stack traces have the same hash, only one will get stored in the stackmap table, so some stack traces are missing from user perspective. This patch impl