-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: fix stacktraces formatting in memleak.py #2316
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix printing of stacktraces. Example: Before this patch: Attaching to kernel allocators, Ctrl+C to quit. [14:11:43] Top 10 stacks with outstanding allocations: 8 bytes in 1 allocations from stack b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tperf_trace_event_init+0xc9 [kernel]\n\t\tperf_trace_init+0x69 [kernel]\n\t\tperf_tp_event_init+0x1b [kernel]\n\t\tperf_try_init_event+0x42 [kernel]\n\t\tperf_event_alloc+0x620 [kernel]\n\t\t__do_sys_perf_event_open+0x188 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]' 16 bytes in 1 allocations from stack b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tbpf_prog_alloc+0x33 [kernel]\n\t\tbpf_prog_load+0xf5 [kernel]\n\t\tperf_event_for_each_child+0x34 [kernel]\n\t\t_perf_ioctl+0x1d7 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__do_sys_bpf+0x953 [kernel]\n\t\tperf_ioctl+0x40 [kernel]\n\t\tdo_vfs_ioctl+0xa5 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]' With this patch: Attaching to kernel allocators, Ctrl+C to quit. [14:13:09] Top 10 stacks with outstanding allocations: 576 bytes in 3 allocations from stack kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] kmem_cache_alloc+0x15c [kernel] __cpa_flush_tlb+0x0 [kernel] __d_alloc+0x22 [kernel] alloc_file_pseudo+0x65 [kernel] anon_inode_getfile+0x7f [kernel] anon_inode_getfd+0x35 [kernel] bpf_prog_load+0x3ef [kernel] _perf_ioctl+0x1d7 [kernel] alloc_file_pseudo+0xa7 [kernel] __do_sys_bpf+0x953 [kernel] perf_ioctl+0x40 [kernel] do_vfs_ioctl+0xa5 [kernel] do_syscall_64+0x48 [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 768 bytes in 4 allocations from stack kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] alloc_file_pseudo+0x65 [kernel] ns_capable_common+0x2b [kernel] anon_inode_getfile+0x7f [kernel] __do_sys_perf_event_open+0x86f [kernel] do_syscall_64+0x48 [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel]
[buildbot, test this please] |
1 similar comment
[buildbot, test this please] |
brendangregg
pushed a commit
to brendangregg/bcc
that referenced
this pull request
May 23, 2019
Fix printing of stacktraces. Example: Before this patch: Attaching to kernel allocators, Ctrl+C to quit. [14:11:43] Top 10 stacks with outstanding allocations: 8 bytes in 1 allocations from stack b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tperf_trace_event_init+0xc9 [kernel]\n\t\tperf_trace_init+0x69 [kernel]\n\t\tperf_tp_event_init+0x1b [kernel]\n\t\tperf_try_init_event+0x42 [kernel]\n\t\tperf_event_alloc+0x620 [kernel]\n\t\t__do_sys_perf_event_open+0x188 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]' 16 bytes in 1 allocations from stack b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tbpf_prog_alloc+0x33 [kernel]\n\t\tbpf_prog_load+0xf5 [kernel]\n\t\tperf_event_for_each_child+0x34 [kernel]\n\t\t_perf_ioctl+0x1d7 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__do_sys_bpf+0x953 [kernel]\n\t\tperf_ioctl+0x40 [kernel]\n\t\tdo_vfs_ioctl+0xa5 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]' With this patch: Attaching to kernel allocators, Ctrl+C to quit. [14:13:09] Top 10 stacks with outstanding allocations: 576 bytes in 3 allocations from stack kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] kmem_cache_alloc+0x15c [kernel] __cpa_flush_tlb+0x0 [kernel] __d_alloc+0x22 [kernel] alloc_file_pseudo+0x65 [kernel] anon_inode_getfile+0x7f [kernel] anon_inode_getfd+0x35 [kernel] bpf_prog_load+0x3ef [kernel] _perf_ioctl+0x1d7 [kernel] alloc_file_pseudo+0xa7 [kernel] __do_sys_bpf+0x953 [kernel] perf_ioctl+0x40 [kernel] do_vfs_ioctl+0xa5 [kernel] do_syscall_64+0x48 [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 768 bytes in 4 allocations from stack kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] alloc_file_pseudo+0x65 [kernel] ns_capable_common+0x2b [kernel] anon_inode_getfile+0x7f [kernel] __do_sys_perf_event_open+0x86f [kernel] do_syscall_64+0x48 [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel]
palexster
pushed a commit
to palexster/bcc
that referenced
this pull request
Jul 7, 2019
Fix printing of stacktraces. Example: Before this patch: Attaching to kernel allocators, Ctrl+C to quit. [14:11:43] Top 10 stacks with outstanding allocations: 8 bytes in 1 allocations from stack b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tperf_trace_event_init+0xc9 [kernel]\n\t\tperf_trace_init+0x69 [kernel]\n\t\tperf_tp_event_init+0x1b [kernel]\n\t\tperf_try_init_event+0x42 [kernel]\n\t\tperf_event_alloc+0x620 [kernel]\n\t\t__do_sys_perf_event_open+0x188 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]' 16 bytes in 1 allocations from stack b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tbpf_prog_alloc+0x33 [kernel]\n\t\tbpf_prog_load+0xf5 [kernel]\n\t\tperf_event_for_each_child+0x34 [kernel]\n\t\t_perf_ioctl+0x1d7 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__do_sys_bpf+0x953 [kernel]\n\t\tperf_ioctl+0x40 [kernel]\n\t\tdo_vfs_ioctl+0xa5 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]' With this patch: Attaching to kernel allocators, Ctrl+C to quit. [14:13:09] Top 10 stacks with outstanding allocations: 576 bytes in 3 allocations from stack kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] kmem_cache_alloc+0x15c [kernel] __cpa_flush_tlb+0x0 [kernel] __d_alloc+0x22 [kernel] alloc_file_pseudo+0x65 [kernel] anon_inode_getfile+0x7f [kernel] anon_inode_getfd+0x35 [kernel] bpf_prog_load+0x3ef [kernel] _perf_ioctl+0x1d7 [kernel] alloc_file_pseudo+0xa7 [kernel] __do_sys_bpf+0x953 [kernel] perf_ioctl+0x40 [kernel] do_vfs_ioctl+0xa5 [kernel] do_syscall_64+0x48 [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel] 768 bytes in 4 allocations from stack kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] kmem_cache_alloc+0x15c [kernel] __d_alloc+0x22 [kernel] alloc_file_pseudo+0x65 [kernel] ns_capable_common+0x2b [kernel] anon_inode_getfile+0x7f [kernel] __do_sys_perf_event_open+0x86f [kernel] do_syscall_64+0x48 [kernel] entry_SYSCALL_64_after_hwframe+0x44 [kernel]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix printing of stacktraces. Example:
Before this patch:
Attaching to kernel allocators, Ctrl+C to quit.
[14:11:43] Top 10 stacks with outstanding allocations:
8 bytes in 1 allocations from stack
b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tperf_trace_event_init+0xc9 [kernel]\n\t\tperf_trace_init+0x69 [kernel]\n\t\tperf_tp_event_init+0x1b [kernel]\n\t\tperf_try_init_event+0x42 [kernel]\n\t\tperf_event_alloc+0x620 [kernel]\n\t\t__do_sys_perf_event_open+0x188 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]'
16 bytes in 1 allocations from stack
b'pcpu_alloc+0x3d8 [kernel]\n\t\tpcpu_alloc+0x3d8 [kernel]\n\t\tbpf_prog_alloc+0x33 [kernel]\n\t\tbpf_prog_load+0xf5 [kernel]\n\t\tperf_event_for_each_child+0x34 [kernel]\n\t\t_perf_ioctl+0x1d7 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__switch_to_asm+0x34 [kernel]\n\t\t__switch_to_asm+0x40 [kernel]\n\t\t__do_sys_bpf+0x953 [kernel]\n\t\tperf_ioctl+0x40 [kernel]\n\t\tdo_vfs_ioctl+0xa5 [kernel]\n\t\tdo_syscall_64+0x48 [kernel]\n\t\tentry_SYSCALL_64_after_hwframe+0x44 [kernel]'
With this patch:
Attaching to kernel allocators, Ctrl+C to quit.
[14:13:09] Top 10 stacks with outstanding allocations:
576 bytes in 3 allocations from stack
kmem_cache_alloc+0x15c [kernel]
__d_alloc+0x22 [kernel]
kmem_cache_alloc+0x15c [kernel]
__cpa_flush_tlb+0x0 [kernel]
__d_alloc+0x22 [kernel]
alloc_file_pseudo+0x65 [kernel]
anon_inode_getfile+0x7f [kernel]
anon_inode_getfd+0x35 [kernel]
bpf_prog_load+0x3ef [kernel]
_perf_ioctl+0x1d7 [kernel]
alloc_file_pseudo+0xa7 [kernel]
__do_sys_bpf+0x953 [kernel]
perf_ioctl+0x40 [kernel]
do_vfs_ioctl+0xa5 [kernel]
do_syscall_64+0x48 [kernel]
entry_SYSCALL_64_after_hwframe+0x44 [kernel]
768 bytes in 4 allocations from stack
kmem_cache_alloc+0x15c [kernel]
__d_alloc+0x22 [kernel]
kmem_cache_alloc+0x15c [kernel]
__d_alloc+0x22 [kernel]
alloc_file_pseudo+0x65 [kernel]
ns_capable_common+0x2b [kernel]
anon_inode_getfile+0x7f [kernel]
__do_sys_perf_event_open+0x86f [kernel]
do_syscall_64+0x48 [kernel]
entry_SYSCALL_64_after_hwframe+0x44 [kernel]