vbox: use emt thread names

- eases debugging on smp setups

Issue #2110
This commit is contained in:
Alexander Boettcher 2016-09-23 10:10:01 +02:00 committed by Christian Helmuth
parent 14ef7a5312
commit a8495a0dfe
14 changed files with 35 additions and 27 deletions

View File

@ -71,9 +71,10 @@ class Vmm::Vcpu_dispatcher : public T
Vcpu_dispatcher(Genode::size_t stack_size, Pd_session &pd,
Cpu_session * cpu_session,
Genode::Affinity::Location location)
Genode::Affinity::Location location,
const char * name = "vCPU dispatcher")
:
T(WEIGHT, "vCPU dispatcher", stack_size, location), _pd(pd)
T(WEIGHT, name, stack_size, location), _pd(pd)
{
using namespace Genode;
@ -87,8 +88,9 @@ class Vmm::Vcpu_dispatcher : public T
Vcpu_dispatcher(Genode::size_t stack_size, Pd_session &pd,
Cpu_session * cpu_session,
Genode::Affinity::Location location,
X attr, void *(*start_routine) (void *), void *arg)
: T(attr, start_routine, arg, stack_size, "vCPU dispatcher", nullptr, location),
X attr, void *(*start_routine) (void *), void *arg,
const char * name = "vCPU dispatcher")
: T(attr, start_routine, arg, stack_size, name, nullptr, location),
_pd(pd)
{
using namespace Genode;

View File

@ -86,7 +86,8 @@ bool create_emt_vcpu(pthread_t * thread, size_t stack_size,
void *(*start_routine)(void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id,
const char * name)
{
/* no hardware acceleration support */
return false;

View File

@ -706,7 +706,8 @@ bool create_emt_vcpu(pthread_t * thread, size_t stack_size,
void *(*start_routine)(void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id,
const char * name)
{
/* No support for multiple vcpus */
return false;

View File

@ -292,7 +292,7 @@ bool create_emt_vcpu(pthread_t * pthread, size_t stack,
void *(*start_routine)(void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
{
Nova::Hip * hip = hip_rom.local_addr<Nova::Hip>();
@ -304,12 +304,12 @@ bool create_emt_vcpu(pthread_t * pthread, size_t stack,
if (hip->has_feature_vmx())
vcpu_handler = new (0x10) Vcpu_handler_vmx(stack, attr, start_routine,
arg, cpu_session, location,
cpu_id);
cpu_id, name);
if (hip->has_feature_svm())
vcpu_handler = new (0x10) Vcpu_handler_svm(stack, attr, start_routine,
arg, cpu_session, location,
cpu_id);
cpu_id, name);
Assert(!(reinterpret_cast<unsigned long>(vcpu_handler) & 0xf));

View File

@ -728,11 +728,12 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
void *(*start_routine) (void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
:
Vmm::Vcpu_dispatcher<pthread>(stack_size, *Genode::env()->pd_session(),
cpu_session, location,
attr ? *attr : 0, start_routine, arg),
attr ? *attr : 0, start_routine, arg,
name),
_vcpu(cpu_session, location),
_ec_sel(Genode::cap_map()->insert()),
_irq_win(false),

View File

@ -88,10 +88,10 @@ class Vcpu_handler_svm : public Vcpu_handler
void *(*start_routine) (void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
:
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
location, cpu_id)
location, cpu_id, name)
{
using namespace Nova;

View File

@ -162,10 +162,10 @@ class Vcpu_handler_vmx : public Vcpu_handler
void *(*start_routine) (void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
:
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
location, cpu_id)
location, cpu_id, name)
{
using namespace Nova;

View File

@ -34,7 +34,8 @@ bool create_emt_vcpu(pthread_t * pthread, size_t stack,
void *(*start_routine)(void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id);
unsigned int cpu_id,
const char * name);
uint64_t genode_cpu_hz();

View File

@ -95,7 +95,7 @@ static int create_thread(pthread_t *thread, const pthread_attr_t *attr,
Genode::Affinity::Location location(space.location_of_index(cpu_id));
if (create_emt_vcpu(thread, stack_size, attr, start_routine, arg,
cpu_session, location, cpu_id))
cpu_session, location, cpu_id, rtthread->szName))
return 0;
/*
* The virtualization layer had no need to setup the EMT

View File

@ -551,7 +551,7 @@ bool create_emt_vcpu(pthread_t * pthread, ::size_t stack,
void *(*start_routine)(void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
{
Nova::Hip * hip = hip_rom.local_addr<Nova::Hip>();
@ -563,12 +563,12 @@ bool create_emt_vcpu(pthread_t * pthread, ::size_t stack,
if (hip->has_feature_vmx())
vcpu_handler = new (0x10) Vcpu_handler_vmx(stack, attr, start_routine,
arg, cpu_session, location,
cpu_id);
cpu_id, name);
if (hip->has_feature_svm())
vcpu_handler = new (0x10) Vcpu_handler_svm(stack, attr, start_routine,
arg, cpu_session, location,
cpu_id);
cpu_id, name);
Assert(!(reinterpret_cast<unsigned long>(vcpu_handler) & 0xf));

View File

@ -730,11 +730,12 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>,
void *(*start_routine) (void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
:
Vmm::Vcpu_dispatcher<pthread>(stack_size, *Genode::env()->pd_session(),
cpu_session, location,
attr ? *attr : 0, start_routine, arg),
attr ? *attr : 0, start_routine,
arg, name),
_vcpu(cpu_session, location),
_ec_sel(Genode::cap_map()->insert()),
_irq_win(false),

View File

@ -88,10 +88,10 @@ class Vcpu_handler_svm : public Vcpu_handler
void *(*start_routine) (void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
:
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
location, cpu_id)
location, cpu_id, name)
{
using namespace Nova;

View File

@ -170,10 +170,10 @@ class Vcpu_handler_vmx : public Vcpu_handler
void *(*start_routine) (void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id)
unsigned int cpu_id, const char * name)
:
Vcpu_handler(stack_size, attr, start_routine, arg, cpu_session,
location, cpu_id)
location, cpu_id, name)
{
using namespace Nova;

View File

@ -31,7 +31,8 @@ bool create_emt_vcpu(pthread_t * pthread, ::size_t stack,
void *(*start_routine)(void *), void *arg,
Genode::Cpu_session * cpu_session,
Genode::Affinity::Location location,
unsigned int cpu_id);
unsigned int cpu_id,
const char * name);
uint64_t genode_cpu_hz();