bkpt doesnt seem to be a correct abbrevation for breakpoint.
Choice was between bp and breakpoint. Since bp can refer to
things other than breakpoint, use swbp to refer to breakpoints.
This is pure cleanup, no functional change intended.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linux-mm <linux-mm@kvack.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120312092545.5379.91251.sendpatchset@srdronam.in.ibm.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
#define MAX_UINSN_BYTES 16
#define UPROBE_XOL_SLOT_BYTES 128 /* to keep it cache aligned */
#define MAX_UINSN_BYTES 16
#define UPROBE_XOL_SLOT_BYTES 128 /* to keep it cache aligned */
-#define UPROBE_BKPT_INSN 0xcc
-#define UPROBE_BKPT_INSN_SIZE 1
+#define UPROBE_SWBP_INSN 0xcc
+#define UPROBE_SWBP_INSN_SIZE 1
struct arch_uprobe {
u16 fixups;
struct arch_uprobe {
u16 fixups;
-extern int __weak set_bkpt(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
+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, bool verify);
-extern bool __weak is_bkpt_insn(uprobe_opcode_t *insn);
+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);
extern int uprobe_mmap(struct vm_area_struct *vma);
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);
extern int uprobe_mmap(struct vm_area_struct *vma);
- * is_bkpt_insn - check if instruction is breakpoint instruction.
+ * is_swbp_insn - check if instruction is breakpoint instruction.
* @insn: instruction to be checked.
* @insn: instruction to be checked.
- * Default implementation of is_bkpt_insn
+ * Default implementation of is_swbp_insn
* Returns true if @insn is a breakpoint instruction.
*/
* Returns true if @insn is a breakpoint instruction.
*/
-bool __weak is_bkpt_insn(uprobe_opcode_t *insn)
+bool __weak is_swbp_insn(uprobe_opcode_t *insn)
- return *insn == UPROBE_BKPT_INSN;
+ return *insn == UPROBE_SWBP_INSN;
* adding probes in write mapped pages since the breakpoints
* might end up in the file copy.
*/
* adding probes in write mapped pages since the breakpoints
* might end up in the file copy.
*/
- if (!valid_vma(vma, is_bkpt_insn(&opcode)))
+ if (!valid_vma(vma, is_swbp_insn(&opcode)))
goto put_out;
uprobe = container_of(auprobe, struct uprobe, arch);
goto put_out;
uprobe = container_of(auprobe, struct uprobe, arch);
/* poke the new insn in, ASSUMES we don't cross page boundary */
vaddr &= ~PAGE_MASK;
/* poke the new insn in, ASSUMES we don't cross page boundary */
vaddr &= ~PAGE_MASK;
- BUG_ON(vaddr + UPROBE_BKPT_INSN_SIZE > PAGE_SIZE);
- memcpy(vaddr_new + vaddr, &opcode, UPROBE_BKPT_INSN_SIZE);
+ BUG_ON(vaddr + UPROBE_SWBP_INSN_SIZE > PAGE_SIZE);
+ memcpy(vaddr_new + vaddr, &opcode, UPROBE_SWBP_INSN_SIZE);
kunmap_atomic(vaddr_new);
kunmap_atomic(vaddr_old);
kunmap_atomic(vaddr_new);
kunmap_atomic(vaddr_old);
lock_page(page);
vaddr_new = kmap_atomic(page);
vaddr &= ~PAGE_MASK;
lock_page(page);
vaddr_new = kmap_atomic(page);
vaddr &= ~PAGE_MASK;
- memcpy(opcode, vaddr_new + vaddr, UPROBE_BKPT_INSN_SIZE);
+ memcpy(opcode, vaddr_new + vaddr, UPROBE_SWBP_INSN_SIZE);
kunmap_atomic(vaddr_new);
unlock_page(page);
kunmap_atomic(vaddr_new);
unlock_page(page);
-static int is_bkpt_at_addr(struct mm_struct *mm, unsigned long vaddr)
+static int is_swbp_at_addr(struct mm_struct *mm, unsigned long vaddr)
{
uprobe_opcode_t opcode;
int result;
{
uprobe_opcode_t opcode;
int result;
if (result)
return result;
if (result)
return result;
- if (is_bkpt_insn(&opcode))
+ if (is_swbp_insn(&opcode))
return 1;
return 0;
}
/**
return 1;
return 0;
}
/**
- * set_bkpt - store breakpoint at a given address.
+ * 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.
* @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.
* Return 0 (success) or a negative errno.
*/
* For mm @mm, store the breakpoint instruction at @vaddr.
* Return 0 (success) or a negative errno.
*/
-int __weak set_bkpt(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
+int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr)
- result = is_bkpt_at_addr(mm, vaddr);
+ result = is_swbp_at_addr(mm, vaddr);
if (result == 1)
return -EEXIST;
if (result)
return result;
if (result == 1)
return -EEXIST;
if (result)
return result;
- return write_opcode(auprobe, mm, vaddr, UPROBE_BKPT_INSN);
+ return write_opcode(auprobe, mm, vaddr, UPROBE_SWBP_INSN);
if (verify) {
int result;
if (verify) {
int result;
- result = is_bkpt_at_addr(mm, vaddr);
+ result = is_swbp_at_addr(mm, vaddr);
if (!result)
return -EINVAL;
if (!result)
return -EINVAL;
- if (is_bkpt_insn((uprobe_opcode_t *)uprobe->arch.insn))
+ if (is_swbp_insn((uprobe_opcode_t *)uprobe->arch.insn))
return -EEXIST;
ret = arch_uprobes_analyze_insn(&uprobe->arch, mm);
return -EEXIST;
ret = arch_uprobes_analyze_insn(&uprobe->arch, mm);
uprobe->flags |= UPROBE_COPY_INSN;
}
uprobe->flags |= UPROBE_COPY_INSN;
}
- ret = set_bkpt(&uprobe->arch, mm, addr);
+ ret = set_swbp(&uprobe->arch, mm, addr);