> surely global_tracking_flag could be persuaded to live in a register, no?

Reserving a register will slow down the whole program.  I'd expect a serious 
hit on 32-bit x86, and modest but measurable slowdown elsewhere.  It might be 
worth doing a quick experiment, if there's a way to convince LLVM to just set 
aside a register.

The Linux kernel uses self-modifying code for this sort of thing.  Functions 
are compiled with logging / tracing code, which is then NOP'd out until it's 
needed.  This is tricky to get right, especially in a concurrent setting, but 
it might be worth considering if we want Rust to have really good 
production-compatible monitoring (which I agree is a worthwhile goal).

keegan
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to