mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
base: Add tracing support to CPU session interface
This commit is contained in:
parent
f0b5c5eca5
commit
a2b15349fd
@ -73,6 +73,18 @@ namespace Genode {
|
||||
void affinity(Thread_capability thread, Affinity::Location location) {
|
||||
call<Rpc_affinity>(thread, location); }
|
||||
|
||||
Dataspace_capability trace_control() {
|
||||
return call<Rpc_trace_control>(); }
|
||||
|
||||
unsigned trace_control_index(Thread_capability thread) {
|
||||
return call<Rpc_trace_control_index>(thread); }
|
||||
|
||||
Dataspace_capability trace_buffer(Thread_capability thread) {
|
||||
return call<Rpc_trace_buffer>(thread); }
|
||||
|
||||
Dataspace_capability trace_policy(Thread_capability thread) {
|
||||
return call<Rpc_trace_policy>(thread); }
|
||||
|
||||
void enable_vcpu(Thread_capability cap, addr_t vcpu_state) {
|
||||
call<Rpc_enable_vcpu>(cap, vcpu_state); }
|
||||
|
||||
|
@ -164,6 +164,10 @@ namespace Genode {
|
||||
void exception_handler(Thread_capability, Signal_context_capability);
|
||||
Affinity::Space affinity_space() const;
|
||||
void affinity(Thread_capability, Affinity::Location);
|
||||
Dataspace_capability trace_control();
|
||||
unsigned trace_control_index(Thread_capability);
|
||||
Dataspace_capability trace_buffer(Thread_capability);
|
||||
Dataspace_capability trace_policy(Thread_capability);
|
||||
|
||||
|
||||
/***********************************
|
||||
|
@ -66,6 +66,18 @@ namespace Genode {
|
||||
void affinity(Thread_capability thread, Affinity::Location location) {
|
||||
call<Rpc_affinity>(thread, location); }
|
||||
|
||||
Dataspace_capability trace_control() {
|
||||
return call<Rpc_trace_control>(); }
|
||||
|
||||
unsigned trace_control_index(Thread_capability thread) {
|
||||
return call<Rpc_trace_control_index>(thread); }
|
||||
|
||||
Dataspace_capability trace_buffer(Thread_capability thread) {
|
||||
return call<Rpc_trace_buffer>(thread); }
|
||||
|
||||
Dataspace_capability trace_policy(Thread_capability thread) {
|
||||
return call<Rpc_trace_policy>(thread); }
|
||||
|
||||
|
||||
/*****************************
|
||||
* Linux-specific extension **
|
||||
|
@ -155,6 +155,10 @@ namespace Genode {
|
||||
void exception_handler(Thread_capability, Signal_context_capability);
|
||||
Affinity::Space affinity_space() const;
|
||||
void affinity(Thread_capability, Affinity::Location);
|
||||
Dataspace_capability trace_control();
|
||||
unsigned trace_control_index(Thread_capability);
|
||||
Dataspace_capability trace_buffer(Thread_capability);
|
||||
Dataspace_capability trace_policy(Thread_capability);
|
||||
|
||||
|
||||
/*******************************
|
||||
|
@ -82,6 +82,18 @@ namespace Genode {
|
||||
void affinity(Thread_capability thread, Affinity::Location location) {
|
||||
call<Rpc_affinity>(thread, location); }
|
||||
|
||||
Dataspace_capability trace_control() {
|
||||
return call<Rpc_trace_control>(); }
|
||||
|
||||
unsigned trace_control_index(Thread_capability thread) {
|
||||
return call<Rpc_trace_control_index>(thread); }
|
||||
|
||||
Dataspace_capability trace_buffer(Thread_capability thread) {
|
||||
return call<Rpc_trace_buffer>(thread); }
|
||||
|
||||
Dataspace_capability trace_policy(Thread_capability thread) {
|
||||
return call<Rpc_trace_policy>(thread); }
|
||||
|
||||
private:
|
||||
|
||||
Native_capability pause_sync(Thread_capability target) {
|
||||
|
@ -161,6 +161,10 @@ namespace Genode {
|
||||
void exception_handler(Thread_capability, Signal_context_capability);
|
||||
Affinity::Space affinity_space() const;
|
||||
void affinity(Thread_capability, Affinity::Location);
|
||||
Dataspace_capability trace_control();
|
||||
unsigned trace_control_index(Thread_capability);
|
||||
Dataspace_capability trace_buffer(Thread_capability);
|
||||
Dataspace_capability trace_policy(Thread_capability);
|
||||
|
||||
|
||||
/******************************
|
||||
|
@ -65,6 +65,18 @@ namespace Genode {
|
||||
|
||||
void affinity(Thread_capability thread, Affinity::Location location) {
|
||||
call<Rpc_affinity>(thread, location); }
|
||||
|
||||
Dataspace_capability trace_control() {
|
||||
return call<Rpc_trace_control>(); }
|
||||
|
||||
unsigned trace_control_index(Thread_capability thread) {
|
||||
return call<Rpc_trace_control_index>(thread); }
|
||||
|
||||
Dataspace_capability trace_buffer(Thread_capability thread) {
|
||||
return call<Rpc_trace_buffer>(thread); }
|
||||
|
||||
Dataspace_capability trace_policy(Thread_capability thread) {
|
||||
return call<Rpc_trace_policy>(thread); }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -222,6 +222,42 @@ namespace Genode {
|
||||
return (prio*pf_prio_limit)/Cpu_session::PRIORITY_LIMIT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request trace control dataspace
|
||||
*
|
||||
* The trace-control dataspace is used to propagate tracing
|
||||
* control information from core to the threads of a CPU session.
|
||||
*
|
||||
* The trace-control dataspace is accounted to the CPU session.
|
||||
*/
|
||||
virtual Dataspace_capability trace_control() = 0;
|
||||
|
||||
/**
|
||||
* Request index of a trace control block for given thread
|
||||
*
|
||||
* The trace control dataspace contains the control blocks for
|
||||
* all threads of the CPU session. Each thread gets assigned a
|
||||
* different index by the CPU service.
|
||||
*/
|
||||
virtual unsigned trace_control_index(Thread_capability thread) = 0;
|
||||
|
||||
/**
|
||||
* Request trace buffer for the specified thread
|
||||
*
|
||||
* The trace buffer is not accounted to the CPU session. It is
|
||||
* owned by a TRACE session.
|
||||
*/
|
||||
virtual Dataspace_capability trace_buffer(Thread_capability thread) = 0;
|
||||
|
||||
/**
|
||||
* Request trace policy
|
||||
*
|
||||
* The trace policy buffer is not accounted to the CPU session. It
|
||||
* is owned by a TRACE session.
|
||||
*/
|
||||
virtual Dataspace_capability trace_policy(Thread_capability thread) = 0;
|
||||
|
||||
|
||||
/*********************
|
||||
** RPC declaration **
|
||||
*********************/
|
||||
@ -247,6 +283,10 @@ namespace Genode {
|
||||
GENODE_RPC(Rpc_single_step, void, single_step, Thread_capability, bool);
|
||||
GENODE_RPC(Rpc_affinity_space, Affinity::Space, affinity_space);
|
||||
GENODE_RPC(Rpc_affinity, void, affinity, Thread_capability, Affinity::Location);
|
||||
GENODE_RPC(Rpc_trace_control, Dataspace_capability, trace_control);
|
||||
GENODE_RPC(Rpc_trace_control_index, unsigned, trace_control_index, Thread_capability);
|
||||
GENODE_RPC(Rpc_trace_buffer, Dataspace_capability, trace_buffer, Thread_capability);
|
||||
GENODE_RPC(Rpc_trace_policy, Dataspace_capability, trace_policy, Thread_capability);
|
||||
|
||||
/*
|
||||
* 'GENODE_RPC_INTERFACE' declaration done manually
|
||||
@ -270,8 +310,12 @@ namespace Genode {
|
||||
Meta::Type_tuple<Rpc_single_step,
|
||||
Meta::Type_tuple<Rpc_affinity_space,
|
||||
Meta::Type_tuple<Rpc_affinity,
|
||||
Meta::Type_tuple<Rpc_trace_control,
|
||||
Meta::Type_tuple<Rpc_trace_control_index,
|
||||
Meta::Type_tuple<Rpc_trace_buffer,
|
||||
Meta::Type_tuple<Rpc_trace_policy,
|
||||
Meta::Empty>
|
||||
> > > > > > > > > > > > > Rpc_functions;
|
||||
> > > > > > > > > > > > > > > > > Rpc_functions;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -213,6 +213,34 @@ void Cpu_session_component::affinity(Thread_capability thread_cap,
|
||||
}
|
||||
|
||||
|
||||
Dataspace_capability Cpu_session_component::trace_control()
|
||||
{
|
||||
/* not implemented */
|
||||
return Dataspace_capability();
|
||||
}
|
||||
|
||||
|
||||
unsigned Cpu_session_component::trace_control_index(Thread_capability thread)
|
||||
{
|
||||
/* not implemented */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Dataspace_capability Cpu_session_component::trace_buffer(Thread_capability thread)
|
||||
{
|
||||
/* not implemented */
|
||||
return Dataspace_capability();
|
||||
}
|
||||
|
||||
|
||||
Dataspace_capability Cpu_session_component::trace_policy(Thread_capability thread)
|
||||
{
|
||||
/* not implemented */
|
||||
return Dataspace_capability();
|
||||
}
|
||||
|
||||
|
||||
Cpu_session_component::Cpu_session_component(Rpc_entrypoint *thread_ep,
|
||||
Pager_entrypoint *pager_ep,
|
||||
Allocator *md_alloc,
|
||||
|
@ -154,6 +154,10 @@ namespace Genode {
|
||||
void exception_handler(Thread_capability, Signal_context_capability);
|
||||
Affinity::Space affinity_space() const;
|
||||
void affinity(Thread_capability, Affinity::Location);
|
||||
Dataspace_capability trace_control();
|
||||
unsigned trace_control_index(Thread_capability);
|
||||
Dataspace_capability trace_buffer(Thread_capability);
|
||||
Dataspace_capability trace_policy(Thread_capability);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -204,6 +204,30 @@ void Cpu_session_component::affinity(Thread_capability thread_cap,
|
||||
}
|
||||
|
||||
|
||||
Dataspace_capability Cpu_session_component::trace_control()
|
||||
{
|
||||
return _parent_cpu_session.trace_control();
|
||||
}
|
||||
|
||||
|
||||
unsigned Cpu_session_component::trace_control_index(Thread_capability thread)
|
||||
{
|
||||
return _parent_cpu_session.trace_control_index(thread);
|
||||
}
|
||||
|
||||
|
||||
Dataspace_capability Cpu_session_component::trace_buffer(Thread_capability thread)
|
||||
{
|
||||
return _parent_cpu_session.trace_buffer(thread);
|
||||
}
|
||||
|
||||
|
||||
Dataspace_capability Cpu_session_component::trace_policy(Thread_capability thread)
|
||||
{
|
||||
return _parent_cpu_session.trace_policy(thread);
|
||||
}
|
||||
|
||||
|
||||
Cpu_session_component::Cpu_session_component(Signal_receiver *exception_signal_receiver, const char *args)
|
||||
: _parent_cpu_session(env()->parent()->session<Cpu_session>(args)),
|
||||
_exception_signal_receiver(exception_signal_receiver)
|
||||
|
@ -72,6 +72,10 @@ class Cpu_session_component : public Rpc_object<Cpu_session>
|
||||
void single_step(Thread_capability thread, bool enable);
|
||||
Affinity::Space affinity_space() const;
|
||||
void affinity(Thread_capability, Affinity::Location);
|
||||
Dataspace_capability trace_control();
|
||||
unsigned trace_control_index(Thread_capability);
|
||||
Dataspace_capability trace_buffer(Thread_capability);
|
||||
Dataspace_capability trace_policy(Thread_capability);
|
||||
};
|
||||
|
||||
#endif /* _CPU_SESSION_COMPONENT_H_ */
|
||||
|
@ -134,6 +134,18 @@ namespace Noux {
|
||||
|
||||
void affinity(Thread_capability thread, Affinity::Location location) {
|
||||
_cpu.affinity(thread, location); }
|
||||
|
||||
Dataspace_capability trace_control() {
|
||||
return _cpu.trace_control(); }
|
||||
|
||||
unsigned trace_control_index(Thread_capability thread) {
|
||||
return _cpu.trace_control_index(thread); }
|
||||
|
||||
Dataspace_capability trace_buffer(Thread_capability thread) {
|
||||
return _cpu.trace_buffer(thread); }
|
||||
|
||||
Dataspace_capability trace_policy(Thread_capability thread) {
|
||||
return _cpu.trace_policy(thread); }
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user