<div dir="ltr">Hi Molenda, lldb-commits,<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>Here's what I changed:</div><div>- 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).</div>
<div><div>- Also monitor "add %rsp 0x20".</div><div>- Remove non prologue instruction count.</div><div>- Add "call" instruction detection, and stop parsing after it.</div><div><br></div><div>Thanks.</div>
<div><br></div>-- <br><div dir="ltr">Best Regards, Tong Shen</div>
</div></div>