trace: support more facets of execution time

- execution time per thread context
- execution time per scheduling context
- quantum and priority

Issue #3192
This commit is contained in:
Alexander Boettcher
2017-09-11 13:03:28 +02:00
committed by Christian Helmuth
parent 66f49e6c42
commit ae16edf1d6
21 changed files with 74 additions and 42 deletions

View File

@@ -17,6 +17,7 @@
/* Genode includes */
#include <base/thread_state.h>
#include <util/string.h>
#include <base/trace/types.h>
/* core includes */
#include <pager.h>
@@ -140,7 +141,7 @@ class Genode::Platform_thread : public List<Platform_thread>::Element
/**
* Return execution time consumed by the thread
*/
unsigned long long execution_time() const;
Trace::Execution_time execution_time() const;
/************************

View File

@@ -586,9 +586,10 @@ Platform::Platform()
seL4_BenchmarkGetThreadUtilisation(tcb_sel.value());
uint64_t execution_time = buf[BENCHMARK_IDLE_TCBCPU_UTILISATION];
uint64_t sc_time = 0; /* not supported */
return { Session_label("kernel"), Trace::Thread_name("idle"),
Trace::Execution_time(execution_time), affinity };
Trace::Execution_time(execution_time, sc_time), affinity };
}
Idle_trace_source(Trace::Source_registry &registry,

View File

@@ -258,11 +258,11 @@ Platform_thread::~Platform_thread()
platform_specific().core_sel_alloc().free(_pager_obj_sel);
}
unsigned long long Platform_thread::execution_time() const
Trace::Execution_time Platform_thread::execution_time() const
{
if (!Thread::myself() || !Thread::myself()->utcb()) {
error("don't know myself");
return 0;
return { 0, 0, 10000, _priority };
}
Thread &myself = *Thread::myself();
@@ -272,8 +272,9 @@ unsigned long long Platform_thread::execution_time() const
/* kernel puts execution time on ipc buffer of calling thread */
seL4_BenchmarkGetThreadUtilisation(_info.tcb_sel.value());
uint64_t const execution_time = values[BENCHMARK_TCB_UTILISATION];
return execution_time;
uint64_t const ec_time = values[BENCHMARK_TCB_UTILISATION];
uint64_t const sc_time = 0; /* not supported */
return { ec_time, sc_time, 10000, _priority};
}
void Platform_thread::setup_vcpu(Cap_sel ept, Cap_sel notification)

View File

@@ -125,7 +125,7 @@ void Thread::start()
uint64_t const thread_time = buf[BENCHMARK_TCB_UTILISATION];
return { Session_label("core"), _thread.name(),
Trace::Execution_time(thread_time), _thread._affinity };
Trace::Execution_time(thread_time, 0), _thread._affinity };
}