Commit Graph

26 Commits

Author SHA1 Message Date
dc0c19c211 libsysprof-profile: flush recording before exit 2023-07-12 13:15:20 -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
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
86bb52f56c libsysprof-profile: include gnome-shell data in test-profiler 2023-06-27 14:27:06 -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
9e8c4dba54 libsysprof-profile: init sysprof clock 2023-06-09 16:35:25 -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
006618c5ae libsysprof-profile: fix -- parsing with options 2023-06-06 16:15:28 -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
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
0288e937e4 libsysprof-profile: add SysprofMemoryUsage
Ports sysprof-memory-source.c to the new SysprofInstrument API.
2023-06-02 18:01:18 -07:00
1a3facf6ff libsysprof-profiler: allow specifying test-profiler argv
You can `./test-profiler -- ls -lsah` to profile a subprocess and have
the profiler exit when the subprocess exits.
2023-06-02 16:50:41 -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
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
b4e6f7c915 libsysprof-profile: add recording session fiber
Setup instrument policy, preparation, etc.
2023-05-26 15:05:29 -07:00
731841a523 libsysprof-profile: wait for recording and seutp ctrl+c 2023-05-25 17:25:13 -07:00
7fb77ee01d libsysprof-profile: create writer and test record 2023-05-25 17:17:25 -07:00
d3fe382954 libsysprof-profile: add test-profiler 2023-05-25 17:10:37 -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