5cb4ac3a58
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>
76 lines
2.5 KiB
C
76 lines
2.5 KiB
C
#ifndef _LINUX_UPROBES_H
|
|
#define _LINUX_UPROBES_H
|
|
/*
|
|
* User-space Probes (UProbes)
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*
|
|
* Copyright (C) IBM Corporation, 2008-2012
|
|
* Authors:
|
|
* Srikar Dronamraju
|
|
* Jim Keniston
|
|
* Copyright (C) 2011-2012 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
|
|
*/
|
|
|
|
#include <linux/errno.h>
|
|
#include <linux/rbtree.h>
|
|
|
|
struct vm_area_struct;
|
|
#ifdef CONFIG_ARCH_SUPPORTS_UPROBES
|
|
#include <asm/uprobes.h>
|
|
#endif
|
|
|
|
/* flags that denote/change uprobes behaviour */
|
|
|
|
/* Have a copy of original instruction */
|
|
#define UPROBE_COPY_INSN 0x1
|
|
|
|
/* Dont run handlers when first register/ last unregister in progress*/
|
|
#define UPROBE_RUN_HANDLER 0x2
|
|
|
|
struct uprobe_consumer {
|
|
int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
|
|
/*
|
|
* filter is optional; If a filter exists, handler is run
|
|
* if and only if filter returns true.
|
|
*/
|
|
bool (*filter)(struct uprobe_consumer *self, struct task_struct *task);
|
|
|
|
struct uprobe_consumer *next;
|
|
};
|
|
|
|
#ifdef CONFIG_UPROBES
|
|
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 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);
|
|
#else /* CONFIG_UPROBES is not defined */
|
|
static inline int
|
|
uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
static inline void
|
|
uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc)
|
|
{
|
|
}
|
|
static inline int uprobe_mmap(struct vm_area_struct *vma)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_UPROBES */
|
|
#endif /* _LINUX_UPROBES_H */
|