Kernel monitor, the return

Ashwin Chandra ashcs at ucla.edu
Mon Feb 14 22:24:44 PST 2005


In trying to create a simple kernel thread that prints out all the processes data and stack size, i still get a panic fault (vm_fault on no entry) at the printf statement...ive narrowed it down to the ru_idrss variable that is causing the problem, im not sure why. I thought maybe I was not locking properly or obseriving correct mutexes, but I have tried everything. If anyone knows why the fault is occurring at the printf, please let me know. =)

Ash


static void
kern_print(void)
{
  struct proc *p;

  sx_slock(&allproc_lock);
  FOREACH_PROC_IN_SYSTEM(p) {
    PROC_LOCK(p);
    if(p->p_state == PRS_NORMAL)
      {
        PROC_LOCK(p);
        printf("%d %d\n", (int)p->p_stats->p_ru.ru_isrss, (int)p->p_stats->p_ru.ru_idrss);
        PROC_UNLOCK(p);
      }
    PROC_UNLOCK(p);
  }
  sx_sunlock(&allproc_lock);


}



More information about the freebsd-hackers mailing list