Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Prepare an optimized_kprobe and optimize it* NOTE: p must be a normal registered kprobe

Proto:static void try_to_optimize_kprobe(struct kprobe *p)

Type:void

Parameter:

TypeParameterName
struct kprobe *p
807  If Is this kprobe uses ftrace ? Then Return
811  cpus_read_lock()
812  jump_label_lock()
813  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.)
815  ap = Allocate new optimized_kprobe and try to prepare optimized instructions
816  If Not ap Then Go to out
819  op = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(ap, structoptimized_kprobe, kp)
820  If Not Return true (!0) if optinsn is prepared for optimization. Then
822  arch_remove_optimized_kprobe(op)
823  kfree(op)
824  Go to out
827  init_aggr_kprobe(ap, p)
828  Optimize kprobe if p is ready to be optimized
830  out :
831  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.
832  jump_label_unlock()
833  cpus_read_unlock()
Caller
NameDescribe
register_kprobe