A new trigger type for global control
namhyung opened this issue · 5 comments
I remember there were some suggestions using file size or elapsed time as a trigger point and associate (global) actions to it (But I cannot find where). For example, we might do things like:
- tracing is off by default, and turn it on after 10 seconds
- similarly, trace only the first 3 seconds of execution
- or trace only from 5 second to 10 second of execution
- finish the tracing when file size reaches to 100 MB
There's --signal
option for the similar purpose, but it only handles signals. Maybe we can add time and size support there, or have a new option to handle it separately.
This is related to #1699.
Actually we can use timeout
command to send a signal at given time: #1598 (comment).
For the first case above, this would do the job (but much more verbose).
$ timeout -s RTMIN 10 uftrace --trace=off --signal RTMIN@trace_on <target-program>
This could be
$ uftrace --trace=off --signal time=10s@trace_on <target-program>
How about the following interface as mentioned at #1699?
# trace target program since 10s elapsed from the beginning.
$ uftrace --trace=10s~ ./prog
This can be much simpler.
Yep, that looks better. I think we also need data size support (maybe only needed for finish
action).