This helps (a lot!) with the Waterfall view. In fact, I cannot think
of a situation where knowing the duration (in addition to the start
and end times) won't help.
We don't need a socketpair for this. Additionally, things seem to work
better from the service when the client provides the pipe. Otherwise, when
running as a dbus service I often have issues with things getting closed
out from under us.
This allows you to specify --stack-size=(multiple_of_page_size) to unwind
from captured stack contents. It will use the new SysprofUserSampler to
unwind stack traces via sysprof-live-unwinder.
This instrument triggers the live unwinder in sysprofd to capture a
pre-configured amount of stack contents and CPU registers. You can use
this instead of SysprofSampler in cases where you do not have frame-
pointers but want a useful trace.
It does have a moderate amount of CPU overhead compared to just relying
on frame-pointers so keep that in mind. Generally useful on platforms
that do not have frame pointers such as CentOS.
This provides a new sysprof-live-unwinder subprocess that runs as root to
allow accessing all processes on the system via /proc/$pid/. It is spawned
by sysprofd with various perf event FDs and a FD to write captures to.
Ideally the capture_fd is something that will naturally error if the client
application crashes (such as a socketpair() having the peer close). This
is not enforced but encouraged. Additionally, an event_fd is used to allow
the client application to signal the live-unwinder to exit.
Unwinding is performed by looking at the modules loaded into the target
pid and using libdwfl to access DWARF/CFI/etc state machinery. Stack data
does not touch the disk as it exists in a mmap buffer from perf and is
then translated into a callchain and sent to the Sysprof client.
Unwinding occurs as normal post-mortem though is improved through the use
of debuginfod to locate the appropriate symbols.
This requires a coordinating sysprofd that knows how to handle reading the
new attributes. Setting these fields will allow snapshotting the contents
of the stack and registers to do offline unwinding.
Also make the conversion to GVariant available outside the module so that
we can consume it for live unwinding.
This allows copying events from a capture stream transparently into the
destination. No processing of the stream is performed, but that may change
in the future to accomidate JIT/Counter translations.
Internal only as support for upcoming live unwinding via external process.