Commit Graph

12 Commits

Author SHA1 Message Date
608582d3c4 libsysprof-capture: Drop GLib dependency
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
2020-07-03 22:00:34 +01:00
5a2144e254 libsysprof-capture: Port from GLib to pthreads for locking and once-init
Another step towards dropping the GLib dependency.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-03 22:00:34 +01:00
0d68b1afb5 libsysprof-capture: Use _WIN32 rather than G_OS_WIN32
They should be equivalent.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-03 22:00:34 +01:00
607af73676 libsysprof-capture: Stop defining G_LOG_DOMAIN
libsysprof-capture no longer calls any of the GLib logging functions
which make use of it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-03 22:00:34 +01:00
6e281dca1f libsysprof-capture: Use strlcpy() instead of g_strlcpy()
If the system doesn’t provide `strlcpy()` (FreeBSD does, Linux doesn’t),
use an inbuilt copy instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-03 22:00:34 +01:00
f925fab564 libsysprof-capture: Replace G_{UN,}LIKELY with SYSPROF_{UN,}LIKELY
This does the same thing for modern compilers, but without the GLib
dependency.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-03 22:00:34 +01:00
8e28ac6e81 libsysprof-capture: Use assert() instead of g_assert()
Also use it instead of `g_return_if_fail()`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-03 22:00:34 +01:00
2c2cbf6343 libsysprof-capture: Use C11 types instead of GLib types
This is an almost entirely mechanical* conversion from (for example)
`gint` → `int`, `guint8` → `uint8_t`, etc.

It is not entirely complete, as many GLib functions are still used in
libsysprof-capture, which necessitate some use of GLib types.

It also avoids renaming `gboolean` → `bool` as that’s a slightly more
controversial change which will happen in the following commit.

*Code was manually realigned afterwards.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
2020-07-02 21:07:11 +01:00
19e077736b libsysprof-capture: use sysconf() instead of getpagesize() 2020-02-13 14:32:34 -08:00
ec7fa297e7 whitespace cleanup 2019-06-05 13:25:29 -07:00
532972beb6 libsysprof-capture: relicense as BSD-2-Clause-Patent
This allows embedding the static capture library without having to deal
with license incompatibility while retaining the patent clause. We want
as many consumers of the format as makes sense without the restriction
of what kind of app/library/tooling they are.

The application, sysprofd, libsysprof, and libsysprof-ui continue to be
GPLv3+.
2019-06-05 13:25:21 -07:00
53c718b708 build: rename all symbols to use sysprof_ as prefix
As we gain in usage, we need to be more careful about using a prefix
that will not collide with other symbols. So version 3 of our ABI will
change to using Sysprof/SYSPROF/sysprof as the various prefixes.

The soname/api version bump will happen later on this branch so that
things are easier to test up until then.
2019-05-29 15:12:59 -07:00