diff --git a/base-nova/src/base/pager/pager.cc b/base-nova/src/base/pager/pager.cc index 23b4df5ae9..1ad1df308f 100644 --- a/base-nova/src/base/pager/pager.cc +++ b/base-nova/src/base/pager/pager.cc @@ -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::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(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(); diff --git a/base-nova/src/core/include/platform_thread.h b/base-nova/src/core/include/platform_thread.h index 8ebd9a4940..a69aa9b11b 100644 --- a/base-nova/src/core/include/platform_thread.h +++ b/base-nova/src/core/include/platform_thread.h @@ -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; } diff --git a/base-nova/src/core/platform_thread.cc b/base-nova/src/core/platform_thread.cc index 530129bafb..a3d14af998 100644 --- a/base-nova/src/core/platform_thread.cc +++ b/base-nova/src/core/platform_thread.cc @@ -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(_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()