Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cgroup\cgroup-v1.c Create Date:2022-07-28 11:12:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:seq_file methods for the tasks/procs files. The seq_file position is the* next pid to display; the seq_file iterator is a pointer to the pid* in the cgroup->l->list array.

Proto:static void *cgroup_pidlist_start(struct seq_file *s, loff_t *pos)

Type:void

Parameter:

TypeParameterName
struct seq_file *s
loff_t *pos
400  of = private
401  cgrp = PI: the cgroup that this css is attached to
403  type = private
404  index = 0 , pid = pos
407  mutex_lock( & pidlist_mutex)
415  If priv Then priv = cgroup_pidlist_find(cgrp, type)
422  If Not priv Then
423  ret = Load a cgroup's pidarray with either procs' tgids or tasks' pids
425  If ret Then Return ERR_PTR(ret)
428  l = priv
430  If pid Then
431  end = how many elements the above list has
433  When index < end cycle
434  mid = (index + end) / 2
435  If array of xids [mid] == pid Then
436  index = mid
437  Break
438  Else if array of xids [mid] <= pid Then index = mid + 1
440  Else end = mid
445  If index >= how many elements the above list has Then Return NULL
448  iter = array of xids + index
449  pos = iter
450  Return iter