Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kprobes.c Create Date:2022-07-28 11:35:40
Last Modify:2022-05-22 18:14:58 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This is the second or subsequent kprobe at the address - handle* the intricacies

Proto:static int register_aggr_kprobe(struct kprobe *orig_p, struct kprobe *p)

Type:int

Parameter:

TypeParameterName
struct kprobe *orig_p
struct kprobe *p
1347  ret = 0
1348  ap = orig_p
1350  cpus_read_lock()
1353  jump_label_lock()
1354  mutex_lock( & mutex protecting text section modification (dynamic code patching).* some users need to sleep (allocating memory...) while they hold this lock.* Note: Also protects SMP-alternatives modification on x86.)
1356  If Not Return true if the kprobe is an aggregator Then
1358  ap = Allocate new optimized_kprobe and try to prepare optimized instructions
1359  If Not ap Then
1360  ret = -ENOMEM
1361  Go to out
1363  init_aggr_kprobe(ap, orig_p)
1364  Else if Return true(!0) if the kprobe is unused Then
1366  ret = Cancel unoptimizing for reusing
1367  If ret Then Go to out
1371  If Has this kprobe gone ? Then
1378  ret = arch_prepare_kprobe(ap)
1379  If ret Then Go to out
1388  Try to prepare optimized instructions
1394  * Indicates various status flags. * Protected by kprobe_mutex after this kprobe is registered. = * Indicates various status flags. * Protected by kprobe_mutex after this kprobe is registered. & ~akpoint has already gone | probe is temporarily disabled
1399  Keep all fields in the kprobe consistent
1400  ret = Add the new probe to ap->list
1402  out :
1403  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.
1404  jump_label_unlock()
1405  cpus_read_unlock()
1407  If ret == 0 && Is this kprobe disabled ? && Not Is this kprobe disabled ? Then
1408  * Indicates various status flags. * Protected by kprobe_mutex after this kprobe is registered. &= ~probe is temporarily disabled
1412  If ret Then
1419  Return ret
Caller
NameDescribe
register_kprobe