aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup/cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cgroup/cgroup.c')
-rw-r--r--kernel/cgroup/cgroup.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 2e5d90dfcb49..ed7f0bfe6429 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -86,6 +86,7 @@ EXPORT_SYMBOL_GPL(css_set_lock);
86 86
87DEFINE_SPINLOCK(trace_cgroup_path_lock); 87DEFINE_SPINLOCK(trace_cgroup_path_lock);
88char trace_cgroup_path[TRACE_CGROUP_PATH_LEN]; 88char trace_cgroup_path[TRACE_CGROUP_PATH_LEN];
89bool cgroup_debug __read_mostly;
89 90
90/* 91/*
91 * Protects cgroup_idr and css_idr so that IDs can be released without 92 * Protects cgroup_idr and css_idr so that IDs can be released without
@@ -3639,7 +3640,8 @@ restart:
3639 continue; 3640 continue;
3640 if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgroup_parent(cgrp)) 3641 if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgroup_parent(cgrp))
3641 continue; 3642 continue;
3642 3643 if ((cft->flags & CFTYPE_DEBUG) && !cgroup_debug)
3644 continue;
3643 if (is_add) { 3645 if (is_add) {
3644 ret = cgroup_add_file(css, cgrp, cft); 3646 ret = cgroup_add_file(css, cgrp, cft);
3645 if (ret) { 3647 if (ret) {
@@ -5743,6 +5745,16 @@ static int __init cgroup_disable(char *str)
5743} 5745}
5744__setup("cgroup_disable=", cgroup_disable); 5746__setup("cgroup_disable=", cgroup_disable);
5745 5747
5748void __init __weak enable_debug_cgroup(void) { }
5749
5750static int __init enable_cgroup_debug(char *str)
5751{
5752 cgroup_debug = true;
5753 enable_debug_cgroup();
5754 return 1;
5755}
5756__setup("cgroup_debug", enable_cgroup_debug);
5757
5746/** 5758/**
5747 * css_tryget_online_from_dir - get corresponding css from a cgroup dentry 5759 * css_tryget_online_from_dir - get corresponding css from a cgroup dentry
5748 * @dentry: directory dentry of interest 5760 * @dentry: directory dentry of interest