'Get all pids in cgroup
:params: pwd: cgroup directory
:return: all pids(list)'

def get_pids(self, pwd=None):

    if (pwd is None):
        pwd = self.root
    if isinstance(pwd, int):
        pwd = self.cgroups[pwd]
    try:
        return [_.strip() for _ in open(os.path.join(pwd, 'tasks'), 'r')]
    except Exception as inst:
        raise error.TestError(('cg.get_pids():    %s' % inst))
