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 is all aimed at making it so that sysprof can be built as a
subproject within GLib, with only `libsysprof-capture-4.a` being
produced as output.
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>
This is to avoid running `gdbus-codegen` when building sysprof as a
subproject underneath libglib, as by that point in the GLib build
process, `gdbus-codegen` is not yet available.
The interfaces generated by these `gdbus-codegen` invocations are only
needed for `sysprofd` and libsysprof, not for the libraries like
`libsysprof-capture`.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This avoids making the project depend on all its dependencies, some of
which are optional, when being built as a Meson subproject.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Some minor changes were necessary so that we could change the ABI in
libsysprof-capture to be free from GLib (and therefore used by GLib).
This also adds some wrappers for capture API in libsysprof so that we
can continue to use GError from UI code.
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
This makes no functional difference, but does tidy up the code style a
bit. All other internal headers are included using quotes in other
files.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #40
The macros don’t seem to make things sufficiently much clearer that it
makes sense to provide them.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #40