}
EXPORT_SYMBOL_GPL(arch_make_trampoline_arm);
-int arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm)
+int swap_arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm)
{
unsigned long addr = (unsigned long)p->addr;
unsigned long insn = p->opcode = *p->addr;
void save_previous_kprobe(struct kprobe_ctlblk *kcb, struct kprobe *p_run)
{
- kcb->prev_kprobe.kp = kprobe_running();
+ kcb->prev_kprobe.kp = swap_kprobe_running();
kcb->prev_kprobe.status = kcb->kprobe_status;
}
void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
{
- __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
+ __get_cpu_var(swap_current_kprobe) = kcb->prev_kprobe.kp;
kcb->kprobe_status = kcb->prev_kprobe.status;
}
void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb)
{
- __get_cpu_var(current_kprobe) = p;
+ __get_cpu_var(swap_current_kprobe) = p;
DBPRINTF ("set_current_kprobe: p=%p addr=%p\n", p, p->addr);
}
struct kprobe *p, *cur;
struct kprobe_ctlblk *kcb;
- kcb = get_kprobe_ctlblk();
- cur = kprobe_running();
- p = get_kprobe((void *)regs->ARM_pc);
+ kcb = swap_get_kprobe_ctlblk();
+ cur = swap_kprobe_running();
+ p = swap_get_kprobe((void *)regs->ARM_pc);
if (p) {
if (cur) {
case KPROBE_HIT_ACTIVE:
case KPROBE_HIT_SSDONE:
/* A pre- or post-handler probe got us here. */
- kprobes_inc_nmissed_count(p);
+ swap_kprobes_inc_nmissed_count(p);
save_previous_kprobe(kcb, NULL);
set_current_kprobe(p, 0, 0);
kcb->kprobe_status = KPROBE_REENTER;
if (!p->pre_handler || !p->pre_handler(p, regs)) {
kcb->kprobe_status = KPROBE_HIT_SS;
prepare_singlestep(p, regs);
- reset_current_kprobe();
+ swap_reset_current_kprobe();
}
}
} else {
return ret;
}
-int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
+int swap_setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
{
struct jprobe *jp = container_of(p, struct jprobe, kp);
kprobe_pre_entry_handler_t pre_entry = (kprobe_pre_entry_handler_t)jp->pre_entry;
}
EXPORT_SYMBOL_GPL(swap_jprobe_return);
-int longjmp_break_handler (struct kprobe *p, struct pt_regs *regs)
+int swap_longjmp_break_handler (struct kprobe *p, struct pt_regs *regs)
{
return 0;
}
-EXPORT_SYMBOL_GPL(longjmp_break_handler);
+EXPORT_SYMBOL_GPL(swap_longjmp_break_handler);
#ifdef CONFIG_STRICT_MEMORY_RWX
extern void mem_text_write_kernel_word(unsigned long *addr, unsigned long word);
#endif
-void arch_arm_kprobe(struct kprobe *p)
+void swap_arch_arm_kprobe(struct kprobe *p)
{
#ifdef CONFIG_STRICT_MEMORY_RWX
mem_text_write_kernel_word(p->addr, BREAKPOINT_INSTRUCTION);
#endif
}
-void arch_disarm_kprobe(struct kprobe *p)
+void swap_arch_disarm_kprobe(struct kprobe *p)
{
#ifdef CONFIG_STRICT_MEMORY_RWX
mem_text_write_kernel_word(p->addr, p->opcode);
#endif
}
-void __naked kretprobe_trampoline(void)
+void __naked swap_kretprobe_trampoline(void)
{
__asm__ __volatile__ (
"stmdb sp!, {r0 - r11} \n\t"
: : : "memory");
}
-void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs)
+void swap_arch_prepare_kretprobe(struct kretprobe_instance *ri,
+ struct pt_regs *regs)
{
unsigned long *ptr_ret_addr;
ri->ret_addr = (unsigned long *)*ptr_ret_addr;
/* Replace the return addr with trampoline addr */
- *ptr_ret_addr = (unsigned long)&kretprobe_trampoline;
+ *ptr_ret_addr = (unsigned long)&swap_kretprobe_trampoline;
}
.fn = kprobe_trap_handler
};
-int arch_init_kprobes(void)
+int swap_arch_init_kprobes(void)
{
int ret;
return 0;
}
-void arch_exit_kprobes(void)
+void swap_arch_exit_kprobes(void)
{
kjump_exit();
swap_unregister_undef_hook(&undef_ho_k);
struct slot_manager;
struct kretprobe;
struct kretprobe_instance;
-int arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm);
-void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs);
+int swap_arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm);
+void swap_arch_prepare_kretprobe(struct kretprobe_instance *ri,
+ struct pt_regs *regs);
-void arch_arm_kprobe(struct kprobe *p);
-void arch_disarm_kprobe(struct kprobe *p);
+void swap_arch_arm_kprobe(struct kprobe *p);
+void swap_arch_disarm_kprobe(struct kprobe *p);
-int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs);
-int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs);
+int swap_setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs);
+int swap_longjmp_break_handler(struct kprobe *p, struct pt_regs *regs);
void save_previous_kprobe(struct kprobe_ctlblk *kcb, struct kprobe *cur_p);
void restore_previous_kprobe(struct kprobe_ctlblk *kcb);
void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb);
-void __naked kretprobe_trampoline(void);
+void __naked swap_kretprobe_trampoline(void);
static inline unsigned long swap_get_karg(struct pt_regs *regs, unsigned long n)
{
int set_jump_cb(unsigned long ret_addr, struct pt_regs *regs,
jumper_cb_t cb, void *data, size_t size);
-int arch_init_kprobes(void);
-void arch_exit_kprobes(void);
+int swap_arch_init_kprobes(void);
+void swap_arch_exit_kprobes(void);
//void gen_insn_execbuf (void);
//void pc_dep_insn_execbuf (void);
extern struct kprobe * per_cpu__current_kprobe;
extern struct kprobe * per_cpu__current_kprobe;
-extern struct kprobe * current_kprobe;
+extern struct kprobe *swap_current_kprobe;
static int (*swap_fixup_exception)(struct pt_regs * regs);
* - When the probed function returns, this probe
* causes the handlers to fire
*/
-static __used void kretprobe_trampoline_holder(void)
+static __used void swap_kretprobe_trampoline_holder(void)
{
- asm volatile(".global kretprobe_trampoline\n"
- "kretprobe_trampoline:\n"
+ asm volatile(".global swap_kretprobe_trampoline\n"
+ "swap_kretprobe_trampoline:\n"
" pushf\n"
/* skip cs, ip, orig_ax and gs. */
" subl $16, %esp\n"
" ret\n");
}
-void kretprobe_trampoline(void);
+void swap_kretprobe_trampoline(void);
/* insert a jmp code */
static __always_inline void set_jmp_op (void *from, void *to)
/*
* returns non-zero if opcodes can be boosted.
*/
-int can_boost(kprobe_opcode_t *opcodes)
+int swap_can_boost(kprobe_opcode_t *opcodes)
{
#define W(row,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,ba,bb,bc,bd,be,bf) \
(((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \
return (opcode != 0x2e && opcode != 0x9a);
}
}
-EXPORT_SYMBOL_GPL(can_boost);
+EXPORT_SYMBOL_GPL(swap_can_boost);
/*
* returns non-zero if opcode modifies the interrupt flag.
return 0;
}
-int arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm)
+int swap_arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm)
{
/* insn: must be on special executable page on i386. */
p->ainsn.insn = swap_slot_alloc(sm);
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE);
p->opcode = *p->addr;
- p->ainsn.boostable = can_boost(p->addr) ? 0 : -1;
+ p->ainsn.boostable = swap_can_boost(p->addr) ? 0 : -1;
return 0;
}
{
panic("no space to save new probe[]: task = %d/%s, prev %p, current %p, new %p,",
current->pid, current->comm, kcb->prev_kprobe.kp->addr,
- kprobe_running()->addr, cur_p->addr);
+ swap_kprobe_running()->addr, cur_p->addr);
}
- kcb->prev_kprobe.kp = kprobe_running();
+ kcb->prev_kprobe.kp = swap_kprobe_running();
kcb->prev_kprobe.status = kcb->kprobe_status;
}
void restore_previous_kprobe (struct kprobe_ctlblk *kcb)
{
- __get_cpu_var (current_kprobe) = kcb->prev_kprobe.kp;
+ __get_cpu_var(swap_current_kprobe) = kcb->prev_kprobe.kp;
kcb->kprobe_status = kcb->prev_kprobe.status;
kcb->prev_kprobe.kp = NULL;
kcb->prev_kprobe.status = 0;
void set_current_kprobe (struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb)
{
- __get_cpu_var (current_kprobe) = p;
+ __get_cpu_var(swap_current_kprobe) = p;
DBPRINTF ("set_current_kprobe[]: p=%p addr=%p\n", p, p->addr);
kcb->kprobe_saved_eflags = kcb->kprobe_old_eflags = (regs->EREG (flags) & (TF_MASK | IF_MASK));
if (is_IF_modifier (p->opcode))
#endif
preempt_disable ();
- kcb = get_kprobe_ctlblk ();
+ kcb = swap_get_kprobe_ctlblk();
/* Check we're not actually recursing */
- if (kprobe_running()) {
- p = get_kprobe(addr);
+ if (swap_kprobe_running()) {
+ p = swap_get_kprobe(addr);
if (p) {
if (kcb->kprobe_status == KPROBE_HIT_SS && *p->ainsn.insn == BREAKPOINT_INSTRUCTION) {
regs->EREG(flags) &= ~TF_MASK;
*/
save_previous_kprobe (kcb, p);
set_current_kprobe (p, regs, kcb);
- kprobes_inc_nmissed_count (p);
+ swap_kprobes_inc_nmissed_count(p);
prepare_singlestep (p, regs);
kcb->kprobe_status = KPROBE_REENTER;
// FIXME should we enable preemption here??...
goto no_kprobe;
}
- p = __get_cpu_var(current_kprobe);
+ p = __get_cpu_var(swap_current_kprobe);
if (p->break_handler && p->break_handler(p, regs))
goto ss_probe;
}
}
- DBPRINTF ("get_kprobe %p", addr);
if (!p)
- p = get_kprobe(addr);
+ p = swap_get_kprobe(addr);
if (!p) {
if (*addr != BREAKPOINT_INSTRUCTION) {
if (p->ainsn.boostable == 1 && !p->post_handler)
{
/* Boost up -- we can execute copied instructions directly */
- reset_current_kprobe ();
+ swap_reset_current_kprobe();
regs->EREG (ip) = (unsigned long) p->ainsn.insn;
preempt_enable_no_resched ();
#ifdef SUPRESS_BUG_MESSAGES
return ret;
}
-int setjmp_pre_handler (struct kprobe *p, struct pt_regs *regs)
+int swap_setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
{
struct jprobe *jp = container_of (p, struct jprobe, kp);
kprobe_pre_entry_handler_t pre_entry;
entry_point_t entry;
unsigned long addr;
- struct kprobe_ctlblk *kcb = get_kprobe_ctlblk ();
+ struct kprobe_ctlblk *kcb = swap_get_kprobe_ctlblk();
- DBPRINTF ("setjmp_pre_handler %p:%d", p->addr, p->tgid);
pre_entry = (kprobe_pre_entry_handler_t) jp->pre_entry;
entry = (entry_point_t) jp->entry;
void swap_jprobe_return(void)
{
- struct kprobe_ctlblk *kcb = get_kprobe_ctlblk ();
+ struct kprobe_ctlblk *kcb = swap_get_kprobe_ctlblk();
asm volatile(" xchgl %%ebx,%%esp \n"
" int3 \n"
*/
static int post_kprobe_handler (struct pt_regs *regs)
{
- struct kprobe *cur = kprobe_running ();
- struct kprobe_ctlblk *kcb = get_kprobe_ctlblk ();
+ struct kprobe *cur = swap_kprobe_running();
+ struct kprobe_ctlblk *kcb = swap_get_kprobe_ctlblk();
if (!cur)
return 0;
restore_previous_kprobe (kcb);
goto out;
}
- reset_current_kprobe ();
+ swap_reset_current_kprobe();
out:
preempt_enable_no_resched ();
return 1;
}
-int kprobe_fault_handler (struct pt_regs *regs, int trapnr)
+static int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
{
- struct kprobe *cur = kprobe_running ();
- struct kprobe_ctlblk *kcb = get_kprobe_ctlblk ();
+ struct kprobe *cur = swap_kprobe_running();
+ struct kprobe_ctlblk *kcb = swap_get_kprobe_ctlblk();
switch (kcb->kprobe_status)
{
if (kcb->kprobe_status == KPROBE_REENTER)
restore_previous_kprobe (kcb);
else
- reset_current_kprobe ();
+ swap_reset_current_kprobe();
preempt_enable_no_resched ();
break;
case KPROBE_HIT_ACTIVE:
* we can also use npre/npostfault count for accouting
* these specific fault cases.
*/
- kprobes_inc_nmissed_count (cur);
+ swap_kprobes_inc_nmissed_count(cur);
/*
* We come here because instructions in the pre/post
return 0;
}
-int kprobe_exceptions_notify (struct notifier_block *self, unsigned long val, void *data)
+static int kprobe_exceptions_notify(struct notifier_block *self,
+ unsigned long val, void *data)
{
struct die_args *args = (struct die_args *) data;
int ret = NOTIFY_DONE;
ret = NOTIFY_STOP;
break;
case DIE_GPF:
- // kprobe_running() needs smp_processor_id()
+ /* swap_kprobe_running() needs smp_processor_id() */
preempt_disable ();
- if (kprobe_running () && kprobe_fault_handler (args->regs, args->trapnr))
+ if (swap_kprobe_running() &&
+ kprobe_fault_handler(args->regs, args->trapnr))
ret = NOTIFY_STOP;
preempt_enable ();
break;
.priority = INT_MAX
};
-int longjmp_break_handler (struct kprobe *p, struct pt_regs *regs)
+int swap_longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
{
- struct kprobe_ctlblk *kcb = get_kprobe_ctlblk ();
+ struct kprobe_ctlblk *kcb = swap_get_kprobe_ctlblk();
u8 *addr = (u8 *) (regs->EREG (ip) - 1);
unsigned long stack_addr = (unsigned long) (kcb->jprobe_saved_esp);
struct jprobe *jp = container_of (p, struct jprobe, kp);
return 0;
}
-void arch_arm_kprobe (struct kprobe *p)
+void swap_arch_arm_kprobe(struct kprobe *p)
{
swap_text_poke(p->addr,
((unsigned char[]){BREAKPOINT_INSTRUCTION}), 1);
}
-void arch_disarm_kprobe (struct kprobe *p)
+void swap_arch_disarm_kprobe(struct kprobe *p)
{
swap_text_poke(p->addr, &p->opcode, 1);
}
return (void *)trampoline_probe_handler(NULL, regs);
}
-void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs)
+void swap_arch_prepare_kretprobe(struct kretprobe_instance *ri,
+ struct pt_regs *regs)
{
unsigned long *ptr_ret_addr = stack_addr(regs);
ri->ret_addr = (unsigned long *)*ptr_ret_addr;
/* Replace the return addr with trampoline addr */
- *ptr_ret_addr = (unsigned long)&kretprobe_trampoline;
+ *ptr_ret_addr = (unsigned long)&swap_kretprobe_trampoline;
}
int arch_init_module_deps()
return -ESRCH;
}
-int arch_init_kprobes(void)
+int swap_arch_init_kprobes(void)
{
return register_die_notifier (&kprobe_exceptions_nb);
}
-void arch_exit_kprobes(void)
+void swap_arch_exit_kprobes(void)
{
unregister_die_notifier (&kprobe_exceptions_nb);
}
return i;
}
-extern int kprobe_exceptions_notify (struct notifier_block *self, unsigned long val, void *data);
-
struct prev_kprobe {
struct kprobe *kp;
unsigned long status;
};
-int kprobe_fault_handler (struct pt_regs *regs, int trapnr);
-
/* Architecture specific copy of original instruction */
struct arch_specific_insn {
/* copy of the original instruction */
struct slot_manager;
struct kretprobe_instance;
-int arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm);
-void arch_arm_kprobe(struct kprobe *p);
-void arch_disarm_kprobe(struct kprobe *p);
-void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs);
-void kretprobe_trampoline(void);
+int swap_arch_prepare_kprobe(struct kprobe *p, struct slot_manager *sm);
+void swap_arch_arm_kprobe(struct kprobe *p);
+void swap_arch_disarm_kprobe(struct kprobe *p);
+void swap_arch_prepare_kretprobe(struct kretprobe_instance *ri,
+ struct pt_regs *regs);
+void swap_kretprobe_trampoline(void);
void restore_previous_kprobe(struct kprobe_ctlblk *kcb);
-int can_boost(kprobe_opcode_t *opcodes);
+int swap_can_boost(kprobe_opcode_t *opcodes);
static inline int arch_check_insn(struct arch_specific_insn *ainsn)
{
return 0;
return *((unsigned long *)kernel_stack_pointer(regs) + n + 1);
}
-int arch_init_kprobes(void);
-void arch_exit_kprobes(void);
+int swap_arch_init_kprobes(void);
+void swap_arch_exit_kprobes(void);
#endif /* _SWAP_ASM_X86_KPROBES_H */
struct slot_manager sm;
-DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
+DEFINE_PER_CPU(struct kprobe *, swap_current_kprobe) = NULL;
static DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
static DEFINE_SPINLOCK(kretprobe_lock); /* Protects kretprobe_inst_table */
__get_cpu_var(kprobe_instance) = NULL;
}
-/* kprobe_running() will just return the current_kprobe on this CPU */
-struct kprobe *kprobe_running(void)
+/* swap_kprobe_running() will just return the current_kprobe on this CPU */
+struct kprobe *swap_kprobe_running(void)
{
- return __get_cpu_var(current_kprobe);
+ return __get_cpu_var(swap_current_kprobe);
}
-void reset_current_kprobe(void)
+void swap_reset_current_kprobe(void)
{
- __get_cpu_var(current_kprobe) = NULL;
+ __get_cpu_var(swap_current_kprobe) = NULL;
}
-struct kprobe_ctlblk *get_kprobe_ctlblk(void)
+struct kprobe_ctlblk *swap_get_kprobe_ctlblk(void)
{
return &__get_cpu_var(kprobe_ctlblk);
}
* OR
* - with preemption disabled - from arch/xxx/kernel/kprobes.c
*/
-struct kprobe *get_kprobe(void *addr)
+struct kprobe *swap_get_kprobe(void *addr)
{
struct hlist_head *head;
struct kprobe *p;
}
/* Walks the list and increments nmissed count for multiprobe case */
-void kprobes_inc_nmissed_count(struct kprobe *p)
+void swap_kprobes_inc_nmissed_count(struct kprobe *p)
{
struct kprobe *kp;
if (p->pre_handler != aggr_pre_handler) {
p->nmissed = 0;
INIT_LIST_HEAD(&p->list);
- old_p = get_kprobe(p->addr);
+ old_p = swap_get_kprobe(p->addr);
if (old_p) {
ret = register_aggr_kprobe(old_p, p);
if (!ret)
goto out;
}
- if ((ret = arch_prepare_kprobe(p, &sm)) != 0)
+ if ((ret = swap_arch_prepare_kprobe(p, &sm)) != 0)
goto out;
DBPRINTF ("before out ret = 0x%x\n", ret);
INIT_HLIST_NODE(&p->hlist);
hlist_add_head_rcu(&p->hlist, &kprobe_table[hash_ptr(p->addr, KPROBE_HASH_BITS)]);
- arch_arm_kprobe(p);
+ swap_arch_arm_kprobe(p);
out:
DBPRINTF ("out ret = 0x%x\n", ret);
if ((old_p == p) || ((old_p->pre_handler == aggr_pre_handler) &&
(p->list.next == &old_p->list) && (p->list.prev == &old_p->list))) {
/* Only probe on the hash list */
- arch_disarm_kprobe(p);
+ swap_arch_disarm_kprobe(p);
hlist_del_rcu(&old_p->hlist);
if (p != old_p)
{
struct kprobe *old_p, *list_p;
- old_p = get_kprobe(kp->addr);
+ old_p = swap_get_kprobe(kp->addr);
if (unlikely (!old_p))
return;
int swap_register_jprobe(struct jprobe *jp)
{
/* Todo: Verify probepoint is a function entry point */
- jp->kp.pre_handler = setjmp_pre_handler;
- jp->kp.break_handler = longjmp_break_handler;
+ jp->kp.pre_handler = swap_setjmp_pre_handler;
+ jp->kp.break_handler = swap_longjmp_break_handler;
return swap_register_kprobe(&jp->kp);
}
rp->entry_handler(ri, regs);
}
- arch_prepare_kretprobe(ri, regs);
+ swap_arch_prepare_kretprobe(ri, regs);
add_rp_inst(ri);
} else {
struct kretprobe_instance *ri = NULL;
struct hlist_head *head;
unsigned long flags, orig_ret_address = 0;
- unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
+ unsigned long trampoline_address;
struct kprobe_ctlblk *kcb;
struct hlist_node *tmp;
DECLARE_NODE_PTR_FOR_HLIST(node);
+ trampoline_address = (unsigned long)&swap_kretprobe_trampoline;
+
preempt_disable();
- kcb = get_kprobe_ctlblk();
+ kcb = swap_get_kprobe_ctlblk();
spin_lock_irqsave(&kretprobe_lock, flags);
/* another task is sharing our hash bucket */
continue;
if (ri->rp && ri->rp->handler) {
- __get_cpu_var(current_kprobe) = &ri->rp->kp;
- get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
+ __get_cpu_var(swap_current_kprobe) = &ri->rp->kp;
+ swap_get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
ri->rp->handler(ri, regs);
- __get_cpu_var(current_kprobe) = NULL;
+ __get_cpu_var(swap_current_kprobe) = NULL;
}
orig_ret_address = (unsigned long)ri->ret_addr;
if (kcb->kprobe_status == KPROBE_REENTER) {
restore_previous_kprobe(kcb);
} else {
- reset_current_kprobe();
+ swap_reset_current_kprobe();
}
spin_unlock_irqrestore(&kretprobe_lock, flags);
static int swap_disarm_krp_inst(struct kretprobe_instance *ri)
{
- unsigned long *tramp = (unsigned long *)&kretprobe_trampoline;
+ unsigned long *tramp = (unsigned long *)&swap_kretprobe_trampoline;
unsigned long *sp = ri->sp;
unsigned long *found = NULL;
int retval = -ENOENT;
return err;
}
- err = arch_init_kprobes();
-
- DBPRINTF ("init_kprobes: arch_init_kprobes - %d", err);
+ err = swap_arch_init_kprobes();
return err;
}
static void __exit exit_kprobes(void)
{
- arch_exit_kprobes();
+ swap_arch_exit_kprobes();
exit_sm();
}
};
-extern void kprobes_inc_nmissed_count (struct kprobe *p);
+extern void swap_kprobes_inc_nmissed_count(struct kprobe *p);
//
// Large value for fast but memory consuming implementation
/* Get the kprobe at this addr (if any) - called with preemption disabled */
-struct kprobe *get_kprobe(void *addr);
+struct kprobe *swap_get_kprobe(void *addr);
int swap_register_kprobe(struct kprobe *p);
void swap_unregister_kprobe(struct kprobe *p);
-int setjmp_pre_handler (struct kprobe *, struct pt_regs *);
-int longjmp_break_handler (struct kprobe *, struct pt_regs *);
+int swap_setjmp_pre_handler(struct kprobe *, struct pt_regs *);
+int swap_longjmp_break_handler(struct kprobe *, struct pt_regs *);
int swap_register_jprobe(struct jprobe *p);
void swap_unregister_jprobe(struct jprobe *p);
int trampoline_probe_handler (struct kprobe *p, struct pt_regs *regs);
-extern DEFINE_PER_CPU (struct kprobe *, current_kprobe);
+extern DEFINE_PER_CPU(struct kprobe *, swap_current_kprobe);
extern struct hlist_head kprobe_table[KPROBE_TABLE_SIZE];
//extern struct hlist_head kretprobe_inst_table[KPROBE_TABLE_SIZE];
extern atomic_t kprobe_count;
extern unsigned long sched_addr;
-struct kprobe *kprobe_running (void);
-void reset_current_kprobe (void);
-struct kprobe_ctlblk *get_kprobe_ctlblk (void);
+struct kprobe *swap_kprobe_running(void);
+void swap_reset_current_kprobe(void);
+struct kprobe_ctlblk *swap_get_kprobe_ctlblk(void);
void prepare_singlestep(struct kprobe *p, struct pt_regs *regs);
/* TODO: remove dual info */
p->opcode = tramp[0];
- p->ainsn.boostable = can_boost(tramp) ? 0 : -1;
+ p->ainsn.boostable = swap_can_boost(tramp) ? 0 : -1;
return ret;
}