Right now we emit separate ExecStart and ExecFinish events since you need to capture the exec arguments and return code at different times. This means that we emit two separate events for a successful exec when really would emit a single event.
Approach#
- Rename
ExecStarttoExecsince we'll only have a singleExecevent. - Update the
exec_seenmap to holdExecinstead ofbool. - Instead of writing an
Exectoeventswhen observingexecve(at)_enter, store it inexec_seen. - In the
execve(at)_exithandler, write theExecevent toeventsif we saw it on the enter side and the return code is 0. - Clear the entry for this PID in
exec_seen.
Considerations#
There's a race condition where another thread could possible call exec between execve(at)_enter and execve(at)_exit of a previous exec call.
- Where does the second thread store its
Execevent?