Commit Graph

138 Commits

Author SHA1 Message Date
4d92cf3424 libsysprof-profile: only bundle ELF symbols
The rest can be decoded already using content we have in our syscap.
2023-07-17 17:41:15 -07:00
2dbf6553b4 libsysprof-profile: add instrument to bundle symbols
This instrument does as our previous symbols_source did and will augment
the capture with additional symbols that improves the chances you'll get
proper symbolization on machines that did not create the capture.
2023-07-17 17:37:32 -07:00
1fba250444 build: drop legacy v2 service and simplify build system
This removes -Dagent and just uses -Dtools as it only affects sysprof-cli
and sysprof-agent. We still need to patch sysprof-cli for recent changes
as we did for sysprof-agent though.

Additionally, we haven't used the v2 service in forever, so drop that as
I can't imagine anyone has been using it.
2023-07-17 15:11:10 -07:00
ee962d93cd libsysprof-profile: give access to GSubprocess
This is needed to be able to proxy exit/signal information via
sysprof-agent.
2023-07-17 11:39:35 -07:00
f6fa18bfe5 libsysprof-profile: add required policy to power profiles 2023-07-17 11:39:06 -07:00
dc0c19c211 libsysprof-profile: flush recording before exit 2023-07-12 13:15:20 -07:00
e440c130e8 libsysprof-profiler: record sampler shutdown reason 2023-07-12 13:15:08 -07:00
a82e8e2d2a libsysprof-profile: record log message for stop command 2023-07-12 13:14:29 -07:00
1bcdb3aeac libsysprof-profile: do not discard on cancel our subprocess wait 2023-07-12 13:14:09 -07:00
88d0589fea libsysprof-profile: tail journald and append logs to capture
It can be handy to get system information from journald to correlate with
what is going on in applications. This simple journald tail GSource will
dispatch to our callback which can append the logs to the capture.

This uses a custom callback rather than the GSourceFunc because that seems
a bit annoying to use with recent GCC function equivalence checks.
2023-07-12 10:31:23 -07:00
6075a0cd91 build: fix log domains 2023-07-11 13:32:09 -07:00
b22e2f3b6a libsysprof-profile: use shared time for process times 2023-07-10 13:35:50 -07:00
1c08fc18b0 libsysprof-profile: fix success case 2023-07-10 13:07:40 -07:00
304943a03c libsysprof-profile: include spawnable information in metadata 2023-07-10 10:58:52 -07:00
a0befecfaa libsysprof-profile: add hostname to capture metadata 2023-07-10 10:51:18 -07:00
b82b2b5434 libsysprof-profile: add sysinfo metadata to capture 2023-07-10 10:47:27 -07:00
439ea30c2f libsysprof-profile: add more system information as metadata 2023-07-10 10:38:52 -07:00
22b2510179 libsysprof-profile: ignore some errors used to break out of loop 2023-07-09 15:01:07 -07:00
2d4ed4859d libsysprof-profile: add some system metadata/files
Very handy when trying to determine what the user setup is without having
to go back and forth on issue trackers.
2023-07-08 13:10:11 -07:00
79ac0a2c73 libsysprof-profile: add version info as metadata 2023-07-08 12:41:06 -07:00
3e57c638d8 libsysprof-profile: don't discard unhandled messages
We want to re-use our future for messages until we've received something.
Otherwise, every iteration we discard a message.
2023-07-08 11:59:55 -07:00
5ac95f70fe libsysprof-profile: flush writer when recording stops
We need to at least submit this data to the underlying FD from our buffer
when we stop recording so that anyone consuming the FD will have access to
it. (Such as a SysprofDocumentLoader via FD).
2023-07-08 11:59:19 -07:00
0643a2a6b4 libsysprof-profile: add some logging information 2023-07-08 11:58:33 -07:00
cbf12f07f8 libsysprof-profiler: add reader and FD helpers for recording 2023-07-08 11:19:18 -07:00
b56f0ad444 libsysprof-profile: add property for event count
So we can bind this to the recording pad and update it with each pass
through the loop.
2023-07-08 10:28:25 -07:00
d5a13ccdb4 libsysprof-profile: add duration property for recording
So we can use this to update a recording timer view.
2023-07-07 17:36:56 -07:00
3b98386ed2 libsysprof-profile: check for valid reader before calling cat 2023-07-07 16:08:57 -07:00
6b90e48bea libsysprof-profile: allow setting performance profile
This allows setting the net.hadess.PowerProfiles during the execution of
the Sysprof run. This is handy if you want to test in a specific mode (such
as performance) but not leave your system in that state.
2023-07-07 16:08:43 -07:00
a0d5f0fc66 libsysprof-profile: set cwd when spawning process 2023-07-06 11:18:53 -07:00
4793b12ca2 libsysprof-profile: use GByteArray for read buffer
That way we aren't relying on the stack for access to buffer data.
2023-07-06 10:59:46 -07:00
14e6952726 libsysprof-profile: clamp to range 2023-06-30 12:43:31 -07:00
4d553ec88e libsysprof-profile: more CPU data points
2x per second just isn't enough data points for useful graphs. Ideally we
will make this tunable by the instrument, but not for now.
2023-06-29 14:20:02 -07:00
b5f3bd2b26 libsysprof-profiler: buffer controlfd data to intermediate memfd
This ensures that we don't clobber things by writing them without possible
translation. That is problematic when each controlfd process might have
it's own counter registration or JIT maps as they could collide with the
main writer's own state.

This fixes some situations where the counter data was coming in with
erroneous values.
2023-06-27 15:02:30 -07:00
86bb52f56c libsysprof-profile: include gnome-shell data in test-profiler 2023-06-27 14:27:06 -07:00
d7584d1d86 libsysprof-profile: various cpu counter cleanups and fixes 2023-06-27 13:41:15 -07:00
30dc327f02 libsysprof-profile: remove use of g_alloca in recording fibers 2023-06-27 13:19:46 -07:00
4bb6b588bf libsysprof-profile: avoid alloca for counter state 2023-06-27 13:16:07 -07:00
3a94170b0a libsysprof-capture: add frame type for tracing
This is like sample but has an "enter/exit" flag with it. This can be
useful when you want to provide tracing instead of sampling. We use a
different frame type so that we can denote that this isn't traditional
sampling, and the flag can be used to find the next exit for the current
enter for calculating durations.

The entire stack trace is provided to make things easier on tools
which may want to deal with indirect functions that were not instrumented
but can be unwound. That may allow for tooling to give the user some
insight that it's not *just* this function entering, but some functions
before it were entered too.

This also adds a SysprofTracer instrument which will preload a
libsysprof-tracer-6.so into the process providing the
__cyg_profile_func_enter() and __cyg_profile_func_leave() hooks.
2023-06-13 12:41:50 -07:00
a9f149ec3d libsysprof-profile: add diagnostics for perf event open failure 2023-06-13 11:42:48 -07:00
f09186dc21 libsysprof-profile: record diagnostic on kallsyms failure 2023-06-13 11:36:42 -07:00
1f6cc39554 libsysprof-profile: add SysprofDiagnostic to recordings
This allows instruments to record a diagnostic and have it land as an
object in a GListModel of diagnostics available to the API consumer.

Such items may be used by recording UI to display issues with the recording
to the user.
2023-06-13 11:33:43 -07:00
13e1ace8dc libsysprof-profile: flush events when disabling 2023-06-09 17:25:57 -07:00
bfbdd3b642 libsysprof-profile: use maps parser from Linux instrument 2023-06-09 17:25:55 -07:00
ee165ea91f libsysprof-profile: add address mappings parser
This parses the contents of /proc/$pid/maps and has a crude helper to test
it against real world files (which found a missing capture we had).
2023-06-09 17:23:06 -07:00
9e8c4dba54 libsysprof-profile: init sysprof clock 2023-06-09 16:35:25 -07:00
e8293edd54 libsysprof-profile: only create fdlist when necessary 2023-06-09 16:35:04 -07:00
283da1e107 libsysprof-profile: fix flags type
So we can pass it right through.
2023-06-09 16:34:49 -07:00
3d7a6ca43b libsysprof-profile: set default environment for spawnable 2023-06-06 16:45:02 -07:00
1e675e92e4 libsysprof-profile: add malloc tracing instrument 2023-06-06 16:30:38 -07:00
b0a3736ff4 libsysprof-profile: add memprof to profiler test 2023-06-06 16:15:45 -07:00