]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cgroup: Add .__DEBUG__. prefix to debug file names
authorTejun Heo <tj@kernel.org>
Tue, 13 Nov 2018 20:06:41 +0000 (12:06 -0800)
committerTejun Heo <tj@kernel.org>
Tue, 13 Nov 2018 20:16:01 +0000 (12:16 -0800)
Clearly mark the debug files and hide them by default by prefixing
".__DEBUG__.".

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Waiman Long <longman@redhat.com>
kernel/cgroup/cgroup.c

index ed7f0bfe642942b47f2a689c91460d11e043cc0a..e06994fd4e34c29c48d3a941e8b74c5285d319fe 100644 (file)
@@ -1400,12 +1400,15 @@ static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
        struct cgroup_subsys *ss = cft->ss;
 
        if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) &&
-           !(cgrp->root->flags & CGRP_ROOT_NOPREFIX))
-               snprintf(buf, CGROUP_FILE_NAME_MAX, "%s.%s",
-                        cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name,
+           !(cgrp->root->flags & CGRP_ROOT_NOPREFIX)) {
+               const char *dbg = (cft->flags & CFTYPE_DEBUG) ? ".__DEBUG__." : "";
+
+               snprintf(buf, CGROUP_FILE_NAME_MAX, "%s%s.%s",
+                        dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name,
                         cft->name);
-       else
+       } else {
                strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX);
+       }
        return buf;
 }