Really what we want to deal with here is tracking an overlay that we may
need to be able to decode after the fact (in case processes exit or we
need to do post-processing symbol resolution).
For the podman case, that is $some_path mapped to root (/), generally
speaking. For flatpak though, that would have two mappings, one for
/app and another for /usr (possibly more).
While I'm not thrilled to add new frame types for every sort of thing, I
think having this will be relatively useful so we can improve decoding
operations.
This adds SysprofCapturePidRoot which lets us specify a root directory
on the host system for which is the real root (/) of the PID. This can
be useful when reconstructing overlays for containers and you need to
direct access to alternate roots.
The layer gives us some ability to try to deal with overlayfs, albeit at
a very rudimentary level. In most cases I anticipate we just deal with
the main root and ignore overlays until necessary.
All three of these structs are already defined in
`sysprof-capture-types.h`, which is included from these three headers.
Drop the duplicate definition to silence the Clang warning:
```
In file included from /opt/gnome/install/include/sysprof-4/sysprof-capture.h:63:
/opt/gnome/install/include/sysprof-4/sysprof-capture-cursor.h:67:38: warning: redefinition of typedef 'SysprofCaptureCursor' is a C11 feature [-Wtypedef-redefinition]
typedef struct _SysprofCaptureCursor SysprofCaptureCursor;
^
/opt/gnome/install/include/sysprof-4/sysprof-capture-types.h:98:41: note: previous definition is here
typedef struct _SysprofCaptureCursor SysprofCaptureCursor;
```
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This fix error when gio is a subproject, when there is pc file
assotiated for objects in libraries_private meson automatically promote
them to requires.
Also remove some values that are already the default.
This allows Meson to associate the pkg-config module with the "main"
library that it represents, in an unambiguous way.
Signed-off-by: Simon McVittie <smcv@debian.org>
It is rather annoying that the other sizeof form doesn't work with Clang.
This at least gets things working (assuming you have __COUNTER__ support)
which most things we care about do at this point (including MSVC).
By design, it needs to be usable from multiple threads so they can each
request a thread-local mapped ring buffer. This becomes particularly
obvious if you want to send `sysprof_collector_mark()`s from two
libraries (say, GLib and libsoup); the first thread/library to call
`sysprof_collector_mark()` will win.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
These are just like `sysprof_collector_mark()`, but do the printf
formatting of the message internally, and only once the collector has
been fetched — so there is no overhead from the printf if sysprof is not
enabled at runtime.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This will be used to build libsysprof-capture as a subproject within
libglib, with the symbols from libglib being left unresolved until the
static libsysprof-capture is linked into libglib.
When built as a subproject, libsysprof-capture won’t install anything.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
None of the code uses it any more. This means that `libsysprof-capture.a`
can now be used within `libglib-2.0.so` for collecting main loop
statistics.
Brought to you by Opeth’s Deliverance on repeat.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #40
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
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
It was unused anywhere within sysprof.git, and couldn’t be modified to
drop its GLib dependency while still retaining its functionality.
If it’s still needed, it’ll have to be reimplemented in libsysprof.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #40
Change `sysprof_capture_reader_read_jitmap()` to return a `const
SysprofCaptureJitmap *` (like the other `read` functions), and add a new
`SysprofCaptureJitmapIter` type to allow easy iteration over the jitmap.
This allows a use of `GHashTable` to be removed from the API. It breaks
the libsysprof-capture API and ABI.
All the callers iterate over the jitmap rather than looking up elements
by key. If that functionality is needed in future, additional API can be
added to allow it on `SysprofCaptureJitmap`.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #40
This changes its API and ABI: it now returns an allocated array of const
strings, rather than an allocated array of allocated strings.
The call sites in the source tree have been adjusted accordingly.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #40