Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:cgroupstats_user_cmd

Proto:static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)

Type:int

Parameter:

TypeParameterName
struct sk_buff *skb
struct genl_info *info
391  rc = 0
399  na = attrs[CGROUPSTATS_CMD_ATTR_FD]
400  If Not na Then Return -EINVAL
403  fd = la_get_u32 - return payload of u32 attribute*@nla: u32 netlink attribute
404  f = fdget(fd)
405  If Not file Then Return 0
408  size = la_total_size - total length of attribute including padding*@payload: length of payload
410  rc = prepare_reply(info, CGROUPSTATS_CMD_NEW, & rep_skb, size)
412  If rc < 0 Then Go to err
415  na = la_reserve - reserve room for attribute on the skb*@skb: socket buffer to reserve room on*@attrtype: attribute type*@attrlen: length of attribute payload* Adds a netlink attribute header to a socket buffer and reserves
417  If (na == NULL) Then
418  lmsg_free - free a netlink message*@skb: socket buffer of netlink message
419  rc = -EMSGSIZE
420  Go to err
423  stats = la_data - head of payload*@nla: netlink attribute
424  memset(stats, 0, size of stats )
426  rc = groupstats_build - build and fill cgroupstats*@stats: cgroupstats to fill information into*@dentry: A dentry entry belonging to the cgroup for which stats have* been requested.* Build and fill cgroupstats so that taskstats can export it to user* space.
427  If rc < 0 Then
428  lmsg_free - free a netlink message*@skb: socket buffer of netlink message
429  Go to err
432  rc = Send taskstats data in @skb to listener with nl_pid @pid
434  err :
435  fdput(f)
436  Return rc