• Song Liu's avatar
    bpf: enable stackmap with build_id in nmi context · bae77c5e
    Song Liu authored
    Currently, we cannot parse build_id in nmi context because of
    up_read(&current->mm->mmap_sem), this makes stackmap with build_id
    less useful. This patch enables parsing build_id in nmi by putting
    the up_read() call in irq_work. To avoid memory allocation in nmi
    context, we use per cpu variable for the irq_work. As a result, only
    one irq_work per cpu is allowed. If the irq_work is in-use, we
    fallback to only report ips.
    
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    bae77c5e
stackmap.c 16.2 KB