Commit Graph

788 Commits

Author SHA1 Message Date
aca1a6a765 libsysprof-ui: check for valid frame type before incrementing 2020-02-13 14:32:34 -08:00
a8c6038679 libsysprof-capture: fix version value for 3.36 2020-02-13 14:32:34 -08:00
86dcedfba0 libsysprof-capture: add sysprof_getpagesize()
This is a helper to get the page size on various platforms so that calling
code does not need to duplicate that effort.
2020-02-13 14:32:34 -08:00
19e077736b libsysprof-capture: use sysconf() instead of getpagesize() 2020-02-13 14:32:34 -08:00
6cb55f4d71 libsysprof-capture: add raw frame helper
This helps when shuffling data between sources so that you can simply
memcpy() into the destination buffer.
2020-02-13 14:32:34 -08:00
1d44282edb libsysprof-capture: add define for last frame type 2020-02-13 14:32:34 -08:00
3e7acd5663 libsysprof: protect against bad reads 2020-02-13 14:32:34 -08:00
3f07cf2748 libsysprof: decode allocation frames into symbol map
This ensures that we have proper symbols when opening a file with
allcoation frames.
2020-02-11 18:40:29 -08:00
c39cf46776 tools: perform cleanup/supplementals when stopping profiler 2020-02-11 18:39:20 -08:00
b351e1a50a capture: add comment about frame tracking 2020-02-11 18:07:31 -08:00
33c81a3a9c memprof: add memory profiling using LD_PRELOAD
This brings over some of the techniques from the old memprof design.
Sysprof and memprof shared a lot of code, so it is pretty natural to
bring back the same callgraph view based on memory allocations.

This reuses the StackStash just like it did in memprof. While it
would be nice to reuse some existing tools out there, the fit of
memprof with sysprof is so naturally aligned, it's not really a
big deal to bring back the LD_PRELOAD. The value really comes
from seeing all this stuff together instead of multiple apps.

There are plenty of things we can implement on top of this that
we are not doing yet such as temporary allocations, cross-thread
frees, graphing the heap, and graphing differences between the
heap at to points in time. I'd like all of these things, given
enough time to make them useful.

This is still a bit slow though due to the global lock we take
to access the writer. To improve the speed here we need to get
rid of that lock and head towards a design that allows a thread
to request a new writer from Sysprof and save it in TLS (to be
destroyed when the thread exits).
2020-02-07 19:00:33 -08:00
cae70498da callgraph: fix whitespace 2020-02-07 16:54:43 -08:00
9689b8c9c6 selection: whitespace cleanup 2020-02-07 16:54:23 -08:00
31d83a12b9 elf: short-circuit symbol resolving 2020-02-07 16:54:18 -08:00
4c5fec742f jitmap: whitespace cleanup 2020-02-07 16:54:12 -08:00
2e72e6af84 capture: fix format type for address on macOS 2020-02-07 11:00:09 -08:00
47c09cb241 build: add version macros for 3.36 2020-01-31 09:13:50 -08:00
981873af75 cli: add --merge command line option
This allows the caller to merge multiple syscap files into one such as:

  sysprof-cli --merge a.syscap b.syscap > c.syscap

Fixes #26
2020-01-29 08:17:36 -08:00
0b4defe135 binfile: fix path check 2020-01-24 12:54:51 -08:00
9a3a95a5ca podman: add debug directories from podman containers
This is meant to allow us to find the debug files for a given library for
podman containers running as the current user. However, we still need to
try to translate the fuse-overlayfs paths when parsing the /proc/pid/mounts
or we'll have incorrect paths coming from the event stream.
2020-01-24 10:54:32 -08:00
d176efe91c lookaside: cleanup whitespace 2020-01-24 10:51:36 -08:00
bae10987f0 libsysprof-ui: fix timing information for marks tooltips 2020-01-24 09:29:34 -08:00
94b0ecb758 display: provide recording time for display titles 2020-01-23 12:46:44 -08:00
460df56fa5 visualizers: clear selected row when showing details
The details don't correspond to any selected row, so clear the row when
we switch to the details page.
2020-01-23 12:36:04 -08:00
bcfaa6caa8 perf: use task-ids instead of pids
The pids might overlap, which isn't that useful for us when we are creating
threads. Instead use the task-ids (which should basically overlap anyway).
2020-01-23 12:26:18 -08:00
731b6dd379 sysprof: allow passing program path to sysprof
If the path provided to us is an executable program (instead of a syscap
file) then we can setup the path as the binary to execute in the profiler
assistant and save the user a couple clicks.
2020-01-23 11:59:50 -08:00
599ecaebe1 display: remove unused variable 2020-01-23 11:59:50 -08:00
7dad1f2ab4 marks: add end time to mark details 2020-01-22 12:01:26 -08:00
812b0d60a0 counters: use counter description in menu item 2020-01-21 21:06:41 -08:00
db160cf536 ui: avoid concurrent reloads of stack depths
This ensures that we only have one thread doing reloads of stack frame
depths at a time. While we only ref the reader in the state, it should
still be fine because cursors *always* make a copy of the reader for their
internal use. I don't think this should fix #23, but it may reduce the
chances of it happening.

It's unclear to me what could cause #23 to happen, unless for some reason
multiple threads were sharing the reader's internal buffer causing the
frame-> dereferences to be junk. But as stated with reader copies, that
should not be able to happen.

Another possible avenue is that the task is cancelled and for some reason
the task is clearing the task data while the thread is running. Again,
that is not supposed to be possible given the design of GTask as it
should not release task data until finalized.
2020-01-08 11:13:24 -08:00
bd2da8baa0 ui: use g_atomic_rc_box
This changes a couple of our structures to use the atomic rc box instead
of gslice directly. It shouldn't affect anything, just some general
modernization while looking at #23
2020-01-08 11:00:54 -08:00
c4eaa53f20 libsysprof: handle bus/proxy failure gracefully 2020-01-02 10:31:12 -08:00
8a86d5f1a0 test: Fix detection of pagesize at runtime
Not all architectures have a page size of 4k, detect it at runtime

Fix: https://gitlab.gnome.org/GNOME/sysprof/issues/21
2020-01-02 12:44:27 +01:00
994b0535ef Fix endianness detection when writing a frame
Properly detect endianness at compilation time

This fixes the tests on big-endian machines

Fix: https://gitlab.gnome.org/GNOME/sysprof/issues/7
2020-01-02 12:44:15 +01:00
a67701848d details-page: Protect against NULL line
On a Raspberry PI 4, Sysprof crashes immediately when
trying to memchr() on the 'line' variable. The current
RPI4 support is poor on Linux mainline admitedly, but
having Sysprof to work on it at least gives us a chance
to profile the major bottlenecks.

Protect against NULL 'line'.
2019-12-30 14:03:15 -03:00
b56cd73308 fix typo
Fixes #20
2019-12-12 12:39:28 -08:00
653ff6ba9e build: add datadir to pkgconfig files
Mutter wants sysprof's exact dbus interface directory during build time
* https://gitlab.gnome.org/GNOME/mutter/blob/master/src/meson.build#L714

On certain platforms mutter's datadir != sysprof's datadir.
This is initial work for a forthcoming PR to do
```
sysprof_dep.get_pkgconfig_variable('datadir')
```
in mutter for compatibility with these platforms.

This patch is on behalf of nixpkgs where we actually have to carry a 
downstream patch [0] for this exact reason. We install everything into 
their own immutable prefix under `/nix/store`.

[0]: a821167046/pkgs/desktops/gnome-3/core/mutter/0001-build-use-get_pkgconfig_variable-for-sysprof-dbusdir.patch
2019-12-04 17:17:58 -05:00
6584fcd286 Fix org.gtk.GDBus.C.UnixFD annotations
The annotation applies to the method as a whole, not to individual
arguments, so the existing annotations don't have any effect.

This was hidden by gdbus-codegen's automatic handling of arguments
of type 'h', but that change was reverted, resulting in a broken
build.
2019-10-31 17:10:48 +01:00
b624ec8809 build: track changes to GLib and gdbus-codegen
GLib is already doing this, which broke a number of auto-generated code.
This tracks those changes and manually sets the annotations so that we
are guaranteed to get this behavior.

We'll need to fix other uses (such as in Mutter), but we have to do that
already because of the change in GLib.

Fixes #17
2019-10-30 14:46:20 -07:00
73dc39329a libsysprof-ui: avoid use of environ for -Werror=shadow
Fixes #18
2019-10-21 11:35:42 -07:00
189505be64 build: only install some files when option is enabled
Fixes #16
2019-10-15 14:49:57 -07:00
1d445c4fad sysprof-ui: add missing filtering of processes
The search implementation here is pretty barebones, but at least it gets
things working again after the fallout from the redesign.

Fixes #15
2019-10-07 12:57:50 -07:00
a2f99c7be5 build: set NO_AT_BRIDGE=1 when running automated tests 2019-09-09 17:58:17 -07:00
753a698563 tools: add --rapl to sysprof-cli command
This allows recording energy statistics using turbostat if supported by
the host system.
2019-08-08 16:12:26 -07:00
0716e23fb4 libsysprof-capture: use GDateTime instead of GTimeVal 2019-08-08 16:08:00 -07:00
201a2f2162 tests: add jitmap symbol resolver 2019-08-03 15:44:57 -07:00
5d26daf009 tests: fix 32-bit build for %lx usage 2019-08-03 15:44:48 -07:00
1c90e3da80 libsysprof: remove symbol-dirs
This is automatically done for the cases we care about, so this can be
removed now (in favor of tuning the elf symbol resolver manually).
2019-08-03 01:03:59 -07:00
3b17e65a39 libsysprof: attach symbol directories to ELF resolver
The goal here is to drop the sysprof-symbol-dirs.[ch] altogether in
favor of modifying the resolver directories on the particular resolver
directly.
2019-08-02 19:41:26 -07:00
3b7a253c57 flatpak: add symbol dirs on host 2019-08-02 19:39:28 -07:00