Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323744
b: refs/heads/master
c: ded86e7
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov committed Aug 28, 2012
1 parent 3356d7f commit 7bea5bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 61559a8165da2b6bab7621ac36379c6280efacb6
refs/heads/master: ded86e7c8fc4404414c4700010c9962ea8bd083a
2 changes: 1 addition & 1 deletion trunk/include/linux/uprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct uprobes_state {
};

extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr, bool verify);
extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
extern bool __weak is_swbp_insn(uprobe_opcode_t *insn);
extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
Expand Down
20 changes: 9 additions & 11 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,24 +345,22 @@ int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned
* @mm: the probed process address space.
* @auprobe: arch specific probepoint information.
* @vaddr: the virtual address to insert the opcode.
* @verify: if true, verify existance of breakpoint instruction.
*
* For mm @mm, restore the original opcode (opcode) at @vaddr.
* Return 0 (success) or a negative errno.
*/
int __weak
set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr, bool verify)
set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
{
if (verify) {
int result;
int result;

result = is_swbp_at_addr(mm, vaddr);
if (!result)
return -EINVAL;

result = is_swbp_at_addr(mm, vaddr);
if (!result)
return -EINVAL;
if (result != 1)
return result;

if (result != 1)
return result;
}
return write_opcode(auprobe, mm, vaddr, *(uprobe_opcode_t *)auprobe->insn);
}

Expand Down Expand Up @@ -697,7 +695,7 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm,
static void
remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vaddr)
{
set_orig_insn(&uprobe->arch, mm, vaddr, true);
set_orig_insn(&uprobe->arch, mm, vaddr);
}

/*
Expand Down

0 comments on commit 7bea5bb

Please sign in to comment.