2012-05-31 1 views
0

나는 sched_fair.c 안에 있는데 몇 가지 일을 기록하고 싶습니다 ..하지만 볼 수있는 각 sched_entity와 관련된 작업 (pid)을 알아야합니다 .. sched_entity 구조체의 정의에서 'CFS 스케줄러 : sched_entity에 할당 된 작업을 확인하는 방법은 무엇입니까?

struct sched_entity { 
    struct load_weight load;  /* for load-balancing */ 
    struct rb_node  run_node; 
    struct list_head group_node; 
    unsigned int  on_rq; 

    u64   exec_start; 
    u64   sum_exec_runtime; 
    u64   vruntime; 
    u64   prev_sum_exec_runtime; 

    u64   nr_migrations; 

#ifdef CONFIG_SCHEDSTATS 
    struct sched_statistics statistics; 
#endif 

#ifdef CONFIG_FAIR_GROUP_SCHED 
    struct sched_entity *parent; 
    /* rq on which this entity is (to be) queued: */ 
    struct cfs_rq  *cfs_rq; 
    /* rq "owned" by this entity/group: */ 
    struct cfs_rq  *my_q; 
#endif 
}; 

답변

3

주어 sched_entity * SE : t는

이것이 sched_entity위한 코드 (task_struct에) 상위 구조체에 대한 참조를 참조

task_struct 구조체 * p = task_of (SE);

은 포함 된 작업 구조체를 제공합니다 ..

관련 문제