mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
capture: add end time for captures
Update the end time when we flush the buffer to disk. Also add a way to either incrementally get the end time or rely on the header when possible.
This commit is contained in:
@ -50,6 +50,9 @@ test_reader_basic (void)
|
||||
|
||||
sp_capture_writer_flush (writer);
|
||||
|
||||
/* We should have an old header (without end time) */
|
||||
g_assert_cmpint (0, ==, sp_capture_reader_get_end_time (reader));
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
SpCaptureFrameType type = -1;
|
||||
@ -75,6 +78,11 @@ test_reader_basic (void)
|
||||
g_assert_cmpstr (map->filename, ==, str);
|
||||
}
|
||||
|
||||
/* Now that we have read a frame, we should start having updated
|
||||
* end times with each incoming frame.
|
||||
*/
|
||||
g_assert_cmpint (0, !=, sp_capture_reader_get_end_time (reader));
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
r = sp_capture_writer_add_timestamp (writer, t, i, -1);
|
||||
|
||||
Reference in New Issue
Block a user