• Y
    bpf: add bpf_get_stack helper · c195651e
    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 implements a new helper, bpf_get_stack, will
    send stack traces directly to bpf program. The bpf program
    is able to see all stack traces, and then can do in-kernel
    processing or send stack traces to user space through
    shared map or bpf_perf_event_output.
    Acked-by: NAlexei Starovoitov <ast@fb.com>
    Signed-off-by: NYonghong Song <yhs@fb.com>
    Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
    c195651e
bpf.h 86.3 KB