nova: construct pager name out of client name

Ease debugging to find out which client is dying actually.
This commit is contained in:
Alexander Boettcher 2013-02-19 11:14:21 +01:00 committed by Norman Feske
parent c374f294c8
commit 5380c09c6f
3 changed files with 20 additions and 6 deletions

View File

@ -64,7 +64,11 @@ void Pager_object::_page_fault_handler()
if (ret) {
if (obj->client_recall() != Nova::NOVA_OK) {
PERR("recall failed");
char client_name[Context::NAME_LEN];
myself->name(client_name, sizeof(client_name));
PWRN("unresolvable page fault since recall failed, '%s'",
client_name);
Native_capability pager_obj = obj->Object_pool<Pager_object>::Entry::cap();
revoke(pager_obj.dst(), true);
@ -96,8 +100,11 @@ void Pager_object::_exception_handler(addr_t portal_id)
}
}
else {
PWRN("unresolvable exception at ip 0x%lx, exception portal 0x%lx",
fault_ip, portal_id);
char client_name[Context::NAME_LEN];
myself->name(client_name, sizeof(client_name));
PWRN("unresolvable exception at ip 0x%lx, exception portal 0x%lx, "
"'%s'", fault_ip, portal_id, client_name);
Nova::revoke(Obj_crd(portal_id, 0));
obj->_state.dead = true;
@ -235,11 +242,15 @@ void Pager_object::cleanup_call()
Pager_object::Pager_object(unsigned long badge)
: Thread_base("pager", PF_HANDLER_STACK_SIZE), _badge(badge)
: Thread_base("pager:", PF_HANDLER_STACK_SIZE), _badge(badge)
{
class Create_exception_pt_failed { };
uint8_t res;
/* construct pager name out of client name */
strncpy(_context->name + 6, reinterpret_cast<char const *>(badge),
sizeof(_context->name) - 6);
addr_t pd_sel = __core_pd_sel;
_pt_cleanup = cap_selector_allocator()->alloc();
_sm_state_notify = cap_selector_allocator()->alloc();

View File

@ -36,6 +36,7 @@ namespace Genode {
unsigned _cpu_no;
bool _is_main_thread;
bool _is_vcpu;
char _name[Thread_base::Context::NAME_LEN];
addr_t _sel_ec() { return _id_base; }
addr_t _sel_sc() { return _id_base + 1; }

View File

@ -305,7 +305,7 @@ void Platform_thread::single_step(bool on)
unsigned long Platform_thread::pager_object_badge() const
{
return Native_thread::INVALID_INDEX;
return reinterpret_cast<unsigned long>(_name);
}
@ -314,7 +314,9 @@ Platform_thread::Platform_thread(const char *name, unsigned, int thread_id)
_pd(0), _pager(0), _id_base(cap_selector_allocator()->alloc(1)),
_sel_exc_base(Native_thread::INVALID_INDEX), _cpu_no(0),
_is_main_thread(false), _is_vcpu(false)
{ }
{
strncpy(_name, name, sizeof(_name));
}
Platform_thread::~Platform_thread()