[sysprof] libsysprof-capture: ignore some types when extending end_time



commit ca5c66245c90a47d8cb5a1e5652e33386aaace0d
Author: Christian Hergert <chergert redhat com>
Date:   Sat Feb 15 22:17:23 2020 -0700

    libsysprof-capture: ignore some types when extending end_time

 src/libsysprof-capture/sysprof-capture-reader.c | 36 +++++++++++++++++++------
 1 file changed, 28 insertions(+), 8 deletions(-)
---
diff --git a/src/libsysprof-capture/sysprof-capture-reader.c b/src/libsysprof-capture/sysprof-capture-reader.c
index 888c6e7..29b94ca 100644
--- a/src/libsysprof-capture/sysprof-capture-reader.c
+++ b/src/libsysprof-capture/sysprof-capture-reader.c
@@ -156,17 +156,37 @@ sysprof_capture_reader_discover_end_time (SysprofCaptureReader *self)
     {
       gint64 end_time = frame.time;
 
-      if (frame.type == SYSPROF_CAPTURE_FRAME_MARK)
+      switch (frame.type)
         {
-          const SysprofCaptureMark *mark = NULL;
-
-          if ((mark = sysprof_capture_reader_read_mark (self)))
-            end_time = frame.time + MAX (0, mark->duration);
+        case SYSPROF_CAPTURE_FRAME_MARK: {
+            const SysprofCaptureMark *mark = NULL;
+
+            if ((mark = sysprof_capture_reader_read_mark (self)))
+              end_time = frame.time + MAX (0, mark->duration);
+          }
+          break;
+
+        case SYSPROF_CAPTURE_FRAME_ALLOCATION:
+        case SYSPROF_CAPTURE_FRAME_CTRSET:
+        case SYSPROF_CAPTURE_FRAME_EXIT:
+        case SYSPROF_CAPTURE_FRAME_FORK:
+        case SYSPROF_CAPTURE_FRAME_LOG:
+        case SYSPROF_CAPTURE_FRAME_PROCESS:
+        case SYSPROF_CAPTURE_FRAME_SAMPLE:
+        case SYSPROF_CAPTURE_FRAME_TIMESTAMP:
+          if (end_time > self->end_time)
+            self->end_time = end_time;
+          break;
+
+        case SYSPROF_CAPTURE_FRAME_MAP:
+        case SYSPROF_CAPTURE_FRAME_JITMAP:
+        case SYSPROF_CAPTURE_FRAME_CTRDEF:
+        case SYSPROF_CAPTURE_FRAME_METADATA:
+        case SYSPROF_CAPTURE_FRAME_FILE_CHUNK:
+        default:
+          break;
         }
 
-      if (end_time > self->end_time)
-        self->end_time = end_time;
-
       if (!sysprof_capture_reader_skip (self))
         break;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]