码迷,mamicode.com
首页 > 其他好文 > 详细

再看perf是如何通过dwarf处理栈帧的

时间:2018-07-20 23:34:58      阅读:545      评论:0      收藏:0      [点我收藏+]

标签:x86_64   dep   eve   sea   session   step   sample   out   ffffff   

从结构体stack_dump入手,

util/unwind-libunwind-local.c 中有函数access_mem

#0  access_mem (as=0x1f65bd0, addr=140221249831136, valp=0x7fffffffa930, __write=0, arg=0x7fffffffb900) at util/unwind-libunwind-local.c:452
#1  0x00007ffff6c171ec in _Ux86_64_dwarf_search_unwind_table () from /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8
#2  0x000000000052cd16 in find_proc_info (as=0x1f65bd0, ip=140221248995871, pi=0x7fffffffb620, need_unwind_info=1, arg=0x7fffffffb900)
    at util/unwind-libunwind-local.c:364
#3  0x00007ffff6c13e75 in ?? () from /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8
#4  0x00007ffff6c159e7 in ?? () from /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8
#5  0x00007ffff6c16cd9 in ?? () from /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8
#6  0x00007ffff6c0f671 in _Ux86_64_step () from /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8
#7  0x000000000052c48c in get_entries (ui=ui@entry=0x7fffffffb900, cb=0x4c0ff0 <unwind_entry>, arg=0x7ffff7fcf758, max_stack=127)
    at util/unwind-libunwind-local.c:648
#8  0x000000000052c6c2 in _unwind__get_entries (cb=<optimized out>, arg=<optimized out>, thread=<optimized out>, data=<optimized out>, 
    max_stack=<optimized out>) at util/unwind-libunwind-local.c:686
#9  0x00000000004c652c in thread__resolve_callchain_unwind (max_stack=127, sample=0x7fffffffbb60, evsel=0x1ee46f0, cursor=0x7ffff7fcf758, 
    thread=0x1f42060) at util/machine.c:1941
#10 thread__resolve_callchain (thread=0x1f42060, cursor=0x7ffff7fcf758, evsel=0x1ee46f0, sample=0x7fffffffbb60, parent=0x7fffffffba68, 
    root_al=0x7fffffffba00, max_stack=127) at util/machine.c:1968
#11 0x00000000004bf181 in sample__resolve_callchain (sample=<optimized out>, cursor=<optimized out>, parent=parent@entry=0x7fffffffba68, 
    evsel=<optimized out>, al=al@entry=0x7fffffffba00, max_stack=max_stack@entry=127) at util/callchain.c:803
#12 0x00000000004ed711 in hist_entry_iter__add (iter=0x7fffffffba40, al=0x7fffffffba00, max_stack_depth=127, arg=0x7fffffffc0e0)
    at util/hist.c:1023
#13 0x000000000043208e in process_sample_event (tool=0x7fffffffc0e0, event=<optimized out>, sample=0x7fffffffbb60, evsel=<optimized out>, 
    machine=<optimized out>) at builtin-report.c:192
#14 0x00000000004cb1fa in perf_evlist__deliver_sample (machine=<optimized out>, evsel=0x1ee46f0, sample=0x7fffffffbb60, event=0x7ffff7ff5578, 
    tool=0x7fffffffc0e0, evlist=0x1ee3cb0) at util/session.c:1196
#15 machines__deliver_event (machines=machines@entry=0x1ee39f8, evlist=0x1ee3cb0, event=event@entry=0x7ffff7ff5578, 
    sample=sample@entry=0x7fffffffbb60, tool=tool@entry=0x7fffffffc0e0, file_offset=file_offset@entry=17784) at util/session.c:1233

 是怎么

再看perf是如何通过dwarf处理栈帧的

标签:x86_64   dep   eve   sea   session   step   sample   out   ffffff   

原文地址:https://www.cnblogs.com/honpey/p/9344549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!