nova: provide exec. time caused by cross core IPC

Issue #2646
This commit is contained in:
Alexander Boettcher 2017-09-07 23:08:07 +02:00 committed by Norman Feske
parent 9269d09e18
commit 711cce3f4d
5 changed files with 35 additions and 21 deletions

View File

@ -395,10 +395,10 @@ namespace Nova {
ALWAYS_INLINE
inline uint8_t sc_ctrl(unsigned sc, unsigned long long &time)
inline uint8_t sc_ctrl(unsigned sc, unsigned long long &time, uint8_t op = 0)
{
mword_t time_h = 0, time_l = 0;
uint8_t res = syscall_5(NOVA_SC_CTRL, 0, sc, time_h, time_l);
uint8_t res = syscall_5(NOVA_SC_CTRL, op, sc, time_h, time_l);
time = time_h;
time = (time << 32ULL) | time_l;
return res;

View File

@ -315,10 +315,10 @@ namespace Nova {
ALWAYS_INLINE
inline uint8_t sc_ctrl(mword_t sm, unsigned long long &time)
inline uint8_t sc_ctrl(mword_t sm, unsigned long long &time, uint8_t op = 0)
{
mword_t time_h = 0, time_l = 0;
uint8_t res = syscall_5(NOVA_SC_CTRL, 0, sm, time_h, time_l);
uint8_t res = syscall_5(NOVA_SC_CTRL, op, sm, time_h, time_l);
time = time_h;
time = (time << 32ULL) | (time_l & 0xFFFFFFFFULL);
return res;

View File

@ -1 +1 @@
d6729d1669adce07fa0e393ce3f1928e0fa425ed
4856db61cb48605b879dc27b5b70e5366f7e5fee

View File

@ -4,7 +4,7 @@ DOWNLOADS := nova.git
# r9 branch - use r9_debug for more verbose kernel messages
URL(nova) := https://github.com/alex-ab/NOVA.git
REV(nova) := ef4b2877eb34b541d76a86810520369bdbd9d258
REV(nova) := 1a6ff1c7007d74bd9e073689f49e46c48e8c0c2d
DIR(nova) := src/kernel/nova
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))

View File

@ -756,12 +756,13 @@ Platform::Platform() :
if (!hip->is_cpu_enabled(kernel_cpu_id))
continue;
struct Idle_trace_source : public Trace::Source::Info_accessor,
private Trace::Control,
private Trace::Source
struct Trace_source : public Trace::Source::Info_accessor,
private Trace::Control,
private Trace::Source
{
Affinity::Location const affinity;
unsigned const sc_sel;
Genode::String<8> const name;
/**
* Trace::Source::Info_accessor interface
@ -770,29 +771,42 @@ Platform::Platform() :
{
uint64_t sc_time = 0;
uint8_t res = Nova::sc_ctrl(sc_sel, sc_time);
if (res != Nova::NOVA_OK)
warning("sc_ctrl on idle SC cap, res=", res);
enum SYSCALL_OP { IDLE_SC = 0, CROSS_SC = 1 };
uint8_t syscall_op = (name == "cross") ? CROSS_SC : IDLE_SC;
return { Session_label("kernel"), Trace::Thread_name("idle"),
uint8_t res = Nova::sc_ctrl(sc_sel, sc_time, syscall_op);
if (res != Nova::NOVA_OK)
warning("sc_ctrl on idle SC cap, op=", syscall_op,
", res=", res);
return { Session_label("kernel"), Trace::Thread_name(name),
Trace::Execution_time(sc_time), affinity };
}
Idle_trace_source(Trace::Source_registry &registry,
Affinity::Location affinity, unsigned sc_sel)
Trace_source(Trace::Source_registry &registry,
Affinity::Location const affinity,
unsigned const sc_sel,
char const * type_name)
:
Trace::Control(),
Trace::Source(*this, *this), affinity(affinity), sc_sel(sc_sel)
Trace::Source(*this, *this), affinity(affinity),
sc_sel(sc_sel), name(type_name)
{
registry.insert(this);
}
};
new (core_mem_alloc())
Idle_trace_source(Trace::sources(),
Affinity::Location(genode_cpu_id, 0,
_cpus.width(), 1),
sc_idle_base + kernel_cpu_id);
new (core_mem_alloc()) Trace_source(Trace::sources(),
Affinity::Location(genode_cpu_id, 0,
_cpus.width(), 1),
sc_idle_base + kernel_cpu_id,
"idle");
new (core_mem_alloc()) Trace_source(Trace::sources(),
Affinity::Location(genode_cpu_id, 0,
_cpus.width(), 1),
sc_idle_base + kernel_cpu_id,
"cross");
}
/* add echo thread and EC root thread to trace sources */