Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:alloc_uprobe

Proto:static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset, loff_t ref_ctr_offset)

Type:struct uprobe

Parameter:

TypeParameterName
struct inode *inode
loff_toffset
loff_tref_ctr_offset
739  uprobe = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
740  If Not uprobe Then Return NULL
743  Also hold a ref to inode = inode
744  offset = offset
745  ref_ctr_offset = ref_ctr_offset
746  init_rwsem( & register_rwsem)
747  init_rwsem( & consumer_rwsem)
750  cur_uprobe = Acquire uprobes_treelock.* Matching uprobe already exists in rbtree;* increment (access refcount) and return the matching uprobe.* No matching uprobe; insert the uprobe in rb_tree;* get a double refcount (access + creation) and return NULL.
752  If cur_uprobe Then
753  If ref_ctr_offset != ref_ctr_offset Then
756  kfree(uprobe)
757  Return ERR_PTR( - EINVAL)
759  kfree(uprobe)
760  uprobe = cur_uprobe
763  Return uprobe
Caller
NameDescribe
__uprobe_register__uprobe_register - register a probe*@inode: the file in which the probe has to be placed