Commit Graph

4292 Commits

Author SHA1 Message Date
c3cb2f71bc sysprof-cli: add support for live unwinding
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.
2024-11-03 10:59:05 -08:00
6e3e1637be 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.
2024-11-03 10:59:05 -08:00
1bd79af439 sysprofd: add support for unwinding without frame pointers
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.
2024-11-03 10:59:05 -08:00
39b96f47f5 libsysprof: add support for stack/regs options in attr
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.
2024-11-03 10:59:00 -08:00
fde9f5868c libsysprof: add muxer GSource
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.
2024-11-03 10:37:20 -08:00
a6b90e5a40 Update Dutch translation
(cherry picked from commit 047295e41c48c68336cfde81927c11abc42f6695)
2024-10-28 15:47:47 +00:00
d435c42666 libsysprof: actually unmap our event stream 2024-10-24 18:01:43 -07:00
571eb5f85b sysprof/logs: ignore -1 for cpu/pid in cells
They just mean empty, so show it as such in the cells.
2024-10-24 12:55:24 -07:00
c9a1b322cd libsysprof/sampler: track lost records as a counter/log
This makes it much easier to see what happened from the capture file which
may originate from a user different than the person inspecting it.
2024-10-24 12:49:48 -07:00
2838024227 libsysprof: add union for perf "lost" records 2024-10-24 12:42:55 -07:00
ef32a3c921 sysprof-diff: load document asynchronously 2024-10-23 11:56:30 -07:00
d5d3c71879 libsysprof: remove unnecessary address calculation
We are only fallback symbols here, which is 1 address-wide.
2024-10-23 11:54:33 -07:00
21ebc8f1af sysprof-cat: use single finally to exit main loop 2024-10-23 11:40:54 -07:00
6d10a4337f sysprof-cat: load document asynchronously from load fiber 2024-10-23 11:40:54 -07:00
051559dbca Update Slovenian translation 2024-10-14 14:12:15 +00:00
65f307eb2e Update POTFILES.in 2024-10-13 12:11:08 +02:00
29fc388824 build: always build debuginfod symbolizer
Even if it is disabled, we want the GType enabled and part of our ABI. We
will return NULL if one is created and debuginfod is not supported or if
we failed to create a client.
2024-10-11 11:46:26 -07:00
e70a5b076c libsysprof: return NULL instance unless debuginfod works
If we are configured with support for debuginfod and it fails to initialize
or we are not configured to use debuginfod, always ensure g_object_new()
will return a NULL instance back.

This helps prevent against misconfigured instances so we do not need to
do so many checks in vfuncs as well as allowing us to have the GType be
available always even when not built with debuginfod.
2024-10-11 11:45:41 -07:00
0d8e004558 libsysprof: fix building with -Ddebuginfod=auto 2024-10-11 11:26:20 -07:00
c009532c91 libsysprof: ensure access to process info 2024-10-11 11:09:48 -07:00
24619651af Merge branch 'wip/chergert/debuginfod' into 'master'
Add support for debuginfod

See merge request GNOME/sysprof!109
2024-10-11 00:15:58 +00:00
d2471d4bf5 libsysprof: add debuginfod symbolizer
This is based on a debuginfod_client provided by Barnabás Pőcze in !73.
It extends it to use the new task infrastructure to elevate the download
process to the user while loading a capture file.
2024-10-10 17:12:30 -07:00
1464e3a48e libsysprof: hoist fallback symbol creation
This makes sure that we get that even when not using the Elf symbolizer
but also means we can fallback through the Elf symbolizer into the
debuginfod symbolizer.
2024-10-10 17:04:19 -07:00
25b539de54 libsysprof: add setup hooks for symbolizers
This gives the symbolizer access to the loader so we can propagate tasks
back to it.
2024-10-10 17:03:30 -07:00
50d556b13e sysprof: add SysprofDocumentTask abstraction
This provides a task abstraction to SysprofDocumentLoader so that we can
elevate information about tasks to the user interface. It also moves the
spinner to a menu button w/ popover to display those tasks.
2024-10-10 17:02:06 -07:00
0c77d61c89 Update Slovenian translation 2024-10-10 16:04:32 +00:00
788b1995b9 libsysprof-capture: add version macros for 48 2024-10-09 21:42:36 -07:00
fcfd8c1d68 sysprof: update to AdwSpinner 2024-10-09 16:39:50 -07:00
1c4c266a05 libsysprof: elf: do not generate fallback names
Fallback names are only used in `SysprofElfSymbolizer` at the
moment, but it also has code to generate fallback symbols.
2024-10-09 16:37:02 -07:00
aef623cf15 libsysprof: elf: do not allow setting self as debug link
That will cause infinite recursion in `sysprof_elf_get_symbol_at_address_internal()`.
Also note that loops are still possible, this change
only prevents one way of creating loops.
2024-10-09 16:37:02 -07:00
e0fdbf65cf Merge branch 'rafaelff-PRIi64' into 'master'
sysprof: Use PRIi64 instead of G_GINT64_FORMAT

See merge request GNOME/sysprof!108
2024-10-09 18:04:39 +00:00
7b7317ead2 sysprof: Use PRIi64 instead of G_GINT64_FORMAT 2024-10-09 17:36:49 +00:00
5707ed0cac sysprof: ignore various libadwaita deprecations
This is our only option for situations where we would have no other top-
level window, so just ignore them for now.
2024-10-02 12:56:12 -07:00
92a1179982 sysprof: fix various GTK deprecations 2024-10-02 12:56:12 -07:00
c0cd6037ba Merge branch 'kill_dbus_monitor' into 'master'
libsysprof: Kill `dbus-monitor` after D-Bus capturing is done

See merge request GNOME/sysprof!106
2024-09-30 00:00:20 +00:00
e939a1dc51 Update Brazilian Portuguese translation 2024-09-29 16:01:29 +00:00
6ab9df35ed libsysprof: Kill dbus-monitor after D-Bus capturing is done
Previously, the `dbus-monitor` process was never terminated.
Unfortunately, tying up some memory is not the worst consequence
of this: after some time file descriptors that are sent on the
bus start to accumulate. This can be especially problematic
when there are unexpected read/write ends of pipes.
2024-09-29 04:13:32 +02:00
c4bee4ebe9 Merge branch 'gbsneto/sysprof-cat' into 'master'
Introduce sysprof-cat

See merge request GNOME/sysprof!104
2024-09-26 21:36:09 +00:00
cc3dc46910 build: bump for development 2024-09-26 14:35:15 -07:00
7c93149315 Introduce sysprof-cat
It's a simple CLI tool that dumps the contents of a Sysprof capture
file in a syntax inspired by GTK's render node syntax.

It prints metadata, the callgraph, marks, and counters. Other fields
may be added as needed, but for now this is sufficient for inspecting
WebKit captures.

There are CLI args for not printing particular groups, so that we can
filter out what we need.
2024-09-26 13:11:55 -03:00
6fb9589f67 Merge branch 'gbsneto/webkit-counters' into 'master'
sysprof: Match "webkit" for counters as well

See merge request GNOME/sysprof!105
2024-09-25 18:58:25 +00:00
ed9bac07d0 sysprof: Match "webkit" for counters as well
WebKit may start introducing counters for page rendering, and it's
great to be able to see them in Sysprof UI :)
2024-09-25 15:37:37 -03:00
e5382d1b8c build: reduce GLib requirement
This is kept lower so that you can build without GTK on older systems.

Related: 530b4a9d12 (note_2223853)
2024-09-16 09:48:27 -07:00
c50e089226 Update Slovak translation 2024-09-14 14:56:17 +00:00
ae9764ccf4 Post-release version bump 2024-09-13 19:28:47 -07:00
5513868c49 Release 47.0 2024-09-13 19:28:13 -07:00
b8781e733c flame-graph: trim off some whispies 2024-09-12 13:07:51 -07:00
4142472984 libsysprof: collapse recursive functions 2024-09-12 12:44:08 -07:00
15844df5b9 callgraph: use bump allocator for callgraph nodes 2024-09-12 10:52:41 -07:00
f446178796 allocator: add 16kb page bump allocator
This is a private allocator that can be used for large groups of
allocations that are tied to a specific object.

For example, the callgraph owning many nodes can use this so all the nodes
are allocated together, but also freed in a single stage ignoring all the
complex GList linked nodes among them.
2024-09-12 10:52:18 -07:00