Commit Graph

2039 Commits

Author SHA1 Message Date
a47627e5b9 libsysprof-analyze: use swap helpers to decode 2023-04-25 17:09:38 -07:00
97c93ea965 libsysprof-analyze: track frame length
That way we don't have to decode this too in the subclasses.
2023-04-25 17:09:04 -07:00
62863f08c3 libsysprof-analyze: add various bswap and cast helpers 2023-04-25 17:08:13 -07:00
e9d5cb733d libsysprof-analyze: move to internal types for documents
We want to have an object hierarchy, but we don't want to expose our class
or other internal details to the public API/ABI. This uses the old form of
class definition so we can maintain that.

An alternative would be to do what GDK does for internal types, should we
find that easier to maintain going forward.
2023-04-25 16:19:54 -07:00
a5dafa5409 libsysprof-analyze: rename some private API
prefix with _, use frame type directly, use needs_swap rather than
is_native so it's more clear to readers.
2023-04-25 16:11:59 -07:00
a3cf041326 libsysprof-analyze: print some basic frame information 2023-04-25 16:04:35 -07:00
69930dc876 libsysprof-analyze: read property access to frame header
Also handle swapping the data when non-native endian so that we can leave
our GMappedFile unperturbed (and therefore not have to keep those bytes as
dirty pages in process).
2023-04-25 15:55:41 -07:00
31003c519c libsysprof-analyze: rename to SysprofDocumentFrame
We will eventually be adding sub-types for the various frame types, and
use this as a common ancestor for item inflation.
2023-04-25 15:32:55 -07:00
ed01673a5e libsysprof-analyzer: rename model to SysprofDocument
This will provide better namespacing for the objects inflated from the
document for various frame types. By creating real objects with real
properties we give ourselves quite a bit of flexibility in the data
filtering language coming forth.
2023-04-25 15:26:06 -07:00
efab045006 libsysprof-analyze: start on sysprof-analyze library
The goal here is to break up libsysprof into a library for recording
profiles (using libsysprof-capture) and a library for analyzing profiles
(both used by the sysprof UI).
2023-04-25 11:57:26 -07:00
dcbeb0f87a libsysprof: add SysprofCaptureModel
This adds a GListModel that we can use to load capture files. The goal here
is to map the entire capture into memory so we can avoid reading lots of
buffers. That also allows for the model items to live as long as the model
is alive (or underlying file map, really).

The next goal is to stack features on top of this such as implementing the
callgraph as a filter of the model, or generic filters between the
callgraph model and the actual data source model.
2023-04-24 17:26:45 -07:00
cc7e2820f3 build: bump version for development
This will also attempt to get us on the more modern GNOME versioning
train, hopefully to phase out micro numbers eventually.
2023-04-24 17:26:45 -07:00
b91fd26dbf general: Remove "visible=true" properties
Widgets are shown by default in GTK4, so using
"visible=true" is no longer necessary.
2023-03-06 11:31:44 -03:00
8230ef951b window: Fix icon of the Main Menu button
Embedding a GtkImage inside the Main Menu button is
no longer necessary. Using the icon_name property already
does the trick.
2023-03-06 11:22:30 -03:00
c45c35b65d window: Allow opening Main Menu with F10
By setting the Main Menu button as primary,
the F10 key is automatically assigned to this button.
2023-03-04 05:12:21 -03:00
70bf448e63 window: Add tooltip to the Main Menu button 2023-03-04 05:11:52 -03:00
49c57c4a6f visualizer-group: Fix insert()
sysprof_visualizer_group_insert() would insert widgets intended for
position 0 at position 1 instead. This caused a bug in the marks section
where the "Timings" row, which is supposed to be at the top, would
instead be at position 1. Because the menu buttons are in the top row,
disabling a row through the menu could cause the menu buttons to
disappear.
2023-02-21 17:21:28 -06:00
5c06845e86 tools: add helper to rewrite a PID
This is mostly useful when troubleshooting PIDs in container namespaces
that don't match the host.
2023-02-20 21:04:21 -08:00
d0e63f8573 tools: symbolize callstacks with dump
This can be useful so we don't have to use other tools to try to figure
out what is already right in there.
2023-02-20 20:08:45 -08:00
d7d073505c sysprof-dump: print allocation call stacks 2023-02-20 19:46:22 -08:00
ca3b4844b0 application: Mark 4 strings translatable 2023-02-13 19:51:45 +00:00
d2af3d72ac chore: fix typo in comment: psuedo -> pseudo 2023-02-11 20:24:47 +01:00
7c378668e1 libsysprof: update radix tree sources 2023-01-26 11:03:39 -08:00
1e1a719895 Revert "libsysprof: Avoid a use-after-free in raxRemove"
This reverts commit bb83598b12.

See !63 and #84
2023-01-26 10:59:22 -08:00
c65dc2fa4d libsysprof-ui: Avoid to rely on g_object_set_data to associate header and group
Actually add a construct-only property on SysprofVisualizerGroupHeader
2023-01-18 22:12:52 +01:00
bb83598b12 libsysprof: Avoid a use-after-free in raxRemove
As we are freeing the child, make sure to set it to NULL so that we are not
trying to remove it again.
2023-01-18 17:26:20 +01:00
2df6bd6fe0 Merge branch 'tintou/mark-details-treeview' into 'master'
display: Use gatomicrefcount to track the active tasks

See merge request GNOME/sysprof!56
2023-01-17 19:28:22 +00:00
5695a3afd5 display: Use gatomicrefcount to track the active tasks
Without this we can have some racing and release the GTask without returning
a value.
2023-01-17 15:17:39 +01:00
8967b2db33 details-page: Use a GtkColumnView instead of a GtkTreeView
Remove the use of the now deprecated GtkTreeView and allow the colums to be sorted.
2023-01-17 15:16:56 +01:00
ee71fb58b1 Fix LD_PRELOAD syntax
From ld.so(8): The items of the list can be separated
by spaces or colons...
2023-01-15 15:01:21 -05:00
6d50f3ca7b meson: Override dependencies to improve usage as a subproject
With this change, sysprof can be consumed as a subproject without
making any changes to the build files of a project. All you need to do
is provide a wrap file with a `[provide]` section:

https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section

This is also necessary because otherwise projects need to hard-code
the subproject name, which might be `sysprof` when using `wrap-git` or
`sysprof-3.46.0` when using `wrap-file` (to build from a release
tarball). This can cause conflicts between different subprojects that
consume sysprof differently.

Other projects like glib, cairo, pango, etc already do this.
2022-12-18 10:04:00 +05:30
8d3838d3aa help-overlay: Some shortcuts improvements 2022-12-09 23:19:42 +00:00
6212396483 libsysprof: Actually set spawnable flags to inherit stdin
The code calculated flags but never actually set them on the spawnable,
so the `inherit-stdin` property did not work.

Fixes: 8799d2f0ca
See: https://gitlab.gnome.org/GNOME/sysprof/-/issues/76#note_1531919
2022-10-07 17:55:09 +00:00
ceab63f694 sysprof-agent: improve messaging a bit 2022-09-21 17:18:29 -07:00
1ef9fc1e30 elf: handle NULL lookaside
This code uses the hashtable directly to avoid the overhead of calling
the path which creates ProcessInfo entries. So we need to also handle
the chance the lookaside is NULL.
2022-09-05 20:51:58 -07:00
c03c964ec2 agent: add --decode command line option
This requests that symbols are decoded at the end of the capture.
2022-09-04 00:22:39 -07:00
749dfbd57e tools: make sysprof-cli statically linked
We don't need to dynamically link against libsysprof for sysprof-cli as
we can do the same thing that sysprof-agent does. In fact, we can probably
even make sysprof-cli wrap sysprof-agent in the future (or be the same
binary that looks at it's argv[0]).
2022-08-17 15:07:47 -07:00
475e513b7f tools/sysprof-cli: cleanup header includes
Fixes double inclusion of <signal.h> as well.
2022-08-01 10:15:56 -07:00
1a8a9adc97 tools/sysprof-agent: handle SIGINT like we do for sysprof-cli
This just forces the profiler to exit, but lets subsequent ^C usage to
actually exit the program.
2022-08-01 10:15:36 -07:00
2f325fbf54 tools/sysprof-agent: set cwd to . unless --directory specified 2022-08-01 10:04:59 -07:00
51e9123f6f libsysprof/preload: add example for tracing with -finstrument-functions
If we have tooling that can toggle -finstrument-functions, Builder for
example, then we'd be able to use an LD_PRELOAD to inject the various
function callbacks to record samples.

I dont think we want to use the sample frame type for this though. We
really want something focused on tracing instead and visualize it a bit
differently than the stack trace visualizer.
2022-07-25 23:37:34 -07:00
7ca2fef8ff libsysprof: cleanup backtrace helper types 2022-07-25 23:37:34 -07:00
3d02ea81fa libsysprof-ui: remove EggThreeGrid from build 2022-07-22 14:50:14 -07:00
1a628d6469 libsysprof-ui: move memprof button box to bottom
This is just too hit-target dense at the top, so try to get it out of
the way a bit.
2022-07-22 14:49:40 -07:00
131953150c libsysprof-ui: add spacing around toggle buttons 2022-07-22 14:48:20 -07:00
cd4a22ed4b libsysprof-ui: use AdwPreferencesPage for memprof page 2022-07-22 14:46:59 -07:00
3e2a704231 libsysprof-ui: remove use of EggTreeGrid in details page 2022-07-22 14:32:24 -07:00
950f746150 sysprof: port to GBindingGroup
We aren't using any of the special getter API here, so we can just drop
our use of the EggBindingGroup and use the upstream'd version.
2022-07-22 14:06:46 -07:00
9e2743fa76 build: gate capture pkgconfig by install-static 2022-07-22 13:45:55 -07:00
099330db90 build: allow disabling installation of static libraries 2022-07-22 13:43:54 -07:00