SMP - Print cpu of the process

- adds '4' to print processes assigned to each cpu without printing
  the process it is blocked on (a lightweight '1')
This commit is contained in:
Tomas Hruby
2010-09-15 14:11:01 +00:00
parent 0ac9b6d4cf
commit 454589debd
3 changed files with 34 additions and 7 deletions

View File

@@ -48,6 +48,9 @@ extern void poweroff16_end();
PUBLIC void * k_stacks;
FORWARD _PROTOTYPE( void ser_debug, (int c));
#ifdef CONFIG_SMP
FORWARD _PROTOTYPE( void ser_dump_proc_cpu, (void));
#endif
PUBLIC __dead void arch_monitor(void)
{
@@ -471,6 +474,11 @@ PRIVATE void ser_debug(const int c)
case '3':
ser_dump_segs();
break;
#ifdef CONFIG_SMP
case '4':
ser_dump_proc_cpu();
break;
#endif
#if DEBUG_TRACE
#define TOGGLECASE(ch, flag) \
case ch: { \
@@ -495,7 +503,6 @@ PRIVATE void ser_debug(const int c)
serial_debug_active = 0;
}
PUBLIC void ser_dump_proc()
{
struct proc *pp;
@@ -508,6 +515,23 @@ PUBLIC void ser_dump_proc()
}
}
#ifdef CONFIG_SMP
PRIVATE void ser_dump_proc_cpu(void)
{
struct proc *pp;
unsigned cpu;
for (cpu = 0; cpu < ncpus; cpu++) {
printf("CPU %d processes : \n", cpu);
for (pp= BEG_USER_ADDR; pp < END_PROC_ADDR; pp++) {
if (isemptyp(pp) || pp->p_cpu != cpu)
continue;
print_proc(pp);
}
}
}
#endif
#if SPROFILE
PUBLIC int arch_init_profile_clock(const u32_t freq)