libsysprof-capture: add stats to reader when possible

We can also back-fill these when reading a capture file.
This commit is contained in:
Christian Hergert
2019-05-15 16:38:47 -07:00
parent 6437dba247
commit aed80ea51f
5 changed files with 56 additions and 14 deletions

View File

@ -1012,6 +1012,7 @@ SysprofCaptureReader *
sysprof_capture_writer_create_reader (SysprofCaptureWriter *self,
GError **error)
{
SysprofCaptureReader *ret;
int copy;
g_return_val_if_fail (self != NULL, NULL);
@ -1033,7 +1034,10 @@ sysprof_capture_writer_create_reader (SysprofCaptureWriter *self,
if (-1 == (copy = dup (self->fd)))
return NULL;
return sysprof_capture_reader_new_from_fd (copy, error);
if ((ret = sysprof_capture_reader_new_from_fd (copy, error)))
sysprof_capture_reader_set_stat (ret, &self->stat);
return g_steal_pointer (&ret);
}
/**