From 5dc4e8330778fee3a621e813d2b77d1f0bbcd3b2 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 7 Sep 2023 13:18:41 -0700 Subject: [PATCH] libsysprof: ignore swapper/# scheduler details We "know" that the swapper runs between each process inherently so no need to really include that in the scheduler details. It just clutters up the event timeline. Without it, we're more likely to see patterns in the scribbles. --- src/libsysprof/sysprof-scheduler-details.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libsysprof/sysprof-scheduler-details.c b/src/libsysprof/sysprof-scheduler-details.c index 317e74d2..67aa1a52 100644 --- a/src/libsysprof/sysprof-scheduler-details.c +++ b/src/libsysprof/sysprof-scheduler-details.c @@ -77,10 +77,10 @@ sysprof_scheduler_details_event_cb (const SysprofPerfEvent *event, goto finish; if (self->started_at == 0 || end < self->started_at) - return; + goto finish; if (self->ended_at != 0 && begin > self->ended_at) - return; + goto finish; raw = event->tracepoint.raw; @@ -90,6 +90,12 @@ sysprof_scheduler_details_event_cb (const SysprofPerfEvent *event, prev_comm[sizeof prev_comm-1] = 0; + /* Ignore the kswapper events because they just clutter up the + * timeline from things that would otherwise stand out. + */ + if (memcmp (prev_comm, "swapper/", strlen ("swapper/")) == 0) + goto finish; + g_snprintf (name, sizeof name, "CPU %u", cpu); sysprof_capture_writer_add_mark (self->recording->writer,