use pthreads to separate traced thread from trace writer
not portable: uses uffdio (requires linux kernel >=5.11) to synchronize between both threads
use zstd compression
solves #53
By using a page fault trap (with uffdio), we can remove the check if (trace_pos != TRACE_BUF_SIZE) { trace_write(); } we currently have on master for every byte! Instead, when writing to a position near TRACE_BUF_SIZE, a page fault is triggered because we placed a write protection flag there. When we "handle" the fault, we call trace_write(). This reduces the overhead of trace writing basically to the speed of the disk!
(I also have a more portable branch without uffdio is fork_shared_mmap_zstd. However, due to missing synchronization, the traced program runs unhemmed without caring whether traces are written or not. This leads to a loss of blocks in the recorded trace.)
We observed that using compression additionally lowers the run-time overhead caused by disk speed. Of course, also lowering trace size.
All in all the run-time overhead should be less then 15 percent now, for many apps even zero. Extensive experiments still pending.
solves #53
By using a page fault trap (with uffdio), we can remove the check
if (trace_pos != TRACE_BUF_SIZE) { trace_write(); }
we currently have on master for every byte! Instead, when writing to a position near TRACE_BUF_SIZE, a page fault is triggered because we placed a write protection flag there. When we "handle" the fault, we calltrace_write()
. This reduces the overhead of trace writing basically to the speed of the disk!(I also have a more portable branch without uffdio is
fork_shared_mmap_zstd
. However, due to missing synchronization, the traced program runs unhemmed without caring whether traces are written or not. This leads to a loss of blocks in the recorded trace.)We observed that using compression additionally lowers the run-time overhead caused by disk speed. Of course, also lowering trace size.
All in all the run-time overhead should be less then 15 percent now, for many apps even zero. Extensive experiments still pending.