函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\kprobes\opt.c Create Date:2022-07-27 09:38:32
Last Modify:2022-05-22 07:44:06 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Decode whole function to ensure any instructions don't jump into target

函数原型:static int can_optimize(unsigned long paddr)

返回类型:int

参数:

类型参数名称
unsigned longpaddr
255  size等于0, offset等于0
260  如果非kallsyms_lookup_size_offset(paddr, & size, & offset)则返回:0
267  如果paddr大于等于__entry_text_startpaddr小于__entry_text_endpaddr大于等于__irqentry_text_startpaddr小于__irqentry_text_end则返回:0
274  如果sizeoffset小于RELATIVEJUMP_SIZE则返回:0
278  addr等于paddroffset
279 addr小于paddroffsetsize循环
281  如果Given an address, look for it in the exception tables 则返回:0
287  recovered_insn等于Recover the probed instruction at addr for further analysis.* Caller must lock kprobes by kprobe_mutex, or disable preemption* for preventing to release referencing kprobes.* Returns zero if the instruction can not get recovered (or access failed).
288  如果非recovered_insn则返回:0
290  Init insn for kernel text
291  sn_get_length() - Get the length of instruction*@insn: &struct insn containing instruction* If necessary, first collects the instruction up to and including the* immediates bytes.
293  如果bytes[0]恒等于BREAKPOINT_INSTRUCTION则返回:0
296  kernel address of insn to analyze 等于addr
297  next_byte等于addrlength
299  如果insn_is_indirect_jump( & insn)或Check whether insn jumps into specified address range 则返回:0
303  addr加等于length
306  返回:1
调用者
名称描述
arch_prepare_optimized_kprobeCopy replacing target instructions* Target instructions MUST be relocatable (checked inside)* This is called when new aggr(opt)probe is allocated or reused.