Commit Graph

2560 Commits

Author SHA1 Message Date
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
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
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
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
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
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
eca993b42c preload: add static assertion with offsetof() check 2024-09-12 09:26:13 -07:00
c228634fcb libsysprof-capture: handle unwind length < 0 gracefully
Also do the snapshot before setting up frame so that unwinders can do
tricks to use extra space before the addr location.
2024-09-12 09:23:10 -07:00
23299b0746 Set icon for the window 2024-08-29 16:28:43 +02:00
10217bb0e2 libsysprof-capture: fix set_fd_blocking()
It was missing an include for the define and the variable was flat out
wrong when porting.

Fixes: #124
2024-08-22 08:33:45 -07:00
b726f49d15 Turn polkit-agent support into an optional feature.
This simplifies deployment on embedded devices, where polkit is usually
unncessary at runtime, but pulls in quite a few otherwise unncessary
dependencies. Start to improve the situation by allowing to selectively
disable polkit-agent support at compile time, which aids in container
usage scenarios, where one wants to invoke 'sysprof-cli' from within
the container. Bypassing polkit-agent in the container is then desired,
since the host sysprofd will handle asking for permissions to enable
the tracing. It allows for a simpler setup of rootless podman
containers, avoiding UID mismatches, that lead to rejection of the
tracing enablement.

- Add a new 'polkit-agent' meson build feature, that allows to force disabling
  polkit-agent support (-Dpolkit-agent=disabled).

- Mark the 'polkit-agent' feature as enabled, by default, to reflect
  the current status (sysprof-cli did not build without polkit-agent support).

- libsysprof/sysprof-instrument.c: Build fix when polkit is not available,
  remove the unnecessary 'g_autopr(PolkitDetails) details' variable.

- Alter the sysprof-cli dependencies to only attempt to link against
  polkit-agent, if necessary. Modify sysprof-cli.c to wrap all code using
  polkit-agent in HAVE_POLKIT_AGENT blocks.
2024-08-20 20:46:11 +02:00
54295a1466 libsysprof: port GPtrArray sort to gtk_tim_sort() 2024-08-16 12:50:21 -07:00
b06c08c64e sysprof: use gtk_tim_sort() to sort rectangles for bsearch 2024-08-16 12:46:36 -07:00
fbab86314a libsysprof: use gtk_tim_sort() to sort jitmaps 2024-08-16 12:43:13 -07:00
e11e2e3bc8 libsysprof: use gtk_tim_sort() for kernel kallsyms array 2024-08-16 12:41:37 -07:00
9c896e0bb4 libsysprof: use gtk_tim_sort() for packed symbols 2024-08-16 12:39:41 -07:00
dde273e25e libsysprof: correct awkward double values
We still get some really crazy huge numbers from GTK for FPS, likely from
division issues. Just normalize it to zero for now.
2024-08-16 12:37:53 -07:00
cdb011b403 libsysprof: use gtk_tim_sort() for counter value sorting
This is generally faster than g_array_sort() due to all the heuristics
involved, which are likely to hold true for us with counter data.
2024-08-16 12:14:05 -07:00
d67adc598b sysprof: fix upper bound for graphics charts 2024-08-16 12:01:51 -07:00
6d9a8d490b sysprof: add gio/mutter to graphics section 2024-08-16 11:13:07 -07:00
265eeeb12f sysprof: Also render labels for instant marks
This was an oversight from the original commit!

Render labels for instant marks as well. The PangoLayout is shared
between ranged and instant marks, and therefore moved to an earlier
point in the function.
2024-08-15 17:52:01 -03:00
cf7dfbb22d sysprof: use black when not using dark mode
This extremely unclever hack works around the styling issue in light mode
from !98 as mentioned at:

  https://gitlab.gnome.org/GNOME/sysprof/-/merge_requests/98#note_2196955

It just uses black if we're out of rect and not in dark mode.
2024-08-15 13:16:53 -07:00
32690091ef sysprof-cli: set GJS_ENABLE_PROFILER 2024-08-14 14:40:39 -07:00
836edc0c87 libsysprof: fix tracefd string for child process 2024-08-14 14:36:25 -07:00
1a19aba570 sysprof: use AdwAboutDialog 2024-08-14 13:55:11 -07:00
ec2b207191 Merge branch 'gbsneto/mark-name-in-waterfall' into 'master'
sysprof: show mark name in waterfall marks

See merge request GNOME/sysprof!98
2024-08-07 20:34:55 +00:00
444b4fff75 sysprof: Adjust font size slightly
Makes the Waterfall view look better.
2024-08-07 14:05:59 -03:00
43dd3f5062 sysprof: Render label outside rect if it doesn't fit
This allows reading the mark name even when it is too small to fit any
text.
2024-08-07 14:05:59 -03:00
aa15d5f49f sysprof: Don't initialize GValue before evaluation
GtkExpression infrastructure already initializes the GValue.

Fixes a warning introduced by the previous commit.
2024-08-07 11:32:29 -03:00
7cd51d1502 sysprof: show mark name in waterfall marks
This makes is much easier to inspect waterfall marks, since we can spot
at a glance which marks are there, without having to hover each mark
individually with the cursor to see the tooltip.

This helps WebKit profiling in particular, which is a heavy user of
marks.
2024-08-07 11:18:03 -03:00
fd67844d8b sysprof: put recording pad contents in a window handle
So that it can be dragged around easier by users.
2024-08-06 14:14:30 -07:00
a4c92033a2 sysprof: fix color array initialization 2024-07-26 23:05:24 +05:30
7435423c00 Merge branch 'coverity-fixes' into 'master'
fix coverity warnings

See merge request GNOME/sysprof!96
2024-07-26 13:48:34 +00:00
b08c19935f Merge branch 'ellipsis-symbol-window' into 'master'
window: Use ellipsis symbol

Closes #115

See merge request GNOME/sysprof!90
2024-07-26 13:47:28 +00:00
bfe55f46b2 libsysprof: fix size to copy 2024-07-26 16:58:21 +05:30
7780f3c786 sysprof: remove redundant NULL check 2024-07-26 15:52:33 +05:30
530b4a9d12 build: bump version requirements 2024-06-24 12:01:48 -07:00
339dc8f30e processes-section: Disable autocolor for timespan layers
There's only one in each row and they end up blue.
2024-06-24 02:10:27 +04:00
cb3171d7bb chart-layer: Redraw on css changes
Make sure we redraw it when system accent color changes.
2024-06-24 01:53:28 +04:00
3597106de8 style: Port to newer css machinery 2024-06-24 01:51:28 +04:00
618c4ac575 progress-cell: Simplify styles 2024-06-24 01:41:30 +04:00
3c655a6f3e libsysprof: add missing header for close function
This was detected by compiling against musl-libc
2024-03-18 22:18:52 +01:00
462343cd0f sysprof: add missing summary icon
We no longer get this from the icon theme.

Fixes #117
2024-03-15 13:53:40 -07:00
fb18cb4277 Merge branch 'initiative-51' into 'master'
Fix links

See merge request GNOME/sysprof!91
2024-03-15 20:10:18 +00:00
a15595026d Fix links 2024-03-15 19:58:59 +01:00