[Lldb-commits] [PATCH] Profile Assembly Until Ret Instruction

Tong Shen endlessroad at google.com
Fri Jul 25 13:42:50 PDT 2014


Sorry, wrong version of patch...


On Fri, Jul 25, 2014 at 1:41 PM, Tong Shen <endlessroad at google.com> wrote:

> Hi Molenda, lldb-commits,
>
> For now, x86 assembly profiler will stop after 10 "non-prologue"
> instructions. In practice it may not be sufficient. For example, we have a
> hand-written assembly function, which have hundreds of instruction before
> actual (stack-adjusting) prologue instructions.
>
> One way is to change the limit to 1000; but there will always be functions
> that break the limit :-) I believe the right thing to do here is parsing
> all instructions before "ret"/"call" as prologue instructions.
>
> Here's what I changed:
> - For "push %rbx" and "mov %rbx, -8(%rbp)": only add first row for that
> register. They may appear multiple times in function body. But as long as
> one of them appears, first appearance should be in prologue(If it's not in
> prologue, this function will not use %rbx, so these 2 instructions should
> not appear at all).
> - Also monitor "add %rsp 0x20".
> - Remove non prologue instruction count.
> - Add "call" instruction detection, and stop parsing after it.
>
> Thanks.
>
> --
> Best Regards, Tong Shen
>



-- 
Best Regards, Tong Shen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140725/b8c73962/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extend_assebmly_profiler_to_ret.patch
Type: text/x-patch
Size: 6614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140725/b8c73962/attachment.bin>


More information about the lldb-commits mailing list