示例#1
0
文件: cgroup.py 项目: osandov/drgn
def cgroup_path(cgrp: Object) -> bytes:
    """
    Get the full path of the given cgroup.

    :param cgrp: ``struct cgroup *``
    """
    return kernfs_path(cgrp.kn)
示例#2
0
def cgroup_path(cgrp):
    """
    .. c:function:: char *cgroup_path(struct cgroup *cgrp)

    Get the full path of the given cgroup.

    :rtype: bytes
    """
    return kernfs_path(cgrp.kn)
示例#3
0
 def test_kernfs_path(self):
     with open("/sys/kernel/vmcoreinfo", "r") as f:
         file = fget(find_task(self.prog, os.getpid()), f.fileno())
         kn = cast("struct kernfs_node *", file.f_inode.i_private)
         self.assertEqual(kernfs_path(kn), b"/kernel/vmcoreinfo")