The "Sched Events" plugin uses the sched_wakeup events to visualize the wake up latency of the task. This patch deals with the corner case, when we have a second sched_wakeup events which tries to wake up a task which is already running. Signed-off-by: Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> --- kernel-shark-qt/src/plugins/SchedEvents.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel-shark-qt/src/plugins/SchedEvents.cpp b/kernel-shark-qt/src/plugins/SchedEvents.cpp index b4596c9..ea07662 100644 --- a/kernel-shark-qt/src/plugins/SchedEvents.cpp +++ b/kernel-shark-qt/src/plugins/SchedEvents.cpp @@ -139,6 +139,21 @@ static void pluginDraw(plugin_sched_context *plugin_ctx, ksmodel_get_entry_back(histo, bin, false, plugin_wakeup_match_rec_pid, pid, col, &indexOpen); + + if (entryOpen) { + int cpu = ksmodel_get_cpu_back(histo, bin, + pid, + false, + col, + nullptr); + if (cpu >= 0) { + /* + * The task is already running. Ignore + * this wakeup event. + */ + entryOpen = nullptr; + } + } } if (rec) { -- 2.17.1