This change is important for longer profiling sessions (such as continuous profiling) to be informed of processes that exit as well of memory mappings that get unmapped.
The events are only sent for mappings and processes that are already stored in the BPF maps.
Additional changes
Move the try_recv for the events from a busy loop to a waiting time of 250ms, as this otherwise uses too much CPU for no good reason;
Change build.rs to rebuild if any header or source file under src/bpf is modified;
Fixes a bug where the unwind information was being updated even if it wasn't dirty;
Future work
Improve the way the BPF headers and code are split;
Actually mark the memory mappings that get unmapped as so in the userspace data structures;
Use the fact that a memory mapping has been unmapped or a process has exited to for example clean up some of the data we store;
This change is important for longer profiling sessions (such as continuous profiling) to be informed of processes that exit as well of memory mappings that get unmapped.
The events are only sent for mappings and processes that are already stored in the BPF maps.
Additional changes
Future work
Test Plan
Ran lightswitch several times without issues.