This is a good task for someone who wants to dip a toe into the translator optimizer. They focus on the emit_locks/emit_unlocks functions in translate.cxx. - elide all global variable lock/unlock operations from begin/end probes - in translate_pass(), compute another varuse_collecting_visitor instance, over all probes except begin/end probes; put it into a new c_unparser field - within emit_locks/unlocks, elide a read lock that would be taken for a global, if it turns out that it is not written to in any normal probe. That is, if that newly computed semi-global varuse_collecting_visitor instance does *not* note a global as written-to, then we don't have to lock it here to read it safely.
http://sourceware.org/ml/systemtap/2006-q3/msg00217.html
Changes to elide all global variable lock/unlock operations from begin/end probes has been checked in.
The following has been implemented and checked in: - in translate_pass(), compute another varuse_collecting_visitor instance, over all probes except begin/end probes; put it into a new c_unparser field - within emit_locks/unlocks, elide a read lock that would be taken for a global, if it turns out that it is not written to in any normal probe. That is, if that newly computed semi-global varuse_collecting_visitor instance does *not* note a global as written-to, then we don't have to lock it here to read it safely.