]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/sched_autogroup.c
sched: Display autogroup names in /proc/sched_debug
[mv-sheeva.git] / kernel / sched_autogroup.c
index 32a723b8f84cac397c51579a1f3099d35d1a25f0..938d52f80a2d8bdceab27d8c669ef2207945f5b7 100644 (file)
@@ -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 */