You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution I implemented in #253 doesn't account for a process exiting while there are still trace events for that process to be processed and reported. If that happens then the executable path retrieval logic will return the empty string and there will be no executable path attribute attached to the profile.
Some possible solutions:
Retrieve executable path in the kernel and send it with the trace (same as with comm).
Cleanup pidToProcessInfo immediately on PID exit, but store pidToExecutablePath in a secondary cache. Then do secondary lookups in that cache if the primary lookup in pidToProcessInfo fails.
Note that we only care about process exit since there is no race for newly created processes: in order for userspace to receive a trace belonging to a particular PID, pidToProcessInfo has to be populated for that PID (therefore the executable path is guaranteed to exist).
Option 3. seems to be the simplest. Option 1. will probably involve walking filesystem datastructures and dealing with task_struct without BTF/CO-RE. Option 2. introduces a PID reuse concern (albeit theoretical with current trace poll interval).
If option 3. is chosen then we should probably also decouple executable path storage from pidToProcessInfo and just use a single LRU for paths e.g. pidToExecutableInfo.
The text was updated successfully, but these errors were encountered:
The solution I implemented in #253 doesn't account for a process exiting while there are still trace events for that process to be processed and reported. If that happens then the executable path retrieval logic will return the empty string and there will be no executable path attribute attached to the profile.
Some possible solutions:
comm
).pidToProcessInfo
immediately on PID exit, but storepidToExecutablePath
in a secondary cache. Then do secondary lookups in that cache if the primary lookup inpidToProcessInfo
fails.Note that we only care about process exit since there is no race for newly created processes: in order for userspace to receive a trace belonging to a particular PID,
pidToProcessInfo
has to be populated for that PID (therefore the executable path is guaranteed to exist).Option 3. seems to be the simplest. Option 1. will probably involve walking filesystem datastructures and dealing with
task_struct
without BTF/CO-RE. Option 2. introduces a PID reuse concern (albeit theoretical with current trace poll interval).If option 3. is chosen then we should probably also decouple executable path storage from
pidToProcessInfo
and just use a single LRU for paths e.g.pidToExecutableInfo
.The text was updated successfully, but these errors were encountered: