Hi, When a task is switched in by scheduler, I want to know the running state of all the other tasks in the same group with the switched in task. So I add the following code in the schedule().
struct list_head *lp; struct task_struct *p; printk(KERN_INFO "pid: %d, name: %s, state: %ld\n", grphead->pid, grphead->comm, grphead->state); list_for_each(lp, &(grphead->thread_group)) //find all tasks in the same group { p = list_entry(lp, struct task_struct, thread_group); //get the task_struct from the entry_list printk(KERN_INFO "sibling tgid: %d, pid: %d, name: %s, state: %ld\n", p->tgid, p->pid, p->comm, p->state); } But the system will crash when execute at "list_for_each". I implemented the same code successfully in a kernel module, but it cause system crash when put the code in schedule(). Can anyone tell me why? Thank you very much. Lason -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel