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
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
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
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
0716e23fb4
libsysprof-capture: use GDateTime instead of GTimeVal
2019-08-08 16:08:00 -07:00
fc013fe99f
libsysprof-capture: reset reader before catting into dest
2019-07-31 13:07:41 -07:00
c2728b8ada
cleanup: remove duplicated NSEC_PER_SEC macros
...
This switches everything to using a single 64-bit constant for NSEC_PER_SEC
that ensure we're doing 64-bit math everywhere.
2019-07-18 10:22:46 -07:00
1b36f92f73
libsysprof-capture: only short-circuit for address translation
2019-06-06 17:49:44 -07:00
db33d910bb
libsysprof-capture: allow NULL only when n_counters == 0
2019-06-06 17:15:10 -07:00
8f18572499
libsysprof-capture: translate jitmaps before samples
...
So we have valid addresses to translate, we need to translate the jitmap
before we translate samples. Otherwise we likely won't have anything to
translate.
2019-06-05 19:32:42 -07:00
44772d243e
libsysprof-capture: fix comparison of translation item
2019-06-05 19:30:15 -07:00
97ec24ab42
libsysprof-capture: add flush_delay for auto flushing
...
This can be useful in scenarios where you need to kill the application
using a signal so that data is not lost in the buffer.
2019-06-05 15:12:17 -07:00
0f85e10368
style cleanup
2019-06-05 15:11:24 -07:00
400e5b81bc
libsysprof-capture: be more defensive
2019-06-05 15:11:04 -07:00
26c029b7a2
libsysprof-capture: short-circuit empty write
2019-06-05 15:10:48 -07:00
ec7fa297e7
whitespace cleanup
2019-06-05 13:25:29 -07:00
532972beb6
libsysprof-capture: relicense as BSD-2-Clause-Patent
...
This allows embedding the static capture library without having to deal
with license incompatibility while retaining the patent clause. We want
as many consumers of the format as makes sense without the restriction
of what kind of app/library/tooling they are.
The application, sysprofd, libsysprof, and libsysprof-ui continue to be
GPLv3+.
2019-06-05 13:25:21 -07:00
c3915a72f2
build: always install capture headers
2019-06-03 12:52:35 -07:00
3179658daa
build: check ftruncate result
2019-06-03 12:41:48 -07:00
7df9221f8b
tools: check result of write
...
and also use the platform helpers
2019-06-03 12:40:48 -07:00
dbb6b9143f
examples: add example app for marks
2019-06-03 11:39:56 -07:00
4cfbb9a857
libsysprof: add file frame with path condition
2019-05-29 15:13:01 -07:00
7743a047b6
libsysprof-capture: add sysprof_capture_reader_find_file()
2019-05-29 15:13:01 -07:00
ffda366809
libsysprof-capture: add byte-order helper
...
This isn't needed for reading captures, but can be helpful when dealing
with embedded data such as file frames.
2019-05-29 15:13:01 -07:00
9410238d30
libsysprof-capture: skip frame when necessary
2019-05-29 15:13:01 -07:00
596d29496d
libsysprof-capture: add file reader helper
2019-05-29 15:13:01 -07:00
336dae4d1f
libsysprof-capture: add helper to list files in capture
2019-05-29 15:13:01 -07:00
7650d6e7c6
libsysprof-capture: add file chunk frame type
2019-05-29 15:13:01 -07:00
cc415c9140
libsysprof-capture: add log frame type
...
This is useful to interleave logs with the capture so that we can have
correlation without interjecting them into mark fields.
2019-05-29 15:13:01 -07:00
26bcf94888
whitespace
2019-05-29 15:13:01 -07:00
19f4a6ae70
libsysprof-capture: add writer buffer size helper
...
This could be useful to know what you can actually shove into the capture
file based on size.
2019-05-29 15:13:01 -07:00
4067b5e592
libsysprof-capture: improve zero'ing when reading back
2019-05-29 15:13:01 -07:00
567f8a3a0f
libsysprof-capture: shorten names by removing Frame
2019-05-29 15:13:01 -07:00
97bae7d9e3
libsysprof-capture: add cat helper
2019-05-29 15:13:01 -07:00
931849b25c
build: add missing libraries to pkgconfig files
2019-05-29 15:13:01 -07:00
68cd3a8178
libsysprof-ui: fix documentation
2019-05-29 15:13:00 -07:00
db9aea95ea
libsysprof-capture: add metadata frame type
...
This will allow sources and aids to discover information about what was
done between capture loading and saving.
2019-05-29 15:13:00 -07:00
395c801476
libsysprof-capture: save filename if first save
2019-05-29 15:13:00 -07:00
8feeec782f
libsysprof-capture: discover the end time if necessary
...
If we get a capture file without a valid end-time, we should just go
discover that up-front instead of dealing with it all over the place.
2019-05-29 15:13:00 -07:00
0c62fd13d4
libsysprof-capture: copy stat when dup'ing reader
2019-05-29 15:13:00 -07:00
aed80ea51f
libsysprof-capture: add stats to reader when possible
...
We can also back-fill these when reading a capture file.
2019-05-29 15:13:00 -07:00
2e4b17be17
libsysprof-capture: add or condition
2019-05-29 15:13:00 -07:00
6731b1552b
libsysprof-capture: whitespace cleanup
2019-05-29 15:13:00 -07:00
74ea7d197c
libsysprof-capture: copy discovered end_time
2019-05-29 15:13:00 -07:00
2498b4cded
libsysprof-capture: try harder to get proper end-time
2019-05-29 15:13:00 -07:00
7a0132ac92
libsysprof-capture: update end time for marks
2019-05-29 15:13:00 -07:00
8145f991e5
libsysprof-capture: whitespace cleanup
2019-05-29 15:13:00 -07:00
8f36c16a91
libsysprof-capture: whitespace cleanup
2019-05-29 15:13:00 -07:00