Function report |
Source Code:kernel\events\uprobes.c |
Create Date:2022-07-28 13:45:00 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:NOTE:* Expect the breakpoint instruction to be the smallest size instruction for* the architecture
Proto:int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t opcode)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct arch_uprobe * | auprobe | |
| struct mm_struct * | mm | |
| unsigned long | vaddr | |
| uprobe_opcode_t | opcode |
| 475 | ref_ctr_updated = 0 |
| 476 | bool orig_page_huge = false |
| 482 | retry : |
| 483 | If is_register Then gup_flags |= split huge pmd before returning |
| 491 | ret = verify_opcode(old_page, vaddr, & opcode) |
| 495 | If WARN(!is_register && PageCompound(old_page), "uprobe unregister should never work on compound page\n") Then |
| 502 | If Not ref_ctr_updated && ref_ctr_offset Then |
| 503 | ret = update_ref_ctr(uprobe, mm, is_register ? 1 : - 1) |
| 507 | ref_ctr_updated = 1 |
| 510 | ret = 0 |
| 511 | If Not is_register && Not PageAnon(old_page) Then Go to put_old |
| 514 | ret = anon_vma_prepare(vma) |
| 519 | new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, vaddr) |
| 524 | copy_highpage(new_page, old_page) |
| 525 | copy_to_page(new_page, vaddr, & opcode, UPROBE_SWBP_INSN_SIZE) |
| 527 | If Not is_register Then |
| 531 | VM_BUG_ON_PAGE(!PageAnon(old_page), old_page) |
| 533 | index = vaddr_to_offset(vma, vaddr & PAGE_MASK) >> PAGE_SHIFT determines the page size |
| 537 | If orig_page Then |
| 538 | If PageUptodate(orig_page) && pages_identical(new_page, orig_page) Then |
| 542 | new_page = NULL |
| 544 | If PageCompound(orig_page) Then orig_page_huge = true |
| 554 | put_old : |
| 557 | If Value for the false possibility is greater at compile time(ret == - EAGAIN) Then Go to retry |
| 561 | If ret && is_register && ref_ctr_updated Then update_ref_ctr(uprobe, mm, - 1) |
| 565 | If Not ret && orig_page_huge Then collapse_pte_mapped_thp(mm, vaddr) |
| 568 | Return ret |
| Name | Describe |
|---|---|
| set_swbp | set_swbp - store breakpoint at a given address.*@auprobe: arch specific probepoint information.*@mm: the probed process address space.*@vaddr: the virtual address to insert the opcode.* For mm @mm, store the breakpoint instruction at @vaddr. |
| set_orig_insn | set_orig_insn - Restore the original instruction.*@mm: the probed process address space.*@auprobe: arch specific probepoint information.*@vaddr: the virtual address to insert the opcode.* For mm @mm, restore the original opcode (opcode) at @vaddr. |
| 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 |