Commit Graph

1871 Commits

Author SHA1 Message Date
fdf912b716 libsysprof-capture: do less work to calculate frame length
These values are already all aligned, so there is no need to realign them.
2020-02-18 13:35:45 -08:00
70bea64f88 libsysprof-capture: allow for backtrace skip optimization
We want to be backtracing directly into the capture buffer, but also need
to skip a small number of frames.

If we call the backtrace before filling in information, we can capture to
the position *before* ev->addrs and then overwrite that data right after.
2020-02-18 13:35:18 -08:00
b6dc058d62 libsysprof: check for time series after extracting processes 2020-02-18 13:17:49 -08:00
20f7c271ca libsysprof-capture: clear SYSPROF_CONTROL_FD 2020-02-18 13:17:33 -08:00
4cfb51421b libsysprof-capture: set tid to pid on non-Linux 2020-02-18 13:17:22 -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
0aff0b1466 Merge branch 'wip/jimmac/intro-icons' into 'master'
icons: provide helper icons

Closes #30

See merge request GNOME/sysprof!22
2020-02-18 17:43:11 +00:00
77a13fe7f9 icons: provide helper icons
Fixes https://gitlab.gnome.org/GNOME/sysprof/issues/30
2020-02-18 12:05:55 +01:00
a37ad780ca preload: use unw_backtrace()
This seems to be significantly faster than doing the manual stepping. A
quick look shows that it has a number of special cases which we'd have
to duplicate, so best to just use it directly.
2020-02-17 12:05:32 -08:00
ebeba62669 preload: setup cache size for libunwind 2020-02-17 12:03:02 -08:00
e06638d665 build: make libunwind optional 2020-02-17 12:02:44 -08:00
ee5c43f107 libsysprof-capture: avoid recursion in TLS cleanup 2020-02-16 20:58:39 -08:00
135b5d2fbf libsysprof-capture: remove unused code 2020-02-16 20:56:12 -08:00
2a457f25ec libsysprof-capture: reduce max stack depth
128 is a bit much and can slow us down considerably with user-space stack
traces. This can mess up the tree a bit, but we can alter how we view
things later on if we need to so that it is easier to read.
2020-02-16 20:49:35 -08:00
63f781eef9 preload: setup per-thread caching
We also need to invalidate caches at some point on dlopen()/dlclose().
2020-02-16 21:02:21 -07:00
ba2f6dfa54 preload: dont track stack for free
Ideally we'll use this later on for temporary allocations, but we can be
time based on that rather than similar stacks.
2020-02-16 21:01:52 -07:00
53a351b66e libsysprof-capture: add clear/reset API for mapped ring buffer 2020-02-16 17:57:06 -07:00
2329a6e25e preload: define UNW_LOCAL_ONLY for libunwind 2020-02-16 16:44:57 -08:00
7ebc850a8b Update Brazilian Portuguese translation 2020-02-16 19:17:56 +00:00
5a966bcd77 Update Polish translation 2020-02-16 13:23:35 +01: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
36860b449e libsysprof-capture: unref GSource after attaching 2020-02-15 22:27:34 -07:00
ca5c66245c libsysprof-capture: ignore some types when extending end_time 2020-02-15 22:17:23 -07:00
ed7c9bbaef libsysprof-capture: fix advancement in drain callback 2020-02-15 22:02:03 -07:00
c74c02a2d9 libsysprof-capture: update ring position while walking
This ensures that the producer can produce as soon as the reader has moved
past that data. Now that the callback has a mutable consumption value, they
can read the whole data in one shot anyway.
2020-02-15 21:55:08 -07:00
c0697c91cc libsysprof-capture: increase rate of buffer read
This ideally should be dynamic in the future to copy out data at a rate
that keeps us around 33% usage rate so that we can still burst if we need
to but keep things empty enough to not loose data.
2020-02-15 21:53:34 -07:00
47768859ad libsysprof-capture: whitespace cleanup 2020-02-15 20:50:05 -07:00
cb1b7d03fb libsysprof-capture: check frame types when peeking 2020-02-15 20:49:47 -07:00
c36420d716 libsysprof-capture: write final frame
This frame type can be used to communicate with the peer over the mapped
ring buffer to denote that writing is finished and it can free any
resources for the mapping.
2020-02-15 20:49:27 -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
e7f2702f88 memprof: simplify memprof source
This doesn't need to be using trace-fd anymore now that we have the
collector API.
2020-02-13 18:58:35 -08:00
04d599c718 preload: port memory collector to collector API
This uses a simplified form of collection without writing to capture
files directly. The data is written into a ring buffer for Sysprof to
pick up and copy into the real destination file. Using the mmap() ring
buffer allows loss of data when Sysprof cannot keep up, but on the other
hand allows the inferior to be fast enough to be useful.
2020-02-13 18:58:03 -08:00
c546d31ad9 libsysprof-capture: add simplified collector API
This is a simplified API for the inferior to use (such as from a
LD_PRELOAD) that will use mmap()'d ring buffer created by Sysprof. Doing
so can reduce the amount of overhead in the inferior enough to make some
workloads useful. For example, collecting memory statistics and backtraces
is now fast enough to be useful.
2020-02-13 18:56:54 -08:00
ec67106a4d libsysprof-capture: add missing platform header 2020-02-13 18:54:42 -08:00
089f5d7c56 control-fd: add SysprofControlSource
This is a source that will allow the inferior to call into Sysprof to
create a new mmap()'d ring buffer to share data. This allows significantly
less overhead in the child process as Sysprof itself will take care of
copying the data out of the inferior into the final capture file. There is
more copying of course, but less intrusive to the inferior itself.
2020-02-13 18:53:58 -08: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
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
6aa6f07465 Updated Spanish translation 2020-02-12 09:01:57 +01: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
75c966e1d2 Updated Spanish translation 2020-02-10 14:50:29 +01:00
1255be2df2 Update Polish translation 2020-02-09 12:27:37 +01:00