Skip to content

Commit

Permalink
sched: Display autogroup names in /proc/sched_debug
Browse files Browse the repository at this point in the history
Add autogroup name to cfs_rq and tasks information to /proc/sched_debug.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20110111101257.GF4772@in.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Bharata B Rao authored and Ingo Molnar committed Jan 18, 2011
1 parent efe25c2 commit 8ecedd7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/sched_autogroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m)
#ifdef CONFIG_SCHED_DEBUG
static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
{
int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled);

if (!enabled || !tg->autogroup)
return 0;

return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id);
}
#endif /* CONFIG_SCHED_DEBUG */
Expand Down
3 changes: 3 additions & 0 deletions kernel/sched_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ static char group_path[PATH_MAX];

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
*/
Expand Down

0 comments on commit 8ecedd7

Please sign in to comment.