函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cgroup\cgroup.c Create Date:2022-07-27 12:10:35
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ask_cgroup_path - cgroup path of a task in the first cgroup hierarchy*@task: target task*@buf: the buffer to write the path into*@buflen: the length of the buffer* Determine @task's cgroup on the first (the one with the lowest non-zero

函数原型:int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen)

返回类型:int

参数:

类型参数名称
struct task_struct *task
char *buf
size_tbuflen
2258  hierarchy_id等于1
2261  mutex_lock( & cgroup_mutex is the master lock)
2262  spin_lock_irq( & css_set_lock)
2264  root等于dr_get_next() - Find next populated entry.*@idr: IDR handle.*@nextid: Pointer to an ID.* Returns the next populated entry in the tree with an ID greater than* or equal to the value pointed to by @nextid. On exit, @nextid is updated
2266  如果root
2267  cgrp等于Return the cgroup for "task" from the given hierarchy. Must be* called with cgroup_mutex and css_set_lock held.
2268  ret等于cgroup_path_ns_locked(cgrp, buf, buflen, & cgroup namespace for init task )
2269  否则
2271  ret等于长字符串复制
2274  spin_unlock_irq( & css_set_lock)
2275  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
2276  返回:ret