libsysprof: add SysprofUserSampler for live unwinding

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 commit is contained in:
Christian Hergert
2024-11-03 10:53:29 -08:00
parent 1bd79af439
commit 6e3e1637be
4 changed files with 621 additions and 0 deletions

View File

@ -63,6 +63,7 @@ libsysprof_public_sources = [
'sysprof-time-span.c',
'sysprof-tracefd-consumer.c',
'sysprof-tracer.c',
'sysprof-user-sampler.c',
]
libsysprof_public_headers = [
@ -130,6 +131,7 @@ libsysprof_public_headers = [
'sysprof-time-span.h',
'sysprof-tracefd-consumer.h',
'sysprof-tracer.h',
'sysprof-user-sampler.h',
]
libsysprof_private_sources = [
@ -154,6 +156,11 @@ libsysprof_private_sources = [
'sysprof-strings.c',
'sysprof-symbol-cache.c',
'timsort/gtktimsort.c',
gnome.gdbus_codegen('ipc-unwinder',
sources: '../sysprofd/org.gnome.Sysprof3.Unwinder.xml',
interface_prefix: 'org.gnome.Sysprof3.',
namespace: 'Ipc'),
]
if debuginfod_dep.found()