Commit Graph

222 Commits

Author SHA1 Message Date
0219ee5205 capture-cursor: specify const for condition
We don't modify this, so it can be const.
2018-02-13 17:18:28 -08:00
951213ddb6 capture-reader: cleanup some space checks
Add a few more assertions to make sure we have what we think we have. Also
we can drop self->pos from our while loop checks as it will always be zero.
2018-02-13 17:10:02 -08:00
0ec2c127ea capture-reader: fix byte swap of frame info
If we are swapping between endianness, we were miss swapping various fields
and they'd all end up with the swapped len value.
2018-02-13 16:34:41 -08:00
0ddab3db6e callgraph: add information about expectations 2018-01-29 02:11:03 -08:00
3b3252e050 kernel-symbol: delay symbol filtering until lookup
We don't want to avoid adding the symbols to the index table, or we will
get the wrong addresses.

So instead, add them, and then ignore the symbols upon lookup.
2018-01-29 02:09:31 -08:00
8a47f72749 callgraph: use last valid context 2018-01-29 01:38:35 -08:00
c05d5a5d66 callgraph: code style cleanup 2018-01-29 01:38:35 -08:00
2f6b01781f elf: ignore address context that is not user
We should be betting a context change as part of the stack, so ignore it
if we didn't get a user context.
2018-01-29 01:38:35 -08:00
deecb04963 kernel-symbol: code style cleanup 2018-01-29 01:38:35 -08:00
1bc52902eb kernel-symbols: avoid symbols not in text (code) section
Those are defind as t or T type.
2018-01-29 01:38:35 -08:00
8fb46f3e7f kernel-symbol: fix result parsing from sysprofd
We need to add an additional () around our result type from sysprofd.
2018-01-29 01:38:35 -08:00
911d51d447 kallsyms: make SpKallsyms more testable
This allows us to pass in the file to read from, and adds a quick test
case to view the parsed output. It also fixes a base-10 vs base-16
mistake in parsing addresses.
2018-01-29 01:38:35 -08:00
acab78da72 callgraph: use sp_symbol_resolver_resolve_with_context()
We want to ensure that we give the resolve the address context so that it
can filter whether or not the address range applies.
2018-01-28 22:16:59 -08:00
bb78a1c165 elf: only resolve addresses in none/user address context
This ensures that we only try to resolve addresses for ELFs when we know
we're inside of the userspace address context.
2018-01-28 22:14:32 -08:00
aa0506e26f symbol-resolver: check for kernel address context
We only want to resolve a symbol if we're inside the kernel context.
Otherwise, it wont be accurate.
2018-01-28 22:13:49 -08:00
df07f6d915 resolver: extend interface to include address context
We might need access to the address context when resolving symbols so that
we know if the address range applies to us.
2018-01-28 22:12:27 -08:00
128aa18a00 lib: query /proc/kallsyms and/or daemon for symbols
If we have a system where we can read kallsyms without elevated
privilledges do that. Otherwise, query the sysprod daemon to get the
available kernel symbols.
2018-01-28 21:34:44 -08:00
cf756c65aa kernel-symbol-resolver: code style cleanup 2018-01-28 21:26:47 -08:00
26343e3d2a kallsyms: add API to extract kallsyms with strtok_r()
This will allow us to simplify some code, and provide an API in both
the lib and daemon to get symbols while sharing code.
2018-01-28 21:26:17 -08:00
0e8b51c6ab kernel: only try to load kernel symbol map once
If we fail, log a message to the console and bail. This seems to happen
with recent kernel changes.
2018-01-27 01:10:00 -08:00
469d54df5b build: add libsysprof-capture-2 static library
This allows external tooling to write capture files that Sysprof can open.
Ideally, this will get used by GJS in the near future to implement profiler
output for Sysprof.
2018-01-20 01:30:39 -08:00
6fa95dfb6f lgpl: relicense some useful files as LGPLv2.1+ 2018-01-20 01:26:17 -08:00
1e0f505d7c model-filter: simplify model filter implementation
We've had a number of errors reported from our previous
model filter implementation. This simplifies the impliementation
using a simple cross-reference structure with GSequenceIter in
both sequences.

We try extra hard to not emit signals when doing invalidation.
2017-11-24 22:02:06 -08:00
a2c1e92b79 process-model-row: escape for markup
We need to ensure this gets escaped since we cannot really trust
what comes from /proc.
2017-11-24 22:00:53 -08:00
bcb43d39bb profiler-menu-button: simplify filtering code
Instead of fetching the text from the filter func, we can just
reset the filter func with custom data.
2017-11-24 22:00:20 -08:00
b142d79bdc util: clear field when destroying
Just to be a bit more defensive.
2017-11-24 00:35:42 -08:00
b78293657d util: add synchronous form to reload model 2017-11-24 00:35:14 -08:00
00b6892a72 build: fix header installation paths 2017-09-28 17:45:07 -07:00
190faa818d build: use subdir meson.build files
This keeps the build file closer to the sources it effects.
2017-09-28 16:57:00 -07:00
c47822b26e source tree cleanup
The lib/ directory was getting a bit out of hand, so this tries
to organize things a bit so it is easier going forward to locate
the code people want to patch.
2017-09-28 16:23:03 -07:00
a71f05b885 line-visualizer: lower task priority
Keep task priorities lower than the Gtk main loop.
2017-09-28 13:25:22 -07:00
cad87dee49 line-visualizer: teach draw code how to fill in lines
We don't expose this via API yet, but it's handy to have it here so we can
build upon it for doing stacked drawings (as useful for things like memory
usage graphs by type).
2017-09-28 13:24:58 -07:00
3e5a2af1b4 build: remove autotools build system
Now that we are post-3.26, we are removing the legacy autotools
build system in favor of meson.

Please report any errors you have so that we can ensure this is
ready for GNOME 3.28.
2017-09-15 17:44:50 -07:00
19ca2e4ecc alignment: fix armel/armhf/mipsel build failure
This commit extends commit faf1e24edf
"zoom-manager: bring back attribute aligned(8)"
to both places where the attribute was previously dropped from
in commit 63579451b5 "alignment: set alignment on structs".

3.22.3 + commit 6a3d7282ec + commit faf1e24edf + this patch
has been successfully build tested on Debian armhf porterbox
(harris.debian.org). (It also means we end up with exactly
the same as the 3.22.2 + patch situation currently shipped
in Debian 'stretch' 9.0 regarding alignment/cast fixes.)

https://bugzilla.gnome.org/show_bug.cgi?id=784466
2017-07-04 18:15:06 +02:00
4cb42d2f23 callgraph: fix potential divide-by-zero 2017-06-09 21:47:58 -07:00
6dc5472deb meson-build: Remove old workaround breaking build 2017-06-09 19:10:27 -04:00
faf1e24edf zoom-manager: bring back attribute aligned(8)
This was needed for some other architectures, even though it is problematic
that we have to do it (it should really be the default for the parent
GObject struct).
2017-03-02 15:51:52 -08:00
1e31e7ce31 elf: remove newroot check
We don't need this anymore, as the proc source should translate the paths
for us so we get appropriate maps.
2017-02-26 17:06:28 -08:00
5a3ebeaa6f proc: translate paths found in alternate mount namespaces
If we come across a map that is in another namespace, we might need to
translate it to the filesystem/path inside that mount namespace. Otherwise,
we won't be able to accurately decode ELF symbols due to loading the
incorrect binary/debug files.
2017-02-26 16:59:48 -08:00
44967283ed meson: add sp-symbol-dirs.c 2017-02-26 12:49:01 -08:00
1695510b4a elf: add comment about supporting /newroot/ 2017-02-26 00:28:37 -08:00
c8fa62e839 symbols: provide minimal API to specify symbol directories
This gives us the ability to locate symbols by directory in a much more
maintainable manner. Library consumers can adjust their location based
on where they know symbols are likely to be located.
2017-02-25 21:35:21 -08:00
9c7a31cbf6 Revert "callgraph: teach callgraph to use alternative symbol roots"
I found a better approach, so we can remove this.

This reverts commit 222d0ad53f.
2017-02-25 21:27:02 -08:00
6e0c52c934 Revert "elf: add docs for symbol dirs"
I found a better approach, so we can remove this.

This reverts commit 660634e988.
2017-02-25 21:26:49 -08:00
660634e988 elf: add docs for symbol dirs 2017-02-25 19:39:31 -08:00
222d0ad53f callgraph: teach callgraph to use alternative symbol roots
This allows us to have a sysroot different than /, so that we can resolve
symbols that are not necessarily installed on the system. For example, if
we are running an application in an alternate mount namespace, we will want
to resolve the symbols starting from the location of the checkout for that
namespace.

Generally alternate mount namespaces will have paths like "/newroot/usr/.."
so by setting the source to "/newroot/usr/" to "~/.local/" you can do
some fancy remapping.
2017-02-25 19:34:58 -08:00
6a3d7282ec visualizer: use cast macro with type check 2017-02-17 00:20:13 -08:00
67a9d63597 visualizers: use cast macros
We use these everywhere else, so be consistent with that.
2016-12-12 16:15:06 -08:00
ce9cd3ed43 build: Include meson files in dist 2016-12-01 02:47:03 -05:00
52bc856be4 build: Add support for Meson 2016-12-01 02:34:11 -05:00