Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • kernel
  • bpf
  • stackmap.c
Find file BlameHistoryPermalink
  • Song Liu's avatar
    bpf: Introduce helper bpf_get_task_stack() · fa28dcb8
    Song Liu authored Jun 29, 2020
    
    
    Introduce helper bpf_get_task_stack(), which dumps stack trace of given
    task. This is different to bpf_get_stack(), which gets stack track of
    current task. One potential use case of bpf_get_task_stack() is to call
    it from bpf_iter__task and dump all /proc/<pid>/stack to a seq_file.
    
    bpf_get_task_stack() uses stack_trace_save_tsk() instead of
    get_perf_callchain() for kernel stack. The benefit of this choice is that
    stack_trace_save_tsk() doesn't require changes in arch/. The downside of
    using stack_trace_save_tsk() is that stack_trace_save_tsk() dumps the
    stack trace to unsigned long array. For 32-bit systems, we need to
    translate it to u64 array.
    
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
    Link: https://lore.kernel.org/bpf/20200630062846.664389-3-songliubraving@fb.com
    fa28dcb8
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7