函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__free_insn_slot

函数原型:void __free_insn_slot(struct kprobe_insn_cache *c, kprobe_opcode_t *slot, int dirty)

返回类型:void

参数:

类型参数名称
struct kprobe_insn_cache *c
kprobe_opcode_t *slot
intdirty
241  mutex_lock( & mutex)
242  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
244  idx等于slotPage of instruction slots 的差除 size of instruction slot sizeof(kprobe_opcode_t)
246  如果idx大于等于0且idx小于slots_per_page(c)则转到:out
250  WARN_ON(1)
251  kip = NULL
252  out :
253  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
255  如果kip
257  WARN_ON(slot_used[idx] != SLOT_USED)
258  如果dirty
259  slot_used[idx]等于SLOT_DIRTY
260  ngarbage自加
261  如果nr_garbage先自加大于slots_per_page(c)则collect_garbage_slots(c)
263  否则
267  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.
调用者
名称描述
free_insn_slot
free_optinsn_slot