base-foc: implement Platform_thread execution_time

The return value is given in microseconds.

Issue #2908
This commit is contained in:
Martin Stein 2018-07-06 14:05:54 +02:00 committed by Christian Helmuth
parent 023de11dc6
commit efad33c3c5
2 changed files with 8 additions and 1 deletions

View File

@ -179,7 +179,7 @@ namespace Genode {
/**
* Return execution time consumed by the thread
*/
unsigned long long execution_time() const { return 0; }
unsigned long long execution_time() const;
/*******************************

View File

@ -35,6 +35,13 @@ namespace Fiasco {
using namespace Genode;
using namespace Fiasco;
unsigned long long Platform_thread::execution_time() const
{
Fiasco::l4_kernel_clock_t us = 0;
l4_thread_stats_time(_thread.local.data()->kcap(), &us);
return (unsigned long long)us;
}
int Platform_thread::start(void *ip, void *sp)
{