mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
base-foc: implement Platform_thread execution_time
The return value is given in microseconds. Issue #2908
This commit is contained in:
parent
023de11dc6
commit
efad33c3c5
@ -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;
|
||||
|
||||
|
||||
/*******************************
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user