Function report |
Source Code:kernel\kprobes.c |
Create Date:2022-07-28 11:34:46 |
| Last Modify:2022-05-22 18:14:58 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__get_insn_slot() - Find a slot on an executable page for an instruction.* We allocate an executable page if there's no room on existing ones.
Proto:kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c)
Type:kprobe_opcode_t
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct kprobe_insn_cache * | c |
| 134 | kprobe_opcode_t * slot = NULL |
| 137 | mutex_lock( & mutex) |
| 138 | retry : |
| 141 | If nused < slots_per_page(c) Then |
| 143 | When i < slots_per_page(c) cycle |
| 144 | If slot_used[i] == SLOT_CLEAN Then |
| 153 | nused = slots_per_page(c) |
| 154 | WARN_ON(1) |
| 160 | If nr_garbage && collect_garbage_slots(c) == 0 Then Go to retry |
| 164 | kip = Allocation memory |
| 173 | Page of instruction slots = alloc() |
| 174 | If Not Page of instruction slots Then |
| 179 | memset(slot_used, SLOT_CLEAN, slots_per_page(c)) |
| 181 | nused = 1 |
| 182 | ngarbage = 0 |
| 186 | out : |
| 188 | Return slot |
| Name | Describe |
|---|---|
| get_insn_slot | |
| get_optinsn_slot |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |