From 7c0894159f769869da7e5faa03ff026747651806 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 9 Jan 2018 14:35:27 +0100 Subject: [PATCH] top: consider dead thread with execution time which executed in the current measurement period but are now dead. Keep the Entry object up to next period, where the recent_execution_time will become 0 since it will not execute definitely. Issue #2638 --- repos/os/src/app/top/main.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repos/os/src/app/top/main.cc b/repos/os/src/app/top/main.cc index ca74bd4e8b..1fdc46aaba 100644 --- a/repos/os/src/app/top/main.cc +++ b/repos/os/src/app/top/main.cc @@ -119,8 +119,10 @@ struct Trace_subject_registry e->update(trace.subject_info(id)); - /* purge dead threads */ - if (e->info.state() == Genode::Trace::Subject_info::DEAD) { + /* remove dead threads which did not run in the last period */ + if (e->info.state() == Genode::Trace::Subject_info::DEAD && + !e->recent_execution_time) { + trace.free(e->id); _entries.remove(e); Genode::destroy(alloc, e);