Commit Graph

26 Commits

Author SHA1 Message Date
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
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
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
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
1e675e92e4 libsysprof-profile: add malloc tracing instrument 2023-06-06 16:30:38 -07:00
0e625cea21 libsysprof-profile: add RAPL-based SysprofEnergyUsage
This does what we did previously with RAPL via sysprofd, with the new
SysprofInstrument API.
2023-06-06 15:56:38 -07:00
6f661c6bfe libsysprof-profile: add proxied instrument
This fetches data into a memfd from a peer process and then appends it to
the capture at the end of recording.
2023-06-06 15:55:57 -07:00
200b8acb20 libsysprof-profile: add scaffolding for battery charge
This is a SysprofInstrument that will eventually contain the contents of
the sysprof-battery-source.c to get battery charge/rate/etc. Note that
this is different from energy usage which will come from RAPL.
2023-06-06 11:19:03 -07:00
fb81867bf5 libsysprof-profiler: start on perf instrument
This starts porting the old perf code from libsysprof into
libsysprof-profile. It does not bring over tracepoints yet, because we
need to think about how we want to support that. I may opt to do that as
a separate instrument even if that takes an additional perf fd.
2023-06-03 23:14:14 -07:00
25d629beb4 libsysprof-profile: start on perf event stream
This is a bit different than how we did things previously, but the same
mechanics are involved. Instead of multiple CPU registered together, we'll
just use one-stream-per-cpu.

Partly because I intend to drop support for profiling a single process as
that doesn't really get used much nor does it seem to yield very good
results from perf.
2023-06-03 21:28:22 -07:00
0288e937e4 libsysprof-profile: add SysprofMemoryUsage
Ports sysprof-memory-source.c to the new SysprofInstrument API.
2023-06-02 18:01:18 -07:00
728a9ce86a libsysprof-profiler: add scaffolding for disk usage
This still needs porting from libsysprof, but this gets the scaffolding in
place to bring over those counters.
2023-06-02 13:38:03 -07:00
fd40e940d3 libsysprof-profile: add network usage instrument 2023-05-31 22:43:33 -07:00
fd1fb68a98 libsysprof-profile: add various CPU parsing
This still needs some work because the read operations are blocked
currently.
2023-05-30 21:29:49 -07:00
52684c7a12 libsysprof-profile: start on cpu usage instrument
The goal here is to do the whole thing on a fiber rather than how we were
doing it before. This just gets the counter registration going, but we
need to follow up with the parsing/lseek/etc code.
2023-05-30 18:41:56 -07:00
9f9f953d53 libsysprof-profile: import podman utils
This comes from libsysprof, which we hope to remove as part of this move
to libsysprof-profile vs libsysprof-analyze.
2023-05-30 17:57:41 -07:00
02811d593b libsysprof-profile: start on linux host info instrument
This instrument is meant to gather information about the host that we will
need as part of the capture to decode things properly.
2023-05-27 10:33:45 -07:00
e4ec04812d libsysprof-profile: bring over mapped ring buffer source 2023-05-26 16:48:26 -07:00
38dbf0dc95 build: add mapped_ring_buffer_sources for inclusion
We use this in various places but it relies on some static API in the
libsysprof-capture. Make it available to the other libraries.
2023-05-26 16:46:44 -07:00
1e3ad3982d libsysprof-profile: implement prepare vfunc
This doesn't start reading from the input stream, but does get things into
place until we actually start processing the recording. When we get a
record vfunc, we will do the input processing.
2023-05-26 15:41:58 -07:00
9494b403f4 libsysprof-profile: add SysprofSpawnable
This comes from libsysprof, but the goal here is to remove that library
after getting this one into shape. So C&P is fine for now.
2023-05-26 15:37:02 -07:00
fac12d657a libsysprof-profile: implement polkit checking with libdex
Also, I no longer wish to try to maintain support for no-polkit. If there
is truly a system where that is something we want to support, we can bring
back the shims as a compile time alternative.
2023-05-26 13:48:16 -07:00
d1bcf93922 build: add libdex-1 requirement for libsysprof-profile
Being able to manage asynchronous operations with libdex will drastically
simplify how we implement the profiler and instruments. We may eventually
do the same with libsysprof-analyze to parallelize some operations.
2023-05-26 12:21:36 -07:00
11aa39f151 libsysprof-profile: add scaffolding for controlfd source
This is internal to the profile and will always be active when running
subprocesses with Sysprof.
2023-05-26 12:18:59 -07:00
93153d1943 libsysprof-profile: add scaffolding for base objects
The goal here is to have a fairly small exposed API surface for profiling
similar to libsysprof-analyze where implementation details are hidden.

 SysprofProfiler - Where you setup your recording
 SysprofInstrument - What you add to a profiler to extract data
 SysprofRecording - Represents an active recording w/ instruments
2023-05-25 16:21:40 -07:00
24b876f437 libsysprof-profile: stub out libsysprof-profile library
This does the same thing as we did for libsysprof-analyze, but to contain
the profiler bits that will be used from applications/etc.
2023-05-25 15:43:53 -07:00