3 ms·
The Linux perf profiler has support for symbolization of dynamic code generated by a JIT. This is supported by at least the JVM, Node, and Python (3.12). https
by nemetroid 4y ago
The Linux perf profiler has support for symbolization of dynamic code generated by a JIT. This is supported by at least the JVM, Node, and Python (3.12).
https://github.com/torvalds/linux/blob/0513e464f9007b70b96740271a948ca5ab6e7dd7/tools/perf/Documentation/jit-interface.txt https://github.com/torvalds/linux/blob/0513e464f9007b70b9674...
https://www.brendangregg.com/Slides/KernelRecipes_Perf_Events.pdf https://www.brendangregg.com/Slides/KernelRecipes_Perf_Event... (pp. 53-58)
https://docs.python.org/3.12/howto/perf_profiling.html#perf-profiling https://docs.python.org/3.12/howto/perf_profiling.html#perf-...
- quotemstr 4y agoThis is an incredibly hacky mechanism that has to be individually enabled in each context in which it's used. What if I can't write to tmp? What if PIDs wrap around?
- nemetroid 4y agoI don't see why the "individually enabled" part is inherent to the design. The JITs could emit these files automatically, if they wanted to. But the main point is that "inability to support unwinding of anything that isn't AOT compiled native code" is factually incorrect: as far as I know, frame pointers plus this "hack" is currently the only widely available way to do just that.
- quotemstr 4y agoNo, they can't, because doing so would be a constant drag on performance for processes not being profiled. Plus, there's no provision for VA reuse for the trampolines, so as the set of described functions grows, so does the magic text file in /tmp.