【发布时间】:2012-06-05 13:36:40
【问题描述】:
我在 sched_fair.c 里面,我想记录一些东西.. 但我需要知道哪个任务 (pid) 与我看到的每个 sched_entity 相关联.. 在我不知道的 struct sched_entity 的定义中'看不到对父结构(task_struct)的任何引用
这是 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
};
【问题讨论】:
标签: linux-kernel scheduling kernel