Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
LLVM XRay: You Might Be Missing Out (lucisqr.substack.com)
23 points by signa11 on Sept 11, 2022 | hide | past | favorite | 3 comments


> However when the trampolines were activated, XRay added a latency of 230 nanoseconds per call or 920 cycles on my box, which is very significant. I really hoped it to be better since I have an old strategy using macros that introduce less than 20 nanoseconds per call (80 cycles). That was very disappointing since I planned to replace my homegrown method with something more sophisticated.

This has also been my experience: that I can either fight with a high-overhead profiler built by someone else that just doesn't give me the granularity I need or I can it knuckle down and spend the day to build my own low-overhead version and it pretty much always ends up being more useful... but, because I never do it at the compiler level, it is something I frustratingly have to keep re-doing for different environments, which makes me keep thinking "they have to have solved this by now, right?"... and then having my hopes dashed.


> It saves RAX (64-bit A register) in the stack (the A register needs to be preserved by the caller on x86-64 ABI)

The push here is strictly for alignment.


Intel PT and LBR in branch history mode might be better fits (AMD's BRS isn't quite there yet, unfortunately).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: