From b6dc058d62fc413d89a2ff8e66b5ddb73414b6dd Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 18 Feb 2020 13:17:49 -0800 Subject: [PATCH] libsysprof: check for time series after extracting processes --- src/libsysprof/sysprof-memprof-profile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libsysprof/sysprof-memprof-profile.c b/src/libsysprof/sysprof-memprof-profile.c index 7f9b0c53..2dfe9620 100644 --- a/src/libsysprof/sysprof-memprof-profile.c +++ b/src/libsysprof/sysprof-memprof-profile.c @@ -218,11 +218,7 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame, g_assert (frame->type == SYSPROF_CAPTURE_FRAME_ALLOCATION || frame->type == SYSPROF_CAPTURE_FRAME_PROCESS); - /* Short-circuit if we don't care about this frame */ - if (!sysprof_selection_contains (g->selection, frame->time)) - return TRUE; - - if (frame->type == SYSPROF_CAPTURE_FRAME_PROCESS) + if G_UNLIKELY (frame->type == SYSPROF_CAPTURE_FRAME_PROCESS) { const SysprofCaptureProcess *pr = (const SysprofCaptureProcess *)frame; g_autofree gchar *cmdline = g_strdup_printf ("[%s]", pr->cmdline); @@ -234,6 +230,10 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame, return TRUE; } + /* Short-circuit if we don't care about this frame */ + if (!sysprof_selection_contains (g->selection, frame->time)) + return TRUE; + if (frame->type == SYSPROF_CAPTURE_FRAME_ALLOCATION) { const SysprofCaptureAllocation *ev = (const SysprofCaptureAllocation *)frame;