Commit Graph

43 Commits

Author SHA1 Message Date
8ddcf54c37 libsysprof-profile: add mountinfo when process discovered 2023-05-30 17:28:04 -07:00
2ac4ff692d libsysprof-profile: add API to notify of process started
This will be used when we discover a process started like when the Perf
instrument gets PERF_RECORD_COMM.
2023-05-30 17:27:33 -07:00
ee3a78433f libsysprof-profile: add processes during recording
We want to reduce the chances we miss things between prepare and record
virtual methods, so delay the adding of processes until the recording is
started. We may get duplicate records, but we can deal with that when
analyzing the capture.
2023-05-30 17:12:19 -07:00
5c825c1fb5 libsysprof-profile: add some basic process information
This needs to get into the capture, and we still need to respond to the
discovery of new processes as well (which we lack API for).
2023-05-30 17:06:28 -07:00
81317bc1ca libsysprof-profile: add recording helper to capture file data
We might have the file data from the peer and can specify the data in the
capture writer directly.

It may be useful to allow compressing these too, but we can deal with that
at a later time.
2023-05-30 17:00:53 -07:00
df7da9bb41 libsysprof-profile: remove frame overhead from max data length
Just so that we can potentially fit multiple of these per buffering in the
capture writer.
2023-05-30 17:00:00 -07:00
f91e13e055 libsysprof-profile: require org.gnome.sysprof3.profile policy
This will be needed to read the given proc files that should be captured
in the recording.
2023-05-30 16:11:38 -07:00
1764a088ee libsysprof-profile: fix iteration of instruments 2023-05-30 16:10:19 -07:00
1851f39b8a libsysprof-profile: use dex_bus_get()
This allows us to remove the synchronous call here from the fiber calling
into this API.
2023-05-30 16:05:01 -07:00
f9be133913 libsysprof-profile: implement loading files via sysprofd
If we need access to a privileged file in /proc or /sys we need to get
that through sysprofd. This implements basic checking of paths to see
if we need to get a /proc file from there.

We can't use the GetProfFD variant because that may still cause errors
when reading back due to how selinux and other LSMs may restrict read()
to get kallsyms.

This requires recent API additions in libdex.
2023-05-30 15:53:39 -07:00
4fe9339113 libsysprof-profile: capture files using recording API 2023-05-30 14:44:01 -07:00
14f71c5eee libsysprof-profile: add API to append a file to recording 2023-05-30 14:43:44 -07:00
01091fe815 libsysprof-profiler: add linux instrument on Linux 2023-05-28 09:08:35 -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
80bc9ac370 libsysprof-profile: fix declaration alignment 2023-05-26 23:04:22 -07:00
62071ff56f libsysprof-profile: bridge ring data to capture file 2023-05-26 17:07:26 -07:00
7c98f782c0 libsysprof-profile: add getter for capture writer 2023-05-26 17:07:16 -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
55353aa185 libsysprof-profile: add record vfunc scaffolding
We still need to create the ring buffer and the source to stream it into
the capture writer, but that will come soon.
2023-05-26 16:32:17 -07:00
8409022c5c libsysprof-profile: add record step to recording/instruments 2023-05-26 16:05:48 -07:00
4d54aa6a51 libsysprof-profile: add SysprofInstrument record vfunc 2023-05-26 16:05:30 -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
800c32e303 libsysprof-profile: add private API to get recording spawnable
This will still need to be set by the profiler eventually, but this gets
the readback API in place so we can use it from instruments.
2023-05-26 15:37:39 -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
b4e6f7c915 libsysprof-profile: add recording session fiber
Setup instrument policy, preparation, etc.
2023-05-26 15:05:29 -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
97128b4185 libsysprof-profile: transfer instrument ownership 2023-05-26 12:18:26 -07:00
731841a523 libsysprof-profile: wait for recording and seutp ctrl+c 2023-05-25 17:25:13 -07:00
ce4a4200f8 libsysprof-profile: create recording and start it 2023-05-25 17:24:54 -07:00
07dc728bfe libsysprof-profile: change state on stop
We will need some more checks in here later on once we're doing things
with the instruments, but this gets the job done for now.
2023-05-25 17:24:33 -07:00
7fb77ee01d libsysprof-profile: create writer and test record 2023-05-25 17:17:25 -07:00
a8fbb645d0 libsysprof-profile: add writer as record parameter 2023-05-25 17:17:04 -07:00
9498d15170 libsysprof-profile: fix copy-paste typo 2023-05-25 17:16:47 -07:00
d3fe382954 libsysprof-profile: add test-profiler 2023-05-25 17:10:37 -07:00
7b83ff3f34 libsysprof-profile: fix includes for profiler 2023-05-25 17:10:23 -07:00
08aa970c7c libsysprof-analyze: add instruments to recording and list policy
We need to know all the policy that must be acquired upfront so that we
don't have to do individual queries on policy.
2023-05-25 17:05:16 -07:00
ccdc1b8cff libsysprof-profile: add API to list required policy
The idea here is that we stop having instruments do their own policy
checking and instead do the policy checking as a set from the recording
as part of prepare/etc.
2023-05-25 16:43:56 -07:00
2ae33917b2 libsysprof-profile: add writer to recording object 2023-05-25 16:26:18 -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