Cost vs benefit?
Cost vs benefit?
Posted Oct 9, 2024 11:29 UTC (Wed) by ianmcc (subscriber, #88379)In reply to: Cost vs benefit? by iabervon
Parent article: Efficient Rust tracepoints
I'd have thought that it would be better, for tracepoint functions, to require that they don't clobber registers, even if that isn't the usual convention on some particular arch? If the tracepoints are almost always not active, it doesn't make much sense to have the inactive tracepoint implemented as (save registers, nop, restore registers). Well, I guess in the inactive case you could replace the save/restore with nop's as well, but that still makes a much longer sequence than necessary.
Posted Oct 9, 2024 13:20 UTC (Wed)
by daroc (editor, #160859)
[Link]
Cost vs benefit?
Tracepoints aren't implemented that way. Just as a single nop the same size as a jump. To activate the tracepoint, the nop is replaced by a jump to a bit of code that does the saving and restoring of registers.