Example #1
0
static void
print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
{
	if (rq->curr == p)
		SEQ_printf(m, "R");
	else
		SEQ_printf(m, " ");

	SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
		p->comm, p->pid,
		SPLIT_NS(p->se.vruntime),
		(long long)(p->nvcsw + p->nivcsw),
		p->prio);
#ifdef CONFIG_SCHEDSTATS
	SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
		SPLIT_NS(p->se.vruntime),
		SPLIT_NS(p->se.sum_exec_runtime),
		SPLIT_NS(p->se.sum_sleep_runtime));
#else
	SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
		0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
#endif

#ifdef CONFIG_CGROUP_SCHED
	{
		char path[64];

		rcu_read_lock();
		cgroup_path(task_group(p)->css.cgroup, path, sizeof(path));
		rcu_read_unlock();
		SEQ_printf(m, " %s", path);
	}
#endif
	SEQ_printf(m, "\n");
}
static void
print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
{
	if (rq->curr == p)
		SEQ_printf(m, "R");
	else
		SEQ_printf(m, " ");

	SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
		p->comm, p->pid,
		SPLIT_NS(p->se.vruntime),
		(long long)(p->nvcsw + p->nivcsw),
		p->prio);
#ifdef CONFIG_SCHEDSTATS
	SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
		SPLIT_NS(p->se.vruntime),
		SPLIT_NS(p->se.sum_exec_runtime),
		SPLIT_NS(p->se.statistics.sum_sleep_runtime));
#else
	SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
		0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
#endif
#ifdef CONFIG_CGROUP_SCHED
	SEQ_printf(m, " %s", task_group_path(task_group(p)));
#endif

	SEQ_printf(m, "\n");
}
Example #3
0
static int get_wrr_rq_weight(struct wrr_rq *wrr_rq)
{
	struct sched_wrr_entity *wrr_se;
	struct task_struct *tmp_p;
	char *gp;
	int result;
	
	wrr_rq->rq_weight = 0;
	list_for_each_entry(wrr_se,wrr_rq,wrr_rq){
		
		tmp_p = container_of(wrr_se, struct task_struct, wrr);
		
		gp = task_group_path(task_group(tmp_p));
		if(strcmp(gp,"/") == 0){//foreground
			wrr_rq->rq_weight += FG_W * WRR_TIMESLICE;
			
		}else if(strcmp(gp,"/bg_non_interactive") == 0){//background
			wrr_rq->rq_weight += BG_W * WRR_TIMESLICE;
		}else{
			wrr_rq->rq_weight += BG_W * WRR_TIMESLICE;
		}
		
	}