foc: disable thread execution time readout

Issue #4357
This commit is contained in:
Alexander Boettcher 2022-01-05 14:41:15 +01:00 committed by Christian Helmuth
parent 4ac553e5ff
commit 46c9927294
2 changed files with 16 additions and 5 deletions

View File

@ -32,7 +32,10 @@ using namespace Foc;
Trace::Execution_time Platform_thread::execution_time() const
{
Foc::l4_kernel_clock_t us = 0;
/* syscall does not return ever, if thread is on remote cpu,
see issue #4357
l4_thread_stats_time(_thread.local.data()->kcap(), &us);
*/
return { us, 0, 10000 /* quantum readable ?*/, _prio };
}

View File

@ -78,14 +78,22 @@ void Thread::start()
Info trace_source_info() const override
{
uint64_t const sc_time = 0;
addr_t const kcap = (addr_t) platform_thread.pager_object_badge();
using namespace Foc;
l4_kernel_clock_t ec_time = 0;
l4_msgtag_t res = l4_thread_stats_time(kcap, &ec_time);
if (l4_error(res))
Genode::error("cpu time for ", thread.name(),
" is not available ", l4_error(res));
/*
* The 'l4_thread_stats_time' syscall does not always return if
* the thread is on remote CPU. Disable the feature to keep core
* safe (see issue #4357).
*/
if (0) {
addr_t const kcap = (addr_t) platform_thread.pager_object_badge();
l4_msgtag_t res = l4_thread_stats_time(kcap, &ec_time);
if (l4_error(res))
Genode::error("cpu time for ", thread.name(),
" is not available ", l4_error(res));
}
return { Session_label("core"), thread.name(),
Trace::Execution_time(ec_time, sc_time, 10000,