sched.h와 sched.c를 뒤져 봤는데...
run_list, runqueue 를 찾아서 보았습니다...
그런데... 이해가 잘 안 가내요... ㅡ.ㅜ;
제가 원하는 건 현재 Run Queue에 있는 프로세스들을 보려고 합니다...
for_eash_task 를 돌려서 TASK_RUNNING state만 찾아도 같을것 같은데... Run Queue 라는 걸로 해 보고 싶습니다...
어떻게 하면 되나요?
직접 실행해보진 않았습니다만..대충 다음과 같이 하면 되지 않을까 합니다.
struct task_struct * ts ; spin_lock_irq(&runqueue_lock); for( ts = init_task.next_run ; ts != NULL ; ts = ts->next_run ) { printk("process id (in run queue): %d\n", ts->pid) ; } spin_unlock_irq(&runqueue_lock);
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
직접 실행해보진 않았습니다만..대충 다음과 같이 하면 되지 않을까 합니다
직접 실행해보진 않았습니다만..대충 다음과 같이 하면 되지 않을까 합니다.
struct task_struct * ts ;
spin_lock_irq(&runqueue_lock);
for( ts = init_task.next_run ; ts != NULL ; ts = ts->next_run )
{
printk("process id (in run queue): %d\n", ts->pid) ;
}
spin_unlock_irq(&runqueue_lock);
댓글 달기