Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-28 13:40:07
Last Modify:2022-05-20 07:50:19 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pmu_dev_alloc

Proto:static int pmu_dev_alloc(struct pmu *pmu)

Type:int

Parameter:

TypeParameterName
struct pmu *pmu
10235  ret = -ENOMEM
10237  dev = 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).
10238  If Not dev Then Go to out
10241  groups = attr_groups
10242  device_initialize(dev)
10243  ret = dev_set_name(dev, "%s", name)
10244  If ret Then Go to free_dev
10247  dev_set_drvdata(dev, pmu)
10248  bus = pmu_bus
10249  release = pmu_dev_release
10250  ret = device_add(dev)
10251  If ret Then Go to free_dev
10255  If umber of address filters this PMU can do Then ret = device_create_file(dev, & dev_attr_nr_addr_filters)
10258  If ret Then Go to del_dev
10261  If attr_update Then ret = sysfs_update_groups( & kobj, attr_update)
10264  If ret Then Go to del_dev
10267  out :
10268  Return ret
10270  del_dev :
10271  device_del(dev)
10273  free_dev :
10274  put_device(dev)
10275  Go to out
Caller
NameDescribe
perf_pmu_register
perf_event_sysfs_init