函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kprobes.c Create Date:2022-07-27 12:38:59
Last Modify:2022-05-22 18:14:58 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Prepare an optimized_kprobe and optimize it* NOTE: p must be a normal registered kprobe

函数原型:static void try_to_optimize_kprobe(struct kprobe *p)

返回类型:void

参数:

类型参数名称
struct kprobe *p
807  如果Is this kprobe uses ftrace ? 则返回
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  如果非ap则转到: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  如果非Return true (!0) if optinsn is prepared for optimization.
822  arch_remove_optimized_kprobe(op)
823  kfree(op)
824  转到: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()
调用者
名称描述
register_kprobe