Commit Graph

20 Commits

Author SHA1 Message Date
bc7e3e27c2 capture: use size of void* instead of glibc-specific __WORDSIZE
__WORDSIZE is glibc-specific so sp-capture-types.h doesn't work with musl.
2018-09-07 10:52:52 +01:00
b3bf7968ad capture: avoid GObject in libsysprof-capture-2.a
The point of this file was to be easily usable by applications that want
to generate capture files (or proxy them). The intention here is that we
only have SpCaptureReader/SpCaptureWriter (and associated bits necessary
to support that).

This makes sure that we do not use GObject from the libsysprof-capture-2.a
while still having GType's in the libsysprof-2.so dynamic library.

We also invert the GObject macro check so that the default is to not
register a GType which increases the chances that copy/paste code does
not run into double-registering a GType if used with an application that
links against libsysprof-2. (One such example could be if Gtk uses this
code for timers, as it would break Sysprof itself).
2018-05-21 13:52:16 -07:00
7c03499484 writer: add helper to replace time range
This is useful so that we can overwrite the time range in the file when
muxing together multiple streams.
2018-05-18 11:28:15 +01:00
7f889b487d capture: add doc for new_from_fd 2018-05-17 13:13:36 +01:00
1ef68eeb31 capture: do 24 bit counter identifier checks
Max uint was more than we allow, since we steal the top 8 bits for some
other data. This instead checks for 24-bit and warns if the user tries to
store a counter value that was not registered.
2018-05-17 12:29:04 +01:00
3d14ce4eaa capture: use uint for requested counter id
Also document this thing so it is more obvious what is going on with the
resulting counter ranges.
2018-05-17 12:19:54 +01:00
b4d5fdd5e4 writer: clear values before setting counters
We have an annoying issue where we look at all fiends of a counter values
chunk in the counter set frame. So we need those values set to zero. If
we are passed fewer counter values than can fit in the frame, we leave
some of that data uninitialized. This ensures that it is cleared.
2018-05-17 11:38:34 +01:00
590d317a94 cursor: add helper to get reader
We might need this so that we can access to the updated end time that was
determined by iterating frames.
2018-05-16 12:44:48 +01:00
e853c79be9 mark: add group to mark event
This allows grouping marks together so that the UI can present marks within
the same group in the same visualizer row.

The goal here is that our perf stream with drm data will have "drm" or some
similar group name (resulting in one row). mutter/cogl/gnome-shell will
use the thread-id as the group name (or something else that is useful) so
their events are grouped together. gdk-wayland might have it's own group
name as well.

The end result is that we can get a mark row for each series of related
data.
2018-05-15 16:33:30 +01:00
c6260ad177 capture: update stats for marks 2018-05-14 17:51:51 +01:00
4bdbf130b2 capture: add simple mark support
The goal here is to have an API that allows us to record things like
frame timing data. We might iterate on this API a bit, but this gets us
started.

A SpCaptureMark with a zero duration should be treated like an epoch mark
once a visualizer is created. SpCaptureMark with a non-zero duration should
be treated like a begin/end of operation. This may be useful in generating
something like a flame graph.
2018-05-14 17:15:57 +01:00
c3d1fd0ff8 sp-capture-writer: Initialize write buffer
Valgrind notes that the buffer is not fully initialized when we pass it
to write(). This could potentially write sensitive data, if we are not
careful with the buffer length.

See https://gitlab.gnome.org/GNOME/gjs/issues/120

https://bugzilla.gnome.org/show_bug.cgi?id=794272
2018-03-12 16:50:51 -07:00
0219ee5205 capture-cursor: specify const for condition
We don't modify this, so it can be const.
2018-02-13 17:18:28 -08:00
951213ddb6 capture-reader: cleanup some space checks
Add a few more assertions to make sure we have what we think we have. Also
we can drop self->pos from our while loop checks as it will always be zero.
2018-02-13 17:10:02 -08:00
0ec2c127ea capture-reader: fix byte swap of frame info
If we are swapping between endianness, we were miss swapping various fields
and they'd all end up with the swapped len value.
2018-02-13 16:34:41 -08:00
469d54df5b build: add libsysprof-capture-2 static library
This allows external tooling to write capture files that Sysprof can open.
Ideally, this will get used by GJS in the near future to implement profiler
output for Sysprof.
2018-01-20 01:30:39 -08:00
6fa95dfb6f lgpl: relicense some useful files as LGPLv2.1+ 2018-01-20 01:26:17 -08:00
00b6892a72 build: fix header installation paths 2017-09-28 17:45:07 -07:00
190faa818d build: use subdir meson.build files
This keeps the build file closer to the sources it effects.
2017-09-28 16:57:00 -07:00
c47822b26e source tree cleanup
The lib/ directory was getting a bit out of hand, so this tries
to organize things a bit so it is easier going forward to locate
the code people want to patch.
2017-09-28 16:23:03 -07:00