hw: mark caller when printing an activity-table

ref #989
This commit is contained in:
Martin Stein 2013-12-09 16:41:23 +01:00 committed by Norman Feske
parent 906b4dc90a
commit 49eeb485d9
2 changed files with 7 additions and 4 deletions

View File

@ -602,13 +602,13 @@ void Thread::_print_activity_table()
for (unsigned id = 0; id < MAX_THREADS; id++) { for (unsigned id = 0; id < MAX_THREADS; id++) {
Thread * const t = Thread::pool()->object(id); Thread * const t = Thread::pool()->object(id);
if (!t) { continue; } if (!t) { continue; }
t->_print_activity(); t->_print_activity(t == this);
} }
return; return;
} }
void Thread::_print_activity() void Thread::_print_activity(bool const printing_thread)
{ {
static Thread * idle = dynamic_cast<Thread *>(cpu_scheduler()->idle()); static Thread * idle = dynamic_cast<Thread *>(cpu_scheduler()->idle());
Genode::printf("\033[33m[%u] %s", pd_id(), pd_label()); Genode::printf("\033[33m[%u] %s", pd_id(), pd_label());
@ -623,7 +623,8 @@ void Thread::_print_activity()
Genode::printf("\033[32m init\033[0m"); Genode::printf("\033[32m init\033[0m");
break; } break; }
case SCHEDULED: { case SCHEDULED: {
Genode::printf("\033[32m run\033[0m"); if (!printing_thread) { Genode::printf("\033[32m run\033[0m"); }
else { Genode::printf("\033[32m debug\033[0m"); }
break; } break; }
case AWAITS_IPC: { case AWAITS_IPC: {
_print_activity_when_awaits_ipc(); _print_activity_when_awaits_ipc();

View File

@ -182,8 +182,10 @@ class Kernel::Thread
/** /**
* Print the activity of the thread * Print the activity of the thread
*
* \param printing_thread wether this thread caused the debugging
*/ */
void _print_activity(); void _print_activity(bool const printing_thread);
/** /**
* Print the activity of the thread when it awaits a message * Print the activity of the thread when it awaits a message