def require_subsystem(self, subsystem):
        if not subsystem in self:
            logging.warning('Cgroup subsystem %s is not enabled. Please enable it with '
                            '"sudo mount -t cgroup none /sys/fs/cgroup".',
                            subsystem)
            return False

        try:
            test_cgroup = self.create_fresh_child_cgroup(subsystem)
            test_cgroup.remove()
        except OSError as e:
            self.paths = set(self.per_subsystem.values())
            logging.warning('Cannot use cgroup hierarchy mounted at {0} for subsystem {1}, '
                            'reason: {2}. '
                            'If permissions are wrong, please run "sudo chmod o+wt \'{0}\'".'
                            .format(self.per_subsystem[subsystem], subsystem, e.strerror))
            del self.per_subsystem[subsystem]
            return False

        return True
Check whether the given subsystem is enabled and is writable
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/cgroups.py/Cgroup.require_subsystem