Commit Graph

46 Commits

Author SHA1 Message Date
d34e277a6a tests: initialize allocated value to 0 2020-02-24 15:27:58 -08:00
f1322de9e6 tests: add median to calculation 2020-02-24 15:15:20 -08:00
a9dcb58ca6 tests: add in-tree testing tool to list allocations within mark
This would be nice to have more generally useful via filters in the
allocations view. But for now, just make something simple work.
2020-02-24 15:11:01 -08:00
1017fed467 tests: add missing locale.h include 2020-02-20 10:59:57 -08:00
4fd2068367 tests: ensure we sort by time after pid/tid 2020-02-18 12:00:08 -08:00
521024d51f tests: add tool to list total/temp/leaked allocations
This is just a quick example of how to find temporary allocations.
2020-02-18 11:56:51 -08:00
69e4fb2588 libsysprof-capture: allow using ring in readwrite mode
This is a first step to be able to use the ring buffer as the backing
buffer for the SysprofCaptureWriter.
2020-02-15 22:50:22 -07:00
e3ed30eb48 libsysprof-capture: remove framing data from MappedRingBuffer
This removes the 8 bytes of framing data from the MappedRingBuffer which
means we can write more data without racing. But also this means that we
can eventually use the mapped ring buffer as our normal buffer for
capture writing (to be done later).
2020-02-15 20:46:05 -07:00
77400c57c1 libsysprof-capture: add mmap()'d ring buffer
This is the start of a ring buffer to coordinate between processes without
the overhead of writing directly to files within the inferior process.
Instead, the parent process can monitor the ring buffer for framing
information and pass that along to the capture writer.
2020-02-13 18:50:20 -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
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
a2f99c7be5 build: set NO_AT_BRIDGE=1 when running automated tests 2019-09-09 17:58:17 -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
066b3011bb tests: add helper to test symbol resolving 2019-08-02 19:39:20 -07:00
aad61d52f3 flatpak: add helpers to locate flatpak installation debug dirs
The goal here is to be able to locate all of the debug directories for
active flatpak runtimes so that we can possibly decode debug libraries
from them (after verifying build-id/CRC).
2019-08-02 18:15:02 -07:00
7e7657dd03 libsysprof: add mountinfo helper
The goal of this helper is to simplify the process of parsing information
about mounts and the mountinfo for per-process maps. We should be able
to change sysprof-proc-source to use this and have better support for
getting the libraries within different mount namespaces.
2019-08-02 12:56:54 -07:00
e8528609ec libsysprof-ui: land new UI design
This comprises a massive rewrite of the UI for browsing captures. We use
the SysprofAid class to scan capture files for content and then auto-
matically add visualizers and details pages.

To avoid breaking things incrementally, we just land this as a very large
commit. Not necessarily ideal, but given the amount of stuff that could
break, this is easier.

As part of this process, we're removing a lot of the surface API so that
we can limit how much we need to maintain in terms of ABI.
2019-06-24 20:52:40 -07:00
f12f9ed3f4 tests: test we got reasonable address translation 2019-06-05 19:33:13 -07:00
228dc58ff2 tests: add simple test for jitmaps 2019-06-05 19:00:32 -07:00
44fa9500dc tests: be more precise in jitmap tests
I want to make sure we have the right values in/out of there.
2019-06-05 17:47:36 -07:00
690bf90a14 build: disable some tests w/o libsysprof 2019-06-03 12:32:13 -07:00
1583ec3f79 libsysprof: fix tag lookups for 0 tags 2019-05-29 15:13:01 -07:00
c013264186 tests: fix various lseek usage 2019-05-29 15:13:01 -07:00
fd949edc29 tests: add decode-only test
Useful to test that we can decode symbols from a capture properly.
2019-05-29 15:13:01 -07:00
6dcf600aaa tests: add test to debug symbol maps 2019-05-29 15:13:01 -07:00
7ffd3e41cf libsysprof: add utility to build symbol maps
These are useful to allow us to append symbol informatio to a capture file
using the existing symbol resolvers.

It can read/write a small format embedded within capture files so that
we can append them from the target machine rather than decoding from the
machine we run Sysprof UI on.
2019-05-29 15:13:01 -07:00
874fb01c25 libsysprof: use embedded kallsyms when possible
This uses the kallysms that has been embedded in the capture file when
that is possible (such as when proc-source appends it).
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
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
567f8a3a0f libsysprof-capture: shorten names by removing Frame 2019-05-29 15:13:01 -07:00
6b412b0af5 tests: check for NULL before strcmp 2019-05-29 15:13:01 -07:00
c368da09de libsysprof-ui: allow restricting remote proxy 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
4f9512db98 tests: update zoom-manager test for recent changes 2019-05-29 15:13:00 -07:00
300461ab5d libsysprof-ui: start on capture view
This widget is going to allow us to remove most of SysprofWindow into a
reusable widget tos hare with Builder.
2019-05-29 15:13:00 -07:00
1bd0107c54 build: fix various includes for older GCC 2019-05-29 15:13:00 -07:00
a6e061f5b1 libsysprof-ui: add inside guards
Like the previous, but for libsysprof-ui.
2019-05-29 15:12:59 -07:00
53c718b708 build: rename all symbols to use sysprof_ as prefix
As we gain in usage, we need to be more careful about using a prefix
that will not collide with other symbols. So version 3 of our ABI will
change to using Sysprof/SYSPROF/sysprof as the various prefixes.

The soname/api version bump will happen later on this branch so that
things are easier to test up until then.
2019-05-29 15:12:59 -07:00
6ba408f073 shared: remove use of libshared
This moves everything into other places and simple includes the
files in the cases that it is necessary. In the future, we can
rewrite sysprofd to use GDBus and add GetProcFile() to allow
for client-side processing of kallsyms.
2019-05-29 15:12:59 -07:00
6b983ab8c1 capture: add task-id (thread-id) to samples
This could let us do some amount of filtering by threads going
forward if we have that data available to us.
2019-05-29 15:12:59 -07:00
63bcfc2b0e build: various build fixes for macOS
This doesn't make profiling useful in any way, but it does get things
to the point where I can actually open a capture file. And it would
be nice if we could progress to the point of loading capture files
(with correct data in-tact) and this helps us move down that path.

To really do that correctly, we should make some of the widgetry
disabled when it isn't useful. We also need to ensure that we add extra
decoding information to capture files during shutdown so that any
platform can read it back. This would also help the situation of
running and reading on separate architectures.
2019-05-29 15:12:59 -07:00
1708ad1b48 tree: start on massive tree refactor
The big thing going on here is that we are going to split up the libraries
a bit better, and remove GObject from the capture library. The libsysprof
library will bring in the capture library statically, so we can export the
symbols we want.

Eventually, we will bump the version to sysprof-3, but not yet.
2019-05-29 15:12:59 -07:00