static char *task_group_path(struct task_group *tg) { if (autogroup_path(tg, group_path, PATH_MAX)) return group_path; return cgroup_path(tg->css.cgroup, group_path, PATH_MAX); }
void get_lxc_name(struct task_struct * process, char * lxcName){ struct cgroup * cgrp; char buf[KERN_BUF_SIZE]; struct cgroupfs_root *root; int retval = 0; char * name; cgrp = task_cgroup(process,1); if(cgrp != NULL){ retval = cgroup_path(cgrp, buf, KERN_BUF_SIZE); //printk(KERN_INFO "s3fserial : cgroup path ret buf = %s\n",buf); if(strcmp(buf,"/") == 0) ; else{ name = extract_filename(buf); strcpy(lxcName,name); return; } } else{ printk(KERN_INFO "s3fserial : Task cgroup is NULL\n"); } strcpy(lxcName,"NA"); }
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"); }
void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq) { #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_RT_GROUP_SCHED) char path[128] = ""; struct cgroup *cgroup = NULL; struct task_group *tg = rt_rq->tg; if (tg) cgroup = tg->css.cgroup; if (cgroup) cgroup_path(cgroup, path, sizeof(path)); SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, path); #else SEQ_printf(m, "\nrt_rq[%d]:\n", cpu); #endif #define P(x) \ SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(rt_rq->x)) #define PN(x) \ SEQ_printf(m, " .%-30s: %Ld.%06ld\n", #x, SPLIT_NS(rt_rq->x)) P(rt_nr_running); P(rt_throttled); PN(rt_time); PN(rt_runtime); #undef PN #undef P }
void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) { s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1, spread, rq0_min_vruntime, spread0; struct rq *rq = &per_cpu(runqueues, cpu); struct sched_entity *last; unsigned long flags; #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED) char path[128] = ""; struct cgroup *cgroup = NULL; struct task_group *tg = cfs_rq->tg; if (tg) cgroup = tg->css.cgroup; if (cgroup) cgroup_path(cgroup, path, sizeof(path)); SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path); #else SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu); #endif SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock", SPLIT_NS(cfs_rq->exec_clock)); spin_lock_irqsave(&rq->lock, flags); if (cfs_rq->rb_leftmost) MIN_vruntime = (__pick_next_entity(cfs_rq))->vruntime; last = __pick_last_entity(cfs_rq); if (last) max_vruntime = last->vruntime; min_vruntime = cfs_rq->min_vruntime; rq0_min_vruntime = per_cpu(runqueues, 0).cfs.min_vruntime; spin_unlock_irqrestore(&rq->lock, flags); SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "MIN_vruntime", SPLIT_NS(MIN_vruntime)); SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "min_vruntime", SPLIT_NS(min_vruntime)); SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "max_vruntime", SPLIT_NS(max_vruntime)); spread = max_vruntime - MIN_vruntime; SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread", SPLIT_NS(spread)); spread0 = min_vruntime - rq0_min_vruntime; SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "spread0", SPLIT_NS(spread0)); SEQ_printf(m, " .%-30s: %ld\n", "nr_running", cfs_rq->nr_running); SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight); SEQ_printf(m, " .%-30s: %d\n", "nr_spread_over", cfs_rq->nr_spread_over); #ifdef CONFIG_FAIR_GROUP_SCHED #ifdef CONFIG_SMP SEQ_printf(m, " .%-30s: %lu\n", "shares", cfs_rq->shares); #endif #endif }
static void task_group_path(struct task_group *tg, char *buf, int buflen) { /* may be NULL if the underlying cgroup isn't fully-created yet */ if (!tg->css.cgroup) { buf[0] = '\0'; return; } cgroup_path(tg->css.cgroup, buf, buflen); }
static char *task_group_path(struct task_group *tg) { if (autogroup_path(tg, group_path, PATH_MAX)) return group_path; if (!tg->css.cgroup) { group_path[0] = '\0'; return group_path; } cgroup_path(tg->css.cgroup, group_path, PATH_MAX); return group_path; }
static char *task_group_path(struct task_group *tg) { if (autogroup_path(tg, group_path, PATH_MAX)) return group_path; /* * May be NULL if the underlying cgroup isn't fully-created yet */ if (!tg->css.cgroup) { group_path[0] = '\0'; return group_path; } cgroup_path(tg->css.cgroup, group_path, PATH_MAX); return group_path; }
static char *task_group_path(struct task_group *tg) { if (autogroup_path(tg, group_path, PATH_MAX)) return group_path; /* * May be NULL if the underlying cgroup isn't fully-created yet */ if (!tg->css.cgroup) { group_path[0] = '\0'; return group_path; } /*[Arima JimCheng 20131225] Rollback workitem 32175 ++*/ // << FerryWu, 2013/12/17, fix coverity 103078 cgroup_path(tg->css.cgroup, group_path, PATH_MAX) ; // group_path[0] = '\0'; // >> FerryWu, 2013/12/17, fix coverity 103078 /*[Arima JimCheng 20131225] Rollback workitem 32175 --*/ return group_path; }