#define for_each_process(p) for (p = &init_task ; (p = next_task(p)) != &init_task ; ) if (p->real_parent->pid == NULL) printk("PROCESS: name: %s pid: %d n",p->comm,p->pid); else printk("THREAD: name: %s tid: %d n",p->comm,p->pid);