Commit Graph

1903 Commits

Author SHA1 Message Date
cd2c2c954a libsysprof: extend LD_PRELOAD when pre-existing 2020-02-21 12:40:55 -08:00
9b52e88d3a libsysprof-ui: add label for number of allocations 2020-02-21 12:39:13 -08:00
9bcaaac778 Update Brazilian Portuguese translation 2020-02-20 22:41:28 +00:00
5b88e9c3aa build: check for unw_set_cache_size()
This may not be available on older libunwind versions such as 1.2.
2020-02-20 11:22:56 -08:00
454b192a19 build: relax GLib requirement to 2.56 2020-02-20 11:08:26 -08:00
b0157683ef preload: use #ifdef, not #if ENABLE_LIBUNWIND 2020-02-20 11:08:26 -08:00
348a1ef110 libsysprof: fix use of {0} initializers for older GCC
Older GCC versions complain about this so we might as well squash it.
2020-02-20 11:08:21 -08:00
0cb4bb61ac libsysprof: remove use of GAtomicRCBox
Switching this to use an embedded ref count allows us to backport to
operating systems restricted to GLib 2.56.
2020-02-20 11:03:05 -08:00
f25c573ba6 libsysprof-ui: remove use of GAtomicRCBox
Switching this to use an embedded ref count allows us to backport to
operating systems restricted to GLib 2.56.
2020-02-20 11:02:49 -08:00
d89a689ab4 sysprofd: remove use of GAtomicRCBox
Using an embedded ref count allows us to backport to older operating
systems for which GLib is restricted to 2.56.
2020-02-20 11:01:02 -08:00
1017fed467 tests: add missing locale.h include 2020-02-20 10:59:57 -08:00
59942e6fa6 build: require itstool if installing help files 2020-02-20 10:59:31 -08:00
be6b979714 libsysprof-capture: remove use of GAtomicRCBox
If we backport to an older GLib release, we won't have the newer atomic
helpers available. It's really not too much burden to do that manually if
it means we can run on older systems.
2020-02-20 10:39:33 -08:00
cd8a99402f build: fallback to __sync_synchronize()
If we're running on a GCC older than 4.9, then we won't have the
stdatomic.h available. We can just use a full barrier instead using
__sync_synchronize() to get the same effect, albeit slower.
2020-02-20 10:38:35 -08:00
2cd05c1bd8 libsysprof-capture: fallback to g_time_val_to_iso8601()
To allow us to backport to older systems, we can have a fallback here for
the time being.
2020-02-20 10:36:18 -08:00
c81b886a12 Updated Spanish translation 2020-02-20 12:29:16 +01:00
a62664f8e5 memprof: add allocation instead of self to clipboard 2020-02-19 20:12:02 -08:00
e704ddfb2f Update POTFILES.in 2020-02-19 17:58:13 +01:00
d5a45adcd5 Updated Spanish translation 2020-02-19 11:50:51 +01:00
8e81b1fcf9 libsysprof: add summary information for memprof profile 2020-02-19 00:16:36 -08:00
6b1872a5ce libsysprof-ui: dont change pages if operation was cancelled 2020-02-18 21:03:12 -08:00
dd6b44cb2f libsysprof-ui: move controls above stack 2020-02-18 19:56:30 -08:00
16e35c1fa6 libsysprof-ui: allow switching to temporary allocations 2020-02-18 19:20:38 -08:00
e3cb30e4ee libsysprof: apply selection to temporary allocations 2020-02-18 19:19:01 -08:00
d525f065f4 libsysprof-ui: add API to reload pages
This can be useful when the page is interactive and needs to reload.
2020-02-18 19:17:38 -08:00
059508d582 memprof: fix whitespace 2020-02-18 17:22:32 -08:00
84e2c288dc libsysprof: add support for calculating temporary allocations
This is useful to find allocations free'd right after they were created.

A temporary allocation is currently defined as a free() right after an
allocation of that same memory address. From a quick glance, that appears
to be similar to what I've been seeing in heaptrack all these years.

In the long term, I'd expect we can do something more useful such as
"freed from similar stack trace" since things like g_strdup_printf()
would obviously break important temporary allocations.
2020-02-18 17:18:04 -08:00
87004f5d24 preload: skip an additional stack frame
Now that we do some math here, we need to skip another frame to keep this
more useful and not show everything inside of sysprof_collector_allocate().
2020-02-18 14:11:09 -08:00
0d6a3d0183 libsysprof-capture: fix use of n_addrs 2020-02-18 14:05:26 -08:00
7490a774ab libsysprof-capture: use signed int for backtrace return
This allows us to more safely subtract 1 from the unw_backtrace() to get
the proper number of frames (and detect it in the collector).
2020-02-18 14:03:19 -08:00
9f43bf2813 libsysprof: only add process cmdline info once
We might get this information from multiple sources (such as Linux's perf
or the proc data source). So only add this information once to avoid
having additional data we don't care about.

This also helps ensure we get a proper tree for the callgraph without
splitting things between updated cmdline information.
2020-02-18 13:45:24 -08:00
93acce520f libsysprof: plug leak and do less strdups
Small leak based on the number of PROCESS frames we see. Easy to fix and
easy to not do the g_strdup_printf() at all in those cases.
2020-02-18 13:44:25 -08:00
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