Commit Graph

28 Commits

Author SHA1 Message Date
6212396483 libsysprof: Actually set spawnable flags to inherit stdin
The code calculated flags but never actually set them on the spawnable,
so the `inherit-stdin` property did not work.

Fixes: 8799d2f0ca
See: https://gitlab.gnome.org/GNOME/sysprof/-/issues/76#note_1531919
2022-10-07 17:55:09 +00:00
e772197253 libsysprof: add signals for spawn/exit/term of subprocess
This is useful so that we can know when a subprocess has spawned by the
profiler in tooling which allows sysprof to spawn a process and monitor
said process. Additionally, we need to know when it exits so that we can
be correct in when we can call get_if_exited() from tooling.
2022-07-21 11:53:14 -07:00
8799d2f0ca libsysprof: add API to inherit stdin
Related #76
2022-04-01 12:57:02 -07:00
bcda9694c6 profiler: fix typo in mutable calculation
Fixes #65
2021-06-03 13:57:38 -07:00
143554c68e profiler: preroll authorization before starting
This helps some annoying cases where we keep checking over and over for
each CPU, procfile, etc during startup.

It makes the tool less useful on systems without D-Bus, but let's be
honest, profiling is a Linux only game for Sysprof.
2021-02-24 14:01:01 -08:00
2850858d24 profiler: dont authorize during profiler startup
This should be done by sources, as there are configurations that will not
require polkit communication and that can be frustrating when it happens.
2020-08-21 13:15:38 -07:00
620f1f0ff0 build: fix build warnigns with Clang 2020-08-14 12:57:50 -07:00
45c8c95706 libsysprof-capture: Drop GError usage from SysprofCaptureWriter
Use `errno` instead, which is icky, but given that all of the failure
modes are from POSIX I/O functions, it’s at least in keeping with them.

This is a major API break.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-03 22:00:34 +01:00
5636bbf4f0 libsysprof-capture: Use stdbool instead of gboolean
Another step towards dropping GLib as a dependency of
libsysprof-capture.

Unlike the previous commit which replaced GLib integer types with the
bitwise equivalent C standard types, `stdbool` is potentially a different
width from `gboolean`, so this is an ABI break.

It therefore involves some changes to callback functions in the tests
and tools, and in libsysprof.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-02 21:07:11 +01:00
d2047fb557 libsysprof-capture: Move autocleanup definitions to libsysprof
In preparation for dropping the GLib dependency from libsysprof-capture,
move the autocleanup definitions up to libsysprof. Add a new header for
them.

This is slightly awkward in the tools, which depend on
libsysprof-capture but not libsysprof. Rather than make them depend on
libsysprof (which might be disabled at configure time), include the
`sysprof-capture-autocleanups.h` file between source directories.
`SYSPROF_COMPILATION` needs to be defined for this to work.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-02 21:07:11 +01:00
4af293a364 libsysprof: apply whole-system during capture replay
Fixes #31
2020-03-04 11:05:13 -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
8c72bafff8 tools: set cwd when spawning with sysprof-cli 2019-07-28 12:32:49 -07:00
e97490be16 libsysprof: abstract subprocess usage
For embedding cases, we need a bit more control here so that the
application can be in control of how the process is spawned.
2019-06-11 18:48:28 -07:00
19c2791198 build: fix build on Debian 9 2019-06-11 09:48:41 -07:00
807bff9152 build: fix build on macOS 2019-06-04 14:35:48 -07:00
b7d2ef35be libsysprof: ensure type exists for gjs 2019-06-03 19:02:50 -07:00
8a246d4453 libsysprof: create hook for supplemental writer data 2019-05-29 15:13:01 -07:00
7bec0d7698 libsysprof: make sure we have a SysprofSource 2019-05-29 15:13:01 -07:00
404317d49d libsysprof: implement various serialization hooks 2019-05-29 15:13:01 -07:00
974cbf5130 libsysprof: add helper to create profiler from capture reader
This will look at what was in the reader before and create a new local
profiler from that. This still needs to add support for restoring info
from sources which need to be inflated.
2019-05-29 15:13:01 -07:00
6a5c00b446 libsysprof: store some information about the profile in keyfile
This gets added as a metadata chunk to the capture file so that we can
use it later to recreate the session. The goal is to add something like
ctrl+r to run the capture again with identical settings to the previous
capture.
2019-05-29 15:13:01 -07:00
dbc47a3a69 libsysprof: log source failure to console 2019-05-29 15:13:01 -07:00
c204081cc0 libsysprof: add vfunc to modify spawn arguments 2019-05-29 15:13:01 -07:00
53a337bf00 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
e822128121 libsysprof: authorize proxy during start 2019-05-29 15:13:00 -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