This patch adds support for on-the-fly arming/disarming of hrtimer
probes. Although it is only supported for non-usermode, there were a few
changes required in dyninst/timer.c so that the same interface is
exposed for both usermode and kernel mode.
runtime/dyninst/timer.c
- Decouple timer creation from timer starting by factoring out
_stp_hrtimer_start() from _stp_hrtimer_create().
- Make _stp_hrtimer_cancel() actually just cancel the timer, and not
completely delete it.
- Add new _stp_hrtimer_delete() to delete the timer.
runtime/linux/timer.c
- Similarly, factor out _stp_hrtimer_start() from
_stp_hrtimer_create().
- Add new _stp_hrtimer_delete(), which also does a cancel.
tapset-timers.cxx
- Declare hrtimer_derived_probe as a probe that supports on-the-fly
operations.
- In emit_module_init(): unconditionally create the timer, but if in
STP_ON_THE_FLY mode, only bother to start it if its condition is
met.
- In emit_module_refresh(): check for which timers to start/cancel.