We want to be backtracing directly into the capture buffer, but also need
to skip a small number of frames.
If we call the backtrace before filling in information, we can capture to
the position *before* ev->addrs and then overwrite that data right after.
This seems to be significantly faster than doing the manual stepping. A
quick look shows that it has a number of special cases which we'd have
to duplicate, so best to just use it directly.
128 is a bit much and can slow us down considerably with user-space stack
traces. This can mess up the tree a bit, but we can alter how we view
things later on if we need to so that it is easier to read.
This ensures that the producer can produce as soon as the reader has moved
past that data. Now that the callback has a mutable consumption value, they
can read the whole data in one shot anyway.
This ideally should be dynamic in the future to copy out data at a rate
that keeps us around 33% usage rate so that we can still burst if we need
to but keep things empty enough to not loose data.
This frame type can be used to communicate with the peer over the mapped
ring buffer to denote that writing is finished and it can free any
resources for the mapping.
This removes the 8 bytes of framing data from the MappedRingBuffer which
means we can write more data without racing. But also this means that we
can eventually use the mapped ring buffer as our normal buffer for
capture writing (to be done later).
This uses a simplified form of collection without writing to capture
files directly. The data is written into a ring buffer for Sysprof to
pick up and copy into the real destination file. Using the mmap() ring
buffer allows loss of data when Sysprof cannot keep up, but on the other
hand allows the inferior to be fast enough to be useful.
This is a simplified API for the inferior to use (such as from a
LD_PRELOAD) that will use mmap()'d ring buffer created by Sysprof. Doing
so can reduce the amount of overhead in the inferior enough to make some
workloads useful. For example, collecting memory statistics and backtraces
is now fast enough to be useful.
This is a source that will allow the inferior to call into Sysprof to
create a new mmap()'d ring buffer to share data. This allows significantly
less overhead in the child process as Sysprof itself will take care of
copying the data out of the inferior into the final capture file. There is
more copying of course, but less intrusive to the inferior itself.
This is the start of a ring buffer to coordinate between processes without
the overhead of writing directly to files within the inferior process.
Instead, the parent process can monitor the ring buffer for framing
information and pass that along to the capture writer.