函数逻辑报告 |
Source Code:kernel\events\uprobes.c |
Create Date:2022-07-27 15:05:53 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__replace_page - replace page in vma by new page
函数原型:static int __replace_page(struct vm_area_struct *vma, unsigned long addr, struct page *old_page, struct page *new_page)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct vm_area_struct * | vma | |
unsigned long | addr | |
struct page * | old_page | |
struct page * | new_page |
158 | struct page_vma_mapped_walk pvmw = {page = compound_head(old_page), vma = vma, address = addr, } |
167 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, mm, addr, addr + PAGE_SIZE) |
170 | 如果new_page则 |
171 | err等于mem_cgroup_try_charge(new_page, The address space we belong to. , GFP_KERNEL, & memcg, false) |
183 | 如果new_page则mem_cgroup_cancel_charge(new_page, memcg, false) |
185 | 转到:unlock |
187 | VM_BUG_ON_PAGE(addr != address, old_page) |
189 | 如果new_page则 |
191 | page_add_new_anon_rmap(new_page, vma, addr, false) |
194 | 否则dec_mm_counter(mm, MM_ANONPAGES) |
200 | inc_mm_counter(mm, MM_ANONPAGES) |
203 | flush_cache_page(vma, addr, pte_pfn( * pte)) |
204 | ptep_clear_flush_notify(vma, addr, pte) |
209 | page_remove_rmap(old_page, false) |
210 | 如果非page_mapped(old_page)则try_to_free_swap(old_page) |
212 | page_vma_mapped_walk_done( & pvmw) |
214 | 如果Flags, see mm.h. 按位与VM_LOCKED则munlock_vma_page(old_page) |
218 | err等于0 |
219 | unlock : |
221 | unlock_page(old_page) |
222 | 返回:err |
名称 | 描述 |
---|---|
uprobe_write_opcode | NOTE:* Expect the breakpoint instruction to be the smallest size instruction for* the architecture |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |