Commit Graph

49 Commits

Author SHA1 Message Date
b4fa5ed04f libsysprof: add helper to get process info array 2019-05-29 15:13:00 -07:00
4678273958 libsysprof: avoid remote call if we can 2019-05-29 15:13:00 -07:00
71d64d6732 libsysprof: use macro to preserve types 2019-05-29 15:13:00 -07:00
84fc3f3c0f libsysprof: use g_clear_handle_id() 2019-05-29 15:13:00 -07:00
f6980c0b9e libsysprof: add autoclean backports 2019-05-29 15:13:00 -07:00
ee5bf79e6c libsysprof: wait until first queue_reload() to load
We might need to query the server, so this ensures that we don't authenticate
the polkit session until needed.
2019-05-29 15:13:00 -07:00
bee7321ab4 libsysprof: whitespace 2019-05-29 15:13:00 -07:00
c51e12c497 libsysprof: cancel if we fail auth
To not do this would leave us in a very bad loop asking for too many
pieces of information.
2019-05-29 15:13:00 -07:00
0fe8a688d1 libsysprof: adopt FD that was created for us 2019-05-29 15:13:00 -07:00
de1d9f7131 libsysprof: style cleanup 2019-05-29 15:13:00 -07:00
40cafe03de libsysprof: simplify error message 2019-05-29 15:13:00 -07:00
73426ff051 libsysprof: whitespace 2019-05-29 15:13:00 -07:00
869755de16 libsysprof: cleanup 2019-05-29 15:13:00 -07:00
22e121b564 libsysprof: remove dead code 2019-05-29 15:13:00 -07:00
e822128121 libsysprof: authorize proxy during start 2019-05-29 15:13:00 -07:00
280f4b9415 libsysprof: backport autoptr cleanups when necessary 2019-05-29 15:13:00 -07:00
623d7ad027 build: cleanup dependency checking
We always require polkit now, so that we can fallback when we fail to
communicate with the peer.
2019-05-29 15:13:00 -07:00
eacdc47c34 libsysprof: fix weak ref usage 2019-05-29 15:13:00 -07:00
05bfc21fce libsysprof: only use sync form for perf counter
We already have async auth workflow, so we only need the synchronous
form here, which makes things a bit less complicated.
2019-05-29 15:13:00 -07:00
ec603e1221 perf: remove authorization and proxy usage from counter
This belongs in other abstractions to be more general.
2019-05-29 15:13:00 -07:00
eff557db59 libsysprof: remove authorization from perf source
This will be done more generically from the local profiler
later on.
2019-05-29 15:13:00 -07:00
037ac96425 whitespace cleanup 2019-05-29 15:13:00 -07:00
0e20e98801 libsysprof: add authorize_async() to authorize bus
We want a single authorization request from the user when
starting a profile, and to do it as early as possible. This
will allow for the local profiler to set this up before
starting things.
2019-05-29 15:13:00 -07:00
2161668c01 whitespace cleanup 2019-05-29 15:13:00 -07:00
a361c66085 proc: use helpers for proc access 2019-05-29 15:13:00 -07:00
e282aa78c9 libsysprof: use helpers for proc access 2019-05-29 15:13:00 -07:00
ad4ca5faef helpers: add sync helper 2019-05-29 15:13:00 -07:00
0bb1eadf91 libsysprof: get kallsyms from helper 2019-05-29 15:13:00 -07:00
2aea96d537 whitespace cleanup 2019-05-29 15:13:00 -07:00
935328356a kallsyms: allow creating from kallsyms data 2019-05-29 15:13:00 -07:00
5b40ce4f88 whitespace 2019-05-29 15:13:00 -07:00
fb9e356dbb libsysprof: add sync get_proc variant and fallbacks 2019-05-29 15:13:00 -07:00
0b284329d4 sysprof3: start moving API towards sysprof-3 2019-05-29 15:13:00 -07:00
1bd0107c54 build: fix various includes for older GCC 2019-05-29 15:13:00 -07:00
1a576aa779 helpers: add fallbacks for perf_event_open
First try the proxy to the service, then fallback to trying in-process.
2019-05-29 15:13:00 -07:00
e53a56feaf build: remove unused file 2019-05-29 15:13:00 -07:00
cd3b4d6538 src: use helpers and add group_fd to remote API 2019-05-29 15:13:00 -07:00
46d3c553e5 libsysprof: allow kallsyms usage from daemon 2019-05-29 15:12:59 -07:00
543bf87b81 libsysprof: cleanup whitespace in headers 2019-05-29 15:12:59 -07:00
7ea6ca43ec libsysprof: add inside guards to prevent stray includes
This requires that things use #include <sysprof.h> now instead
of individual includes. A few cases are still allowed in the
libsysprof-capture library to make copy/paste embedding easier.
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
a54892e33f libsysprof: remove use of static library
We can just include the files directly, and avoid the static
linking and potential problems that come with that when porting
the build system to other platforms.
2019-05-29 15:12:59 -07:00
29258e59ba libsysprof: make symbol dirs public API 2019-05-29 15:12:59 -07:00
8b88bfe693 libsysprof: add versioning macros
This also moves stackstash.[ch] into a location that can be
embedded by both the libsysprof and libsysprof-ui code. We
pass native pointers to the structure as a gpointer in the
public API to allow for this. The performance of that code is
incredibly sensitive to the interactivity of Sysprof.
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
e705014394 binfile: ignore vdso bytes if not on Linux
Of course, this all needs improvements to be realistically useful, but
it allows us to get things at least opening. We can adjust how we
store that data to make it available on other OS's later.
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