mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
parent
252a10a859
commit
a23ac5f569
@ -23,6 +23,8 @@
|
||||
#include <platform.h>
|
||||
#include <nova_util.h>
|
||||
#include <util.h>
|
||||
#include <trace/source_registry.h>
|
||||
#include <base/snprintf.h>
|
||||
|
||||
/* NOVA includes */
|
||||
#include <nova/syscalls.h>
|
||||
@ -631,6 +633,43 @@ Platform::Platform() :
|
||||
|
||||
index = range->base() + range->elements();
|
||||
}
|
||||
|
||||
/* add idle ECs to trace sources */
|
||||
for (unsigned i = 0; i < hip->cpus(); i++) {
|
||||
|
||||
struct Idle_trace_source : Trace::Source::Info_accessor, Trace::Control,
|
||||
Trace::Source
|
||||
{
|
||||
Affinity::Location const affinity;
|
||||
unsigned const sc_sel;
|
||||
|
||||
/**
|
||||
* Trace::Source::Info_accessor interface
|
||||
*/
|
||||
Info trace_source_info() const override
|
||||
{
|
||||
char name[32];
|
||||
snprintf(name, sizeof(name), "idle%d", affinity.xpos());
|
||||
|
||||
uint64_t execution_time = 0;
|
||||
Nova::sc_ctrl(sc_sel, execution_time);
|
||||
|
||||
return { Trace::Session_label("kernel"), Trace::Thread_name(name),
|
||||
Trace::Execution_time(execution_time), affinity };
|
||||
}
|
||||
|
||||
Idle_trace_source(Affinity::Location affinity, unsigned sc_sel)
|
||||
:
|
||||
Trace::Source(*this, *this), affinity(affinity), sc_sel(sc_sel)
|
||||
{ }
|
||||
};
|
||||
|
||||
Idle_trace_source *source = new (core_mem_alloc())
|
||||
Idle_trace_source(Affinity::Location(i, 0, hip->cpus(), 1),
|
||||
sc_idle_base + i);
|
||||
|
||||
Trace::sources().insert(source);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,6 +27,11 @@ namespace Genode { namespace Trace {
|
||||
class Source;
|
||||
class Source_owner;
|
||||
class Source_registry;
|
||||
|
||||
/**
|
||||
* Return singleton instance of trace-source registry
|
||||
*/
|
||||
Source_registry &sources();
|
||||
} }
|
||||
|
||||
|
||||
|
@ -169,6 +169,17 @@ class Core_child : public Child_policy
|
||||
};
|
||||
|
||||
|
||||
/*******************
|
||||
** Trace support **
|
||||
*******************/
|
||||
|
||||
Trace::Source_registry &Trace::sources()
|
||||
{
|
||||
static Trace::Source_registry inst;
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
/***************
|
||||
** Core main **
|
||||
***************/
|
||||
@ -189,7 +200,6 @@ int main()
|
||||
|
||||
PDBG("--- create local services ---");
|
||||
|
||||
static Trace::Source_registry trace_sources;
|
||||
static Trace::Policy_registry trace_policies;
|
||||
|
||||
/*
|
||||
@ -219,14 +229,14 @@ int main()
|
||||
static Rm_root rm_root (e, e, e, &sliced_heap, core_env()->cap_session(),
|
||||
platform()->vm_start(), platform()->vm_size());
|
||||
static Cpu_root cpu_root (e, e, rm_root.pager_ep(), &sliced_heap,
|
||||
trace_sources);
|
||||
Trace::sources());
|
||||
static Pd_root pd_root (e, e, &sliced_heap);
|
||||
static Log_root log_root (e, &sliced_heap);
|
||||
static Io_mem_root io_mem_root (e, e, platform()->io_mem_alloc(),
|
||||
platform()->ram_alloc(), &sliced_heap);
|
||||
static Irq_root irq_root (core_env()->cap_session(),
|
||||
platform()->irq_alloc(), &sliced_heap);
|
||||
static Trace::Root trace_root (e, &sliced_heap, trace_sources, trace_policies);
|
||||
static Trace::Root trace_root (e, &sliced_heap, Trace::sources(), trace_policies);
|
||||
|
||||
/*
|
||||
* Play our role as parent of init and declare our services.
|
||||
@ -269,7 +279,7 @@ int main()
|
||||
|
||||
/* create CPU session for init and transfer all of the CPU quota to it */
|
||||
static Cpu_session_component
|
||||
cpu(e, e, rm_root.pager_ep(), &sliced_heap, trace_sources,
|
||||
cpu(e, e, rm_root.pager_ep(), &sliced_heap, Trace::sources(),
|
||||
"label=\"core\"", Affinity(), Cpu_session::QUOTA_LIMIT);
|
||||
Cpu_session_capability cpu_cap = core_env()->entrypoint()->manage(&cpu);
|
||||
Cpu_connection init_cpu("init");
|
||||
|
Loading…
x
Reference in New Issue
Block a user