summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2014-05-08 16:32:39 +0400
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>2014-05-08 16:32:39 +0400
commit452b14068fd6b6c37b03c5c3adf32d4597b574a4 (patch)
tree3a4233ca839ff62b00eeb4dbe0496f07c0d5b401
parentda27329481fed55683979669c0c823b5674668ef (diff)
downloadswap-modules-452b14068fd6b6c37b03c5c3adf32d4597b574a4.tar.gz
swap-modules-452b14068fd6b6c37b03c5c3adf32d4597b574a4.tar.bz2
swap-modules-452b14068fd6b6c37b03c5c3adf32d4597b574a4.zip
[REFACTOR] change prefix dbi* -> swap*
Change-Id: I01f9f7bef16c231ac2c7031424174ceba52b9296 Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
-rw-r--r--energy/energy.c25
-rw-r--r--energy/lcd/maru.c6
-rw-r--r--energy/lcd/s6e8aa0.c12
-rw-r--r--energy/lcd/s6e8aa0_panel.c12
-rw-r--r--kprobe/Kbuild6
-rw-r--r--kprobe/arch/asm-arm/swap_kprobes.c (renamed from kprobe/arch/asm-arm/dbi_kprobes.c)19
-rw-r--r--kprobe/arch/asm-arm/swap_kprobes.h (renamed from kprobe/arch/asm-arm/dbi_kprobes.h)25
-rw-r--r--kprobe/arch/asm-x86/swap_kprobes.c (renamed from kprobe/arch/asm-x86/dbi_kprobes.c)23
-rw-r--r--kprobe/arch/asm-x86/swap_kprobes.h (renamed from kprobe/arch/asm-x86/dbi_kprobes.h)33
-rw-r--r--kprobe/swap_kdebug.h (renamed from kprobe/dbi_kdebug.h)8
-rw-r--r--kprobe/swap_kprobes.c (renamed from kprobe/dbi_kprobes.c)106
-rw-r--r--kprobe/swap_kprobes.h (renamed from kprobe/dbi_kprobes.h)40
-rw-r--r--kprobe/swap_kprobes_deps.c (renamed from kprobe/dbi_kprobes_deps.c)28
-rw-r--r--kprobe/swap_kprobes_deps.h (renamed from kprobe/dbi_kprobes_deps.h)8
-rw-r--r--kprobe/swap_slots.c2
-rw-r--r--ks_features/ks_features.c14
-rw-r--r--ks_manager/ks_manager.c14
-rw-r--r--ks_manager/ks_manager.h2
-rw-r--r--sampler/sampler_hrtimer.c16
-rw-r--r--sampler/sampler_timer.c16
-rw-r--r--sampler/swap_sampler_module.c24
-rw-r--r--uprobe/arch/asm-arm/swap_uprobes.c12
-rw-r--r--uprobe/arch/asm-arm/swap_uprobes.h3
-rw-r--r--uprobe/arch/asm-x86/swap_uprobes.c1
-rw-r--r--uprobe/arch/asm-x86/swap_uprobes.h9
-rw-r--r--uprobe/swap_uprobes.c71
-rw-r--r--uprobe/swap_uprobes.h30
-rw-r--r--us_manager/helper.c48
-rw-r--r--us_manager/sspt/sspt.h6
-rw-r--r--us_manager/sspt/sspt_debug.h2
-rw-r--r--us_manager/sspt/sspt_file.c2
-rw-r--r--us_manager/us_slot_manager.c2
-rw-r--r--writer/swap_writer_module.c2
33 files changed, 314 insertions, 313 deletions
diff --git a/energy/energy.c b/energy/energy.c
index 09181902..f311c7d8 100644
--- a/energy/energy.c
+++ b/energy/energy.c
@@ -30,7 +30,7 @@
#include <linux/magic.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
#include <ksyms/ksyms.h>
#include <us_manager/sspt/sspt_proc.h>
#include <us_manager/sspt/sspt_feature.h>
@@ -533,21 +533,22 @@ int do_set_energy(void)
init_data_energy();
- ret = dbi_register_kretprobe(&sys_read_krp);
+ ret = swap_register_kretprobe(&sys_read_krp);
if (ret) {
- printk("dbi_register_kretprobe(sys_read) result=%d!\n", ret);
+ printk("swap_register_kretprobe(sys_read) result=%d!\n", ret);
return ret;
}
- ret = dbi_register_kretprobe(&sys_write_krp);
+ ret = swap_register_kretprobe(&sys_write_krp);
if (ret != 0) {
- printk("dbi_register_kretprobe(sys_write) result=%d!\n", ret);
+ printk("swap_register_kretprobe(sys_write) result=%d!\n", ret);
goto unregister_sys_read;
}
- ret = dbi_register_kretprobe(&switch_to_krp);
+ ret = swap_register_kretprobe(&switch_to_krp);
if (ret) {
- printk("dbi_register_kretprobe(__switch_to) result=%d!\n", ret);
+ printk("swap_register_kretprobe(__switch_to) result=%d!\n",
+ ret);
goto unregister_sys_write;
}
@@ -557,10 +558,10 @@ int do_set_energy(void)
return ret;
unregister_sys_read:
- dbi_unregister_kretprobe(&sys_read_krp);
+ swap_unregister_kretprobe(&sys_read_krp);
unregister_sys_write:
- dbi_unregister_kretprobe(&sys_write_krp);
+ swap_unregister_kretprobe(&sys_write_krp);
return ret;
}
@@ -569,9 +570,9 @@ void do_unset_energy(void)
{
lcd_unset_energy();
- dbi_unregister_kretprobe(&switch_to_krp);
- dbi_unregister_kretprobe(&sys_write_krp);
- dbi_unregister_kretprobe(&sys_read_krp);
+ swap_unregister_kretprobe(&switch_to_krp);
+ swap_unregister_kretprobe(&sys_write_krp);
+ swap_unregister_kretprobe(&sys_read_krp);
uninit_data_energy();
}
diff --git a/energy/lcd/maru.c b/energy/lcd/maru.c
index fb75f884..ebb6e45b 100644
--- a/energy/lcd/maru.c
+++ b/energy/lcd/maru.c
@@ -23,7 +23,7 @@
*/
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
#include <linux/backlight.h>
#include "lcd_base.h"
@@ -99,12 +99,12 @@ static struct kretprobe set_backlight_krp = {
static int maru_set(struct lcd_ops *ops)
{
- return dbi_register_kretprobe(&set_backlight_krp);
+ return swap_register_kretprobe(&set_backlight_krp);
}
static int maru_unset(struct lcd_ops *ops)
{
- dbi_unregister_kretprobe(&set_backlight_krp);
+ swap_unregister_kretprobe(&set_backlight_krp);
return 0;
}
diff --git a/energy/lcd/s6e8aa0.c b/energy/lcd/s6e8aa0.c
index b6075577..c02016d0 100644
--- a/energy/lcd/s6e8aa0.c
+++ b/energy/lcd/s6e8aa0.c
@@ -1,4 +1,4 @@
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
#include "lcd_base.h"
@@ -82,21 +82,21 @@ int s6e8aa0_set(struct lcd_ops *ops)
{
int ret;
- ret = dbi_register_kretprobe(&set_power_krp);
+ ret = swap_register_kretprobe(&set_power_krp);
if (ret)
return ret;
- ret = dbi_register_kretprobe(&set_backlight_krp);
+ ret = swap_register_kretprobe(&set_backlight_krp);
if (ret)
- dbi_unregister_kretprobe(&set_power_krp);
+ swap_unregister_kretprobe(&set_power_krp);
return ret;
}
int s6e8aa0_unset(struct lcd_ops *ops)
{
- dbi_unregister_kretprobe(&set_backlight_krp);
- dbi_unregister_kretprobe(&set_power_krp);
+ swap_unregister_kretprobe(&set_backlight_krp);
+ swap_unregister_kretprobe(&set_power_krp);
return 0;
}
diff --git a/energy/lcd/s6e8aa0_panel.c b/energy/lcd/s6e8aa0_panel.c
index 1b5abfa3..ccd0d49f 100644
--- a/energy/lcd/s6e8aa0_panel.c
+++ b/energy/lcd/s6e8aa0_panel.c
@@ -1,4 +1,4 @@
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
#include <linux/backlight.h>
#include "lcd_base.h"
@@ -81,21 +81,21 @@ int s6e8aa0_set(struct lcd_ops *ops)
{
int ret;
- ret = dbi_register_kretprobe(&set_power_krp);
+ ret = swap_register_kretprobe(&set_power_krp);
if (ret)
return ret;
- ret = dbi_register_kretprobe(&set_backlight_krp);
+ ret = swap_register_kretprobe(&set_backlight_krp);
if (ret)
- dbi_unregister_kretprobe(&set_power_krp);
+ swap_unregister_kretprobe(&set_power_krp);
return ret;
}
int s6e8aa0_unset(struct lcd_ops *ops)
{
- dbi_unregister_kretprobe(&set_backlight_krp);
- dbi_unregister_kretprobe(&set_power_krp);
+ swap_unregister_kretprobe(&set_backlight_krp);
+ swap_unregister_kretprobe(&set_power_krp);
return 0;
}
diff --git a/kprobe/Kbuild b/kprobe/Kbuild
index a9994fbf..b5a9a098 100644
--- a/kprobe/Kbuild
+++ b/kprobe/Kbuild
@@ -1,8 +1,8 @@
EXTRA_CFLAGS := $(extra_cflags)
obj-m := swap_kprobe.o
-swap_kprobe-y := dbi_kprobes.o \
- dbi_kprobes_deps.o \
- arch/asm/dbi_kprobes.o \
+swap_kprobe-y := swap_kprobes.o \
+ swap_kprobes_deps.o \
+ arch/asm/swap_kprobes.o \
swap_slots.o
swap_kprobe-$(CONFIG_ARM) += arch/asm/trampoline_arm.o
diff --git a/kprobe/arch/asm-arm/dbi_kprobes.c b/kprobe/arch/asm-arm/swap_kprobes.c
index 313bd06f..751accb3 100644
--- a/kprobe/arch/asm-arm/dbi_kprobes.c
+++ b/kprobe/arch/asm-arm/swap_kprobes.c
@@ -1,6 +1,6 @@
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/arch/asm-arm/dbi_kprobes.c
+ * modules/kprobe/arch/asm-arm/swap_kprobes.c
*
* 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
@@ -32,13 +32,13 @@
#include <linux/module.h>
#include <linux/mm.h>
-#include "dbi_kprobes.h"
+#include "swap_kprobes.h"
#include "trampoline_arm.h"
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
-#include <kprobe/dbi_kdebug.h>
+#include <kprobe/swap_kdebug.h>
#include <kprobe/swap_slots.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes_deps.h>
#include <ksyms/ksyms.h>
#include <asm/cacheflush.h>
@@ -440,15 +440,16 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
entry(regs->ARM_r0, regs->ARM_r1, regs->ARM_r2,
regs->ARM_r3, regs->ARM_r4, regs->ARM_r5);
} else {
- dbi_jprobe_return();
+ swap_jprobe_return();
}
return 0;
}
-void dbi_jprobe_return (void)
+void swap_jprobe_return(void)
{
}
+EXPORT_SYMBOL_GPL(swap_jprobe_return);
int longjmp_break_handler (struct kprobe *p, struct pt_regs *regs)
{
@@ -604,7 +605,7 @@ static int kjump_init(void)
{
int ret;
- ret = dbi_register_kprobe(&kjump_kprobe);
+ ret = swap_register_kprobe(&kjump_kprobe);
if (ret)
printk("ERROR: kjump_init(), ret=%d\n", ret);
@@ -613,7 +614,7 @@ static int kjump_init(void)
static void kjump_exit(void)
{
- dbi_unregister_kprobe(&kjump_kprobe);
+ swap_unregister_kprobe(&kjump_kprobe);
}
diff --git a/kprobe/arch/asm-arm/dbi_kprobes.h b/kprobe/arch/asm-arm/swap_kprobes.h
index efc2679d..6b624a27 100644
--- a/kprobe/arch/asm-arm/dbi_kprobes.h
+++ b/kprobe/arch/asm-arm/swap_kprobes.h
@@ -1,9 +1,9 @@
-#ifndef _DBI_ASM_ARM_KPROBES_H
-#define _DBI_ASM_ARM_KPROBES_H
+#ifndef _SWAP_ASM_ARM_KPROBES_H
+#define _SWAP_ASM_ARM_KPROBES_H
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/arch/asm-arm/dbi_kprobes.h
+ * modules/kprobe/arch/asm-arm/swap_kprobes.h
*
* 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
@@ -80,42 +80,43 @@ static inline void arch_set_task_pc(struct task_struct *p, unsigned long val)
task_thread_info(p)->cpu_context.pc = val;
}
-static inline struct pt_regs *dbi_get_syscall_uregs(unsigned long sp)
+static inline struct pt_regs *swap_get_syscall_uregs(unsigned long sp)
{
return (struct pt_regs *)(sp + UREGS_OFFSET);
}
-static inline unsigned long dbi_get_stack_ptr(struct pt_regs *regs)
+static inline unsigned long swap_get_stack_ptr(struct pt_regs *regs)
{
return regs->ARM_sp;
}
-static inline unsigned long dbi_get_instr_ptr(struct pt_regs *regs)
+static inline unsigned long swap_get_instr_ptr(struct pt_regs *regs)
{
return regs->ARM_pc;
}
-static inline void dbi_set_instr_ptr(struct pt_regs *regs, unsigned long val)
+static inline void swap_set_instr_ptr(struct pt_regs *regs, unsigned long val)
{
regs->ARM_pc = val;
}
-static inline unsigned long dbi_get_ret_addr(struct pt_regs *regs)
+static inline unsigned long swap_get_ret_addr(struct pt_regs *regs)
{
return regs->ARM_lr;
}
-static inline void dbi_set_ret_addr(struct pt_regs *regs, unsigned long val)
+static inline void swap_set_ret_addr(struct pt_regs *regs, unsigned long val)
{
regs->ARM_lr = val;
}
-static inline unsigned long dbi_get_arg(struct pt_regs *regs, int num)
+static inline unsigned long swap_get_arg(struct pt_regs *regs, int num)
{
return regs->uregs[num];
}
-static inline void dbi_set_arg(struct pt_regs *regs, int num, unsigned long val)
+static inline void swap_set_arg(struct pt_regs *regs, int num,
+ unsigned long val)
{
regs->uregs[num] = val;
}
@@ -549,4 +550,4 @@ void arch_exit_kprobes(void);
//void gen_insn_execbuf_holder (void);
//void pc_dep_insn_execbuf_holder (void);
-#endif /* _DBI_ASM_ARM_KPROBES_H */
+#endif /* _SWAP_ASM_ARM_KPROBES_H */
diff --git a/kprobe/arch/asm-x86/dbi_kprobes.c b/kprobe/arch/asm-x86/swap_kprobes.c
index c69a831f..0c8b6056 100644
--- a/kprobe/arch/asm-x86/dbi_kprobes.c
+++ b/kprobe/arch/asm-x86/swap_kprobes.c
@@ -21,7 +21,7 @@
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/arch/asm-x86/dbi_kprobes.c
+ * modules/kprobe/arch/asm-x86/swap_kprobes.c
*
* 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
@@ -48,12 +48,12 @@
#include<linux/module.h>
#include <linux/kdebug.h>
-#include "dbi_kprobes.h"
-#include <kprobe/dbi_kprobes.h>
+#include "swap_kprobes.h"
+#include <kprobe/swap_kprobes.h>
-#include <kprobe/dbi_kdebug.h>
+#include <kprobe/swap_kdebug.h>
#include <kprobe/swap_slots.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes_deps.h>
#define SUPRESS_BUG_MESSAGES
extern struct kprobe * per_cpu__current_kprobe;
@@ -489,18 +489,19 @@ int setjmp_pre_handler (struct kprobe *p, struct pt_regs *regs)
return 1;
}
-void dbi_jprobe_return_end(void);
+void swap_jprobe_return_end(void);
-void dbi_jprobe_return (void)
+void swap_jprobe_return(void)
{
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk ();
asm volatile(" xchgl %%ebx,%%esp \n"
" int3 \n"
- " .globl dbi_jprobe_return_end \n"
- " dbi_jprobe_return_end: \n"
+ " .globl swap_jprobe_return_end \n"
+ " swap_jprobe_return_end: \n"
" nop \n"::"b" (kcb->jprobe_saved_esp):"memory");
}
+EXPORT_SYMBOL_GPL(swap_jprobe_return);
void arch_ujprobe_return(void)
{
@@ -771,8 +772,8 @@ int longjmp_break_handler (struct kprobe *p, struct pt_regs *regs)
DBPRINTF ("p = %p\n", p);
- if ((addr > (u8 *) dbi_jprobe_return) && (addr < (u8 *) dbi_jprobe_return_end))
- {
+ if ((addr > (u8 *)swap_jprobe_return) &&
+ (addr < (u8 *)swap_jprobe_return_end)) {
if (stack_addr(regs) != kcb->jprobe_saved_esp) {
struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
printk("current esp %p does not match saved esp %p\n",
diff --git a/kprobe/arch/asm-x86/dbi_kprobes.h b/kprobe/arch/asm-x86/swap_kprobes.h
index 6850c243..421ca286 100644
--- a/kprobe/arch/asm-x86/dbi_kprobes.h
+++ b/kprobe/arch/asm-x86/swap_kprobes.h
@@ -1,5 +1,5 @@
-#ifndef _SRC_ASM_X86_KPROBES_H
-#define _SRC_ASM_X86_KPROBES_H
+#ifndef _SWAP_ASM_X86_KPROBES_H
+#define _SWAP_ASM_X86_KPROBES_H
/*
* Kernel Probes (KProbes)
@@ -24,7 +24,7 @@
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/arch/asm-x86/dbi_kprobes.c
+ * modules/kprobe/arch/asm-x86/swap_kprobes.c
*
* 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
@@ -50,7 +50,7 @@
*/
#include <linux/version.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes_deps.h>
typedef u8 kprobe_opcode_t;
@@ -103,39 +103,39 @@ static inline void arch_set_task_pc(struct task_struct *p, unsigned long val)
/* FIXME: Not implemented yet */
}
-static inline struct pt_regs *dbi_get_syscall_uregs(unsigned long sp)
+static inline struct pt_regs *swap_get_syscall_uregs(unsigned long sp)
{
return NULL; //FIXME currently not implemented for x86
}
-static inline unsigned long dbi_get_stack_ptr(struct pt_regs *regs)
+static inline unsigned long swap_get_stack_ptr(struct pt_regs *regs)
{
return regs->EREG(sp);
}
-static inline unsigned long dbi_get_instr_ptr(struct pt_regs *regs)
+static inline unsigned long swap_get_instr_ptr(struct pt_regs *regs)
{
return regs->EREG(ip);
}
-static inline void dbi_set_instr_ptr(struct pt_regs *regs, unsigned long val)
+static inline void swap_set_instr_ptr(struct pt_regs *regs, unsigned long val)
{
regs->EREG(ip) = val;
}
-static inline unsigned long dbi_get_ret_addr(struct pt_regs *regs)
+static inline unsigned long swap_get_ret_addr(struct pt_regs *regs)
{
unsigned long addr = 0;
read_proc_vm_atomic(current, regs->EREG(sp), &addr, sizeof(addr));
return addr;
}
-static inline void dbi_set_ret_addr(struct pt_regs *regs, unsigned long val)
+static inline void swap_set_ret_addr(struct pt_regs *regs, unsigned long val)
{
write_proc_vm_atomic(current, regs->EREG(sp), &val, sizeof(val));
}
-static inline unsigned long dbi_get_arg(struct pt_regs *regs, int num)
+static inline unsigned long swap_get_arg(struct pt_regs *regs, int num)
{
unsigned long arg = 0;
read_proc_vm_atomic(current, regs->EREG(sp) + (1 + num) * 4,
@@ -143,14 +143,15 @@ static inline unsigned long dbi_get_arg(struct pt_regs *regs, int num)
return arg;
}
-static inline void dbi_set_arg(struct pt_regs *regs, int num, unsigned long val)
+static inline void swap_set_arg(struct pt_regs *regs, int num,
+ unsigned long val)
{
write_proc_vm_atomic(current, regs->EREG(sp) + (1 + num) * 4,
&val, sizeof(val));
}
-static inline int dbi_fp_backtrace(struct task_struct *task, unsigned long *buf,
- int max_cnt)
+static inline int swap_fp_backtrace(struct task_struct *task,
+ unsigned long *buf, int max_cnt)
{
int i = 0;
struct pt_regs *regs;
@@ -163,7 +164,7 @@ static inline int dbi_fp_backtrace(struct task_struct *task, unsigned long *buf,
regs = task_pt_regs(task);
frame.next = regs->EREG(bp);
- frame.raddr = dbi_get_ret_addr(regs);
+ frame.raddr = swap_get_ret_addr(regs);
while (frame.next && i < max_cnt) {
if (read_proc_vm_atomic(task, frame.next, &frame, sizeof(frame))
@@ -256,4 +257,4 @@ static inline unsigned long swap_get_sarg(struct pt_regs *regs, unsigned long n)
int arch_init_kprobes(void);
void arch_exit_kprobes(void);
-#endif /* _SRC_ASM_X86_KPROBES_H */
+#endif /* _SWAP_ASM_X86_KPROBES_H */
diff --git a/kprobe/dbi_kdebug.h b/kprobe/swap_kdebug.h
index ffc6f961..8c7b3ff7 100644
--- a/kprobe/dbi_kdebug.h
+++ b/kprobe/swap_kdebug.h
@@ -1,9 +1,9 @@
-#ifndef _DBI_KPROBE_DEBUG_H
-#define _DBI_KPROBE_DEBUG_H
+#ifndef _SWAP_KPROBE_DEBUG_H
+#define _SWAP_KPROBE_DEBUG_H
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/dbi_kdebug.h
+ * modules/kprobe/swap_kdebug.h
*
* 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
@@ -42,4 +42,4 @@
#endif
-#endif /* _DBI_KPROBE_DEBUG_H */
+#endif /* _SWAP_KPROBE_DEBUG_H */
diff --git a/kprobe/dbi_kprobes.c b/kprobe/swap_kprobes.c
index 35e321ec..2b46adca 100644
--- a/kprobe/dbi_kprobes.c
+++ b/kprobe/swap_kprobes.c
@@ -21,7 +21,7 @@
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/dbi_kprobes.h
+ * modules/kprobe/swap_kprobes.h
*
* 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
@@ -46,13 +46,6 @@
*
*/
-#include "dbi_kprobes.h"
-#include <kprobe/arch/asm/dbi_kprobes.h>
-
-#include "dbi_kdebug.h"
-#include "dbi_kprobes_deps.h"
-#include "swap_slots.h"
-#include <ksyms/ksyms.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
@@ -64,6 +57,15 @@
#include <linux/mm.h>
#include <linux/pagemap.h>
+#include <ksyms/ksyms.h>
+#include <kprobe/arch/asm/swap_kprobes.h>
+
+#include "swap_slots.h"
+#include "swap_kdebug.h"
+#include "swap_kprobes.h"
+#include "swap_kprobes_deps.h"
+
+
unsigned long sched_addr;
static unsigned long exit_addr;
static unsigned long do_group_exit_addr;
@@ -289,7 +291,8 @@ static struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp)
}
if (!alloc_nodes_kretprobe(rp)) {
- swap_hlist_for_each_entry(ri, node, &rp->free_instances, uflist) {
+ swap_hlist_for_each_entry(ri, node, &rp->free_instances,
+ uflist) {
return ri;
}
}
@@ -414,7 +417,8 @@ static int add_new_kprobe(struct kprobe *old_p, struct kprobe *p)
*
* The @old entry will be replaced with the @new entry atomically.
*/
-inline void dbi_hlist_replace_rcu(struct hlist_node *old, struct hlist_node *new)
+inline void swap_hlist_replace_rcu(struct hlist_node *old,
+ struct hlist_node *new)
{
struct hlist_node *next = old->next;
@@ -446,7 +450,7 @@ static inline void add_aggr_kprobe(struct kprobe *ap, struct kprobe *p)
INIT_LIST_HEAD(&ap->list);
list_add_rcu(&p->list, &ap->list);
- dbi_hlist_replace_rcu(&p->hlist, &ap->hlist);
+ swap_hlist_replace_rcu(&p->hlist, &ap->hlist);
}
/*
@@ -491,7 +495,7 @@ static void remove_kprobe(struct kprobe *p)
swap_slot_free(&sm, p->ainsn.insn);
}
-int dbi_register_kprobe(struct kprobe *p)
+int swap_register_kprobe(struct kprobe *p)
{
struct kprobe *old_p;
int ret = 0;
@@ -541,8 +545,9 @@ out:
DBPRINTF ("out ret = 0x%x\n", ret);
return ret;
}
+EXPORT_SYMBOL_GPL(swap_register_kprobe);
-static void dbi_unregister_valid_kprobe(struct kprobe *p, struct kprobe *old_p)
+static void swap_unregister_valid_kprobe(struct kprobe *p, struct kprobe *old_p)
{
struct kprobe *list_p;
@@ -573,7 +578,7 @@ static void dbi_unregister_valid_kprobe(struct kprobe *p, struct kprobe *old_p)
p->addr = NULL;
}
-void dbi_unregister_kprobe(struct kprobe *kp)
+void swap_unregister_kprobe(struct kprobe *kp)
{
struct kprobe *old_p, *list_p;
@@ -585,26 +590,29 @@ void dbi_unregister_kprobe(struct kprobe *kp)
list_for_each_entry_rcu(list_p, &old_p->list, list)
if (list_p == kp)
/* kprobe p is a valid probe */
- dbi_unregister_valid_kprobe(kp, old_p);
+ swap_unregister_valid_kprobe(kp, old_p);
return;
}
- dbi_unregister_valid_kprobe(kp, old_p);
+ swap_unregister_valid_kprobe(kp, old_p);
}
+EXPORT_SYMBOL_GPL(swap_unregister_kprobe);
-int dbi_register_jprobe(struct jprobe *jp)
+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;
- return dbi_register_kprobe(&jp->kp);
+ return swap_register_kprobe(&jp->kp);
}
+EXPORT_SYMBOL_GPL(swap_register_jprobe);
-void dbi_unregister_jprobe(struct jprobe *jp)
+void swap_unregister_jprobe(struct jprobe *jp)
{
- dbi_unregister_kprobe(&jp->kp);
+ swap_unregister_kprobe(&jp->kp);
}
+EXPORT_SYMBOL_GPL(swap_unregister_jprobe);
/*
* This kprobe pre_handler is registered with every kretprobe. When probe
@@ -762,7 +770,7 @@ static int alloc_nodes_kretprobe(struct kretprobe *rp)
return 0;
}
-int dbi_register_kretprobe(struct kretprobe *rp)
+int swap_register_kretprobe(struct kretprobe *rp)
{
int ret = 0;
struct kretprobe_instance *inst;
@@ -809,23 +817,24 @@ int dbi_register_kretprobe(struct kretprobe *rp)
DBPRINTF ("addr=%p, *addr=[%lx %lx %lx]", rp->kp.addr, (unsigned long) (*(rp->kp.addr)), (unsigned long) (*(rp->kp.addr + 1)), (unsigned long) (*(rp->kp.addr + 2)));
rp->nmissed = 0;
/* Establish function entry probe point */
- if ((ret = dbi_register_kprobe(&rp->kp)) != 0)
+ if ((ret = swap_register_kprobe(&rp->kp)) != 0)
free_rp_inst(rp);
DBPRINTF ("addr=%p, *addr=[%lx %lx %lx]", rp->kp.addr, (unsigned long) (*(rp->kp.addr)), (unsigned long) (*(rp->kp.addr + 1)), (unsigned long) (*(rp->kp.addr + 2)));
return ret;
}
+EXPORT_SYMBOL_GPL(swap_register_kretprobe);
-static int dbi_disarm_krp_inst(struct kretprobe_instance *ri);
+static int swap_disarm_krp_inst(struct kretprobe_instance *ri);
-static void dbi_disarm_krp(struct kretprobe *rp)
+static void swap_disarm_krp(struct kretprobe *rp)
{
struct kretprobe_instance *ri;
DECLARE_NODE_PTR_FOR_HLIST(node);
swap_hlist_for_each_entry(ri, node, &rp->used_instances, uflist) {
- if (dbi_disarm_krp_inst(ri) != 0) {
+ if (swap_disarm_krp_inst(ri) != 0) {
printk("%s (%d/%d): cannot disarm krp instance (%08lx)\n",
ri->task->comm, ri->task->tgid, ri->task->pid,
(unsigned long)rp->kp.addr);
@@ -833,7 +842,7 @@ static void dbi_disarm_krp(struct kretprobe *rp)
}
}
-void dbi_unregister_kretprobes_top(struct kretprobe **rps, size_t size,
+void swap_unregister_kretprobes_top(struct kretprobe **rps, size_t size,
int rp_disarm)
{
unsigned long flags;
@@ -841,21 +850,21 @@ void dbi_unregister_kretprobes_top(struct kretprobe **rps, size_t size,
spin_lock_irqsave(&kretprobe_lock, flags);
for (--size; size != end; --size) {
- dbi_unregister_kprobe(&rps[size]->kp);
+ swap_unregister_kprobe(&rps[size]->kp);
if (rp_disarm)
- dbi_disarm_krp(rps[size]);
+ swap_disarm_krp(rps[size]);
}
spin_unlock_irqrestore(&kretprobe_lock, flags);
}
-EXPORT_SYMBOL_GPL(dbi_unregister_kretprobes_top);
+EXPORT_SYMBOL_GPL(swap_unregister_kretprobes_top);
-void dbi_unregister_kretprobe_top(struct kretprobe *rp, int rp_disarm)
+void swap_unregister_kretprobe_top(struct kretprobe *rp, int rp_disarm)
{
- dbi_unregister_kretprobes_top(&rp, 1, rp_disarm);
+ swap_unregister_kretprobes_top(&rp, 1, rp_disarm);
}
-EXPORT_SYMBOL_GPL(dbi_unregister_kretprobe_top);
+EXPORT_SYMBOL_GPL(swap_unregister_kretprobe_top);
-void dbi_unregister_kretprobe_bottom(struct kretprobe *rp)
+void swap_unregister_kretprobe_bottom(struct kretprobe *rp)
{
unsigned long flags;
struct kretprobe_instance *ri;
@@ -872,38 +881,40 @@ void dbi_unregister_kretprobe_bottom(struct kretprobe *rp)
spin_unlock_irqrestore(&kretprobe_lock, flags);
}
-EXPORT_SYMBOL_GPL(dbi_unregister_kretprobe_bottom);
+EXPORT_SYMBOL_GPL(swap_unregister_kretprobe_bottom);
-void dbi_unregister_kretprobes_bottom(struct kretprobe **rps, size_t size)
+void swap_unregister_kretprobes_bottom(struct kretprobe **rps, size_t size)
{
const size_t end = ((size_t) 0) - 1;
for (--size; size != end; --size)
- dbi_unregister_kretprobe_bottom(rps[size]);
+ swap_unregister_kretprobe_bottom(rps[size]);
}
-EXPORT_SYMBOL_GPL(dbi_unregister_kretprobes_bottom);
+EXPORT_SYMBOL_GPL(swap_unregister_kretprobes_bottom);
-void dbi_unregister_kretprobes(struct kretprobe **rpp, size_t size)
+void swap_unregister_kretprobes(struct kretprobe **rpp, size_t size)
{
- dbi_unregister_kretprobes_top(rpp, size, 1);
+ swap_unregister_kretprobes_top(rpp, size, 1);
if (!in_atomic())
synchronize_sched();
- dbi_unregister_kretprobes_bottom(rpp, size);
+ swap_unregister_kretprobes_bottom(rpp, size);
}
+EXPORT_SYMBOL_GPL(swap_unregister_kretprobes);
-void dbi_unregister_kretprobe(struct kretprobe *rp)
+void swap_unregister_kretprobe(struct kretprobe *rp)
{
- dbi_unregister_kretprobes(&rp, 1);
+ swap_unregister_kretprobes(&rp, 1);
}
+EXPORT_SYMBOL_GPL(swap_unregister_kretprobe);
static void inline rm_task_trampoline(struct task_struct *p, struct kretprobe_instance *ri)
{
arch_set_task_pc(p, (unsigned long)ri->ret_addr);
}
-static int dbi_disarm_krp_inst(struct kretprobe_instance *ri)
+static int swap_disarm_krp_inst(struct kretprobe_instance *ri)
{
unsigned long *tramp = (unsigned long *)&kretprobe_trampoline;
unsigned long *sp = ri->sp;
@@ -1029,13 +1040,4 @@ static void __exit exit_kprobes(void)
module_init(init_kprobes);
module_exit(exit_kprobes);
-EXPORT_SYMBOL_GPL(dbi_register_kprobe);
-EXPORT_SYMBOL_GPL(dbi_unregister_kprobe);
-EXPORT_SYMBOL_GPL(dbi_register_jprobe);
-EXPORT_SYMBOL_GPL(dbi_unregister_jprobe);
-EXPORT_SYMBOL_GPL(dbi_jprobe_return);
-EXPORT_SYMBOL_GPL(dbi_register_kretprobe);
-EXPORT_SYMBOL_GPL(dbi_unregister_kretprobes);
-EXPORT_SYMBOL_GPL(dbi_unregister_kretprobe);
-
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/kprobe/dbi_kprobes.h b/kprobe/swap_kprobes.h
index 89c67db1..aa29f085 100644
--- a/kprobe/dbi_kprobes.h
+++ b/kprobe/swap_kprobes.h
@@ -1,5 +1,5 @@
-#ifndef _DBI_KPROBES_H
-#define _DBI_KPROBES_H
+#ifndef _SWAP_KPROBES_H
+#define _SWAP_KPROBES_H
/*
* Kernel Probes (KProbes)
@@ -24,7 +24,7 @@
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/dbi_kprobes.h
+ * modules/kprobe/swap_kprobes.h
*
* 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
@@ -58,7 +58,7 @@
#include <linux/sched.h>
#include <linux/pagemap.h>
-#include <kprobe/arch/asm/dbi_kprobes.h>
+#include <kprobe/arch/asm/swap_kprobes.h>
#ifdef CONFIG_ARM
@@ -232,37 +232,37 @@ extern void kprobes_inc_nmissed_count (struct kprobe *p);
struct kprobe *get_kprobe(void *addr);
-int dbi_register_kprobe (struct kprobe *p);
-void dbi_unregister_kprobe(struct kprobe *p);
+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 dbi_register_jprobe (struct jprobe *p);
-void dbi_unregister_jprobe (struct jprobe *p);
-void dbi_jprobe_return (void);
+int swap_register_jprobe(struct jprobe *p);
+void swap_unregister_jprobe(struct jprobe *p);
+void swap_jprobe_return(void);
-int dbi_register_kretprobe (struct kretprobe *rp);
-void dbi_unregister_kretprobe (struct kretprobe *rp);
-void dbi_unregister_kretprobes(struct kretprobe **rpp, size_t size);
+int swap_register_kretprobe(struct kretprobe *rp);
+void swap_unregister_kretprobe(struct kretprobe *rp);
+void swap_unregister_kretprobes(struct kretprobe **rpp, size_t size);
/*
* use:
- * dbi_unregister_kretprobe[s]_top();
+ * swap_unregister_kretprobe[s]_top();
* synchronize_sched();
- * dbi_unregister_kretprobe[s]_bottom();
+ * swap_unregister_kretprobe[s]_bottom();
*
* rp_disarm - indicates the need for restoration of the return address
*/
-void dbi_unregister_kretprobe_top(struct kretprobe *rp, int rp_disarm);
-void dbi_unregister_kretprobes_top(struct kretprobe **rps, size_t size,
+void swap_unregister_kretprobe_top(struct kretprobe *rp, int rp_disarm);
+void swap_unregister_kretprobes_top(struct kretprobe **rps, size_t size,
int rp_disarm);
-void dbi_unregister_kretprobe_bottom(struct kretprobe *rp);
-void dbi_unregister_kretprobes_bottom(struct kretprobe **rps, size_t size);
+void swap_unregister_kretprobe_bottom(struct kretprobe *rp);
+void swap_unregister_kretprobes_bottom(struct kretprobe **rps, size_t size);
-int dbi_disarm_urp_inst_for_task(struct task_struct *parent, struct task_struct *task);
+int swap_disarm_urp_inst_for_task(struct task_struct *parent, struct task_struct *task);
int trampoline_probe_handler (struct kprobe *p, struct pt_regs *regs);
@@ -279,5 +279,5 @@ struct kprobe_ctlblk *get_kprobe_ctlblk (void);
void prepare_singlestep(struct kprobe *p, struct pt_regs *regs);
-#endif /* _DBI_KPROBES_H */
+#endif /* _SWAP_KPROBES_H */
diff --git a/kprobe/dbi_kprobes_deps.c b/kprobe/swap_kprobes_deps.c
index 4c7fd365..008910c2 100644
--- a/kprobe/dbi_kprobes_deps.c
+++ b/kprobe/swap_kprobes_deps.c
@@ -1,6 +1,6 @@
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/dbi_kprobes_deps.h
+ * modules/kprobe/swap_kprobes_deps.h
*
* 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
@@ -29,8 +29,8 @@
#include <asm/pgtable.h>
-#include "dbi_kprobes_deps.h"
-#include "dbi_kdebug.h"
+#include "swap_kprobes_deps.h"
+#include "swap_kdebug.h"
#include <linux/slab.h>
@@ -51,21 +51,21 @@ static unsigned long swap_zero_pfn = 0;
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)) */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
-static inline void *dbi_kmap_atomic(struct page *page)
+static inline void *swap_kmap_atomic(struct page *page)
{
return kmap_atomic(page);
}
-static inline void dbi_kunmap_atomic(void *kvaddr)
+static inline void swap_kunmap_atomic(void *kvaddr)
{
kunmap_atomic(kvaddr);
}
#else /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36) */
-static inline void *dbi_kmap_atomic(struct page *page)
+static inline void *swap_kmap_atomic(struct page *page)
{
return kmap_atomic(page, KM_USER0);
}
-static inline void dbi_kunmap_atomic(void *kvaddr)
+static inline void swap_kunmap_atomic(void *kvaddr)
{
kunmap_atomic(kvaddr, KM_USER0);
}
@@ -227,7 +227,7 @@ DECLARE_MOD_DEP_WRAPPER(swap_follow_hugetlb_page,
#define swap_follow_hugetlb_page follow_hugetlb_page
#endif /* CONFIG_HUGETLB_PAGE */
-static inline int dbi_in_gate_area(struct task_struct *task, unsigned long addr)
+static inline int swap_in_gate_area(struct task_struct *task, unsigned long addr)
{
#ifdef __HAVE_ARCH_GATE_AREA
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
@@ -250,7 +250,7 @@ DECLARE_MOD_DEP_WRAPPER(swap_in_gate_area_no_task, int, unsigned long addr)
IMP_MOD_DEP_WRAPPER(in_gate_area_no_task, addr)
#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) */
-static inline int dbi_in_gate_area_no_xxx(unsigned long addr)
+static inline int swap_in_gate_area_no_xxx(unsigned long addr)
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
return swap_in_gate_area_no_mm(addr);
@@ -454,7 +454,7 @@ long __get_user_pages_uprobe(struct task_struct *tsk, struct mm_struct *mm,
struct vm_area_struct *vma;
vma = swap_find_extend_vma(mm, start);
- if (!vma && dbi_in_gate_area(tsk, start)) {
+ if (!vma && swap_in_gate_area(tsk, start)) {
unsigned long pg = start & PAGE_MASK;
pgd_t *pgd;
pud_t *pud;
@@ -649,7 +649,7 @@ static int __get_user_pages_uprobe(struct task_struct *tsk, struct mm_struct *mm
struct vm_area_struct *vma;
vma = swap_find_extend_vma(mm, start);
- if (!vma && dbi_in_gate_area_no_xxx(start)) {
+ if (!vma && swap_in_gate_area_no_xxx(start)) {
unsigned long pg = start & PAGE_MASK;
pgd_t *pgd;
pud_t *pud;
@@ -845,7 +845,7 @@ static int __get_user_pages_uprobe(struct task_struct *tsk, struct mm_struct *mm
unsigned int foll_flags;
vma = find_vma(mm, start);
- if (!vma && dbi_in_gate_area(tsk, start)) {
+ if (!vma && swap_in_gate_area(tsk, start)) {
unsigned long pg = start & PAGE_MASK;
struct vm_area_struct *gate_vma = swap_get_gate_vma(tsk);
pgd_t *pgd;
@@ -1152,7 +1152,7 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr, void *
if (bytes > PAGE_SIZE-offset)
bytes = PAGE_SIZE-offset;
- maddr = atomic ? dbi_kmap_atomic(page) : kmap(page);
+ maddr = atomic ? swap_kmap_atomic(page) : kmap(page);
if (write) {
swap_copy_to_user_page(vma, page, addr,
@@ -1163,7 +1163,7 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr, void *
buf, maddr + offset, bytes);
}
- atomic ? dbi_kunmap_atomic(maddr) : kunmap(page);
+ atomic ? swap_kunmap_atomic(maddr) : kunmap(page);
page_cache_release(page);
}
len -= bytes;
diff --git a/kprobe/dbi_kprobes_deps.h b/kprobe/swap_kprobes_deps.h
index f5057568..da580740 100644
--- a/kprobe/dbi_kprobes_deps.h
+++ b/kprobe/swap_kprobes_deps.h
@@ -1,9 +1,9 @@
-#ifndef _DBI_KPROBES_DEPS_H
-#define _DBI_KPROBES_DEPS_H
+#ifndef _SWAP_KPROBES_DEPS_H
+#define _SWAP_KPROBES_DEPS_H
/*
* Dynamic Binary Instrumentation Module based on KProbes
- * modules/kprobe/dbi_kprobes_deps.h
+ * modules/kprobe/swap_kprobes_deps.h
*
* 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
@@ -97,4 +97,4 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr, void *
int page_present (struct mm_struct *mm, unsigned long addr);
-#endif /* _DBI_KPROBES_DEPS_H */
+#endif /* _SWAP_KPROBES_DEPS_H */
diff --git a/kprobe/swap_slots.c b/kprobe/swap_slots.c
index e1d7e4a0..a54ec5d6 100644
--- a/kprobe/swap_slots.c
+++ b/kprobe/swap_slots.c
@@ -52,7 +52,7 @@
#include <linux/spinlock.h>
#include "swap_slots.h"
-#include "dbi_kprobes_deps.h"
+#include "swap_kprobes_deps.h"
struct chunk {
diff --git a/ks_features/ks_features.c b/ks_features/ks_features.c
index de4f05e9..05fd8f51 100644
--- a/ks_features/ks_features.c
+++ b/ks_features/ks_features.c
@@ -28,7 +28,7 @@
#include <asm/errno.h>
#include <ksyms/ksyms.h>
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
#include <writer/swap_writer_module.h>
#include "ks_features.h"
#include "syscall_list.h"
@@ -167,7 +167,7 @@ int init_switch_context(void)
void exit_switch_context(void)
{
if (sc_enable)
- dbi_unregister_kretprobe(&switch_rp);
+ swap_unregister_kretprobe(&switch_rp);
}
static int register_switch_context(void)
@@ -180,7 +180,7 @@ static int register_switch_context(void)
goto unlock;
}
- ret = dbi_register_kretprobe(&switch_rp);
+ ret = swap_register_kretprobe(&switch_rp);
if (ret == 0)
sc_enable = 1;
@@ -201,7 +201,7 @@ static int unregister_switch_context(void)
goto unlock;
}
- dbi_unregister_kretprobe(&switch_rp);
+ swap_unregister_kretprobe(&switch_rp);
sc_enable = 0;
unlock:
@@ -226,7 +226,7 @@ static int register_syscall(size_t id)
ksp[id].rp.entry_handler = entry_handler;
ksp[id].rp.handler = ret_handler;
- ret = dbi_register_kretprobe(&ksp[id].rp);
+ ret = swap_register_kretprobe(&ksp[id].rp);
return ret;
}
@@ -239,7 +239,7 @@ static int unregister_syscall(size_t id)
if (ksp[id].rp.kp.addr == NULL)
return 0;
- dbi_unregister_kretprobe(&ksp[id].rp);
+ swap_unregister_kretprobe(&ksp[id].rp);
return 0;
}
@@ -274,7 +274,7 @@ static int unregister_multiple_syscalls(size_t *id_p, size_t cnt)
}
}
- dbi_unregister_kretprobes(rpp, i);
+ swap_unregister_kretprobes(rpp, i);
kfree(rpp);
return 0;
diff --git a/ks_manager/ks_manager.c b/ks_manager/ks_manager.c
index da12c50e..e183a79f 100644
--- a/ks_manager/ks_manager.c
+++ b/ks_manager/ks_manager.c
@@ -24,8 +24,8 @@
#include <linux/module.h>
#include <linux/slab.h>
-#include <kprobe/dbi_kprobes.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes.h>
+#include <kprobe/swap_kprobes_deps.h>
#include "ks_manager.h"
struct probe {
@@ -87,11 +87,11 @@ int ksm_register_probe(unsigned long addr, void *pre_handler,
if (!p)
return -ENOMEM;
- ret = dbi_register_jprobe(&p->p.jp);
+ ret = swap_register_jprobe(&p->p.jp);
if (ret)
goto free;
- ret = dbi_register_kretprobe(&p->p.rp);
+ ret = swap_register_kretprobe(&p->p.rp);
if (ret)
goto unregister_jprobe;
@@ -99,7 +99,7 @@ int ksm_register_probe(unsigned long addr, void *pre_handler,
return 0;
unregister_jprobe:
- dbi_unregister_jprobe(&p->p.jp);
+ swap_unregister_jprobe(&p->p.jp);
free:
free_probe(p);
return ret;
@@ -109,8 +109,8 @@ EXPORT_SYMBOL_GPL(ksm_register_probe);
static void do_ksm_unregister_probe(struct probe *p)
{
remove_probe_to_list(p);
- dbi_unregister_kretprobe(&p->p.rp);
- dbi_unregister_jprobe(&p->p.jp);
+ swap_unregister_kretprobe(&p->p.rp);
+ swap_unregister_jprobe(&p->p.jp);
free_probe(p);
}
diff --git a/ks_manager/ks_manager.h b/ks_manager/ks_manager.h
index 9b87d8a5..42ca7243 100644
--- a/ks_manager/ks_manager.h
+++ b/ks_manager/ks_manager.h
@@ -25,7 +25,7 @@
*
*/
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
struct kern_probe {
struct jprobe jp;
diff --git a/sampler/sampler_hrtimer.c b/sampler/sampler_hrtimer.c
index 1e3af8ed..31b6987b 100644
--- a/sampler/sampler_hrtimer.c
+++ b/sampler/sampler_hrtimer.c
@@ -29,8 +29,8 @@
static u64 sampler_timer_quantum = 0;
-static DEFINE_PER_CPU(struct hrtimer, dbi_hrtimer);
-static int dbi_hrtimer_running;
+static DEFINE_PER_CPU(struct hrtimer, swap_hrtimer);
+static int swap_hrtimer_running;
restart_ret sampler_timers_restart(swap_timer *timer)
{
@@ -45,21 +45,21 @@ restart_ret sampler_timers_restart(swap_timer *timer)
void sampler_timers_set_run(void)
{
- dbi_hrtimer_running = 1;
+ swap_hrtimer_running = 1;
}
void sampler_timers_set_stop(void)
{
- dbi_hrtimer_running = 0;
+ swap_hrtimer_running = 0;
}
void sampler_timers_start(void *restart_func)
{
- struct hrtimer *hrtimer = &__get_cpu_var(dbi_hrtimer);
+ struct hrtimer *hrtimer = &__get_cpu_var(swap_hrtimer);
- if (!dbi_hrtimer_running)
+ if (!swap_hrtimer_running)
return;
hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -71,9 +71,9 @@ void sampler_timers_start(void *restart_func)
void sampler_timers_stop(int cpu)
{
- struct hrtimer *hrtimer = &per_cpu(dbi_hrtimer, cpu);
+ struct hrtimer *hrtimer = &per_cpu(swap_hrtimer, cpu);
- if (!dbi_hrtimer_running)
+ if (!swap_hrtimer_running)
return;
hrtimer_cancel(hrtimer);
diff --git a/sampler/sampler_timer.c b/sampler/sampler_timer.c
index db704452..025cedbc 100644
--- a/sampler/sampler_timer.c
+++ b/sampler/sampler_timer.c
@@ -29,8 +29,8 @@
static unsigned long sampler_timer_quantum = 0;
-static DEFINE_PER_CPU(struct timer_list, dbi_timer);
-static int dbi_timer_running;
+static DEFINE_PER_CPU(struct timer_list, swap_timer);
+static int swap_timer_running;
restart_ret sampler_timers_restart(swap_timer *timer)
@@ -47,21 +47,21 @@ restart_ret sampler_timers_restart(swap_timer *timer)
void sampler_timers_set_run(void)
{
- dbi_timer_running = 1;
+ swap_timer_running = 1;
}
void sampler_timers_set_stop(void)
{
- dbi_timer_running = 0;
+ swap_timer_running = 0;
}
void sampler_timers_start(void *restart_func)
{
- struct timer_list *timer = &__get_cpu_var(dbi_timer);
+ struct timer_list *timer = &__get_cpu_var(swap_timer);
- if (!dbi_timer_running)
+ if (!swap_timer_running)
return;
init_timer(timer);
@@ -74,9 +74,9 @@ void sampler_timers_start(void *restart_func)
void sampler_timers_stop(int cpu)
{
- struct timer_list *timer = &per_cpu(dbi_timer, cpu);
+ struct timer_list *timer = &per_cpu(swap_timer, cpu);
- if (!dbi_timer_running)
+ if (!swap_timer_running)
return;
del_timer_sync(timer);
}
diff --git a/sampler/swap_sampler_module.c b/sampler/swap_sampler_module.c
index fd54e616..1407f287 100644
--- a/sampler/swap_sampler_module.c
+++ b/sampler/swap_sampler_module.c
@@ -40,7 +40,7 @@
static BLOCKING_NOTIFIER_HEAD(swap_sampler_notifier_list);
-static restart_ret dbi_timer_restart(swap_timer *timer)
+static restart_ret swap_timer_restart(swap_timer *timer)
{
if (current)
sample_msg(task_pt_regs(current));
@@ -48,18 +48,18 @@ static restart_ret dbi_timer_restart(swap_timer *timer)
return sampler_timers_restart(timer);
}
-static int dbi_timer_start(void)
+static int swap_timer_start(void)
{
get_online_cpus();
sampler_timers_set_run();
- on_each_cpu(sampler_timers_start, dbi_timer_restart, 1);
+ on_each_cpu(sampler_timers_start, swap_timer_restart, 1);
put_online_cpus();
return E_SS_SUCCESS;
}
-static void dbi_timer_stop(void)
+static void swap_timer_stop(void)
{
int cpu;
@@ -71,7 +71,7 @@ static void dbi_timer_stop(void)
put_online_cpus();
}
-static int __cpuinit dbi_cpu_notify(struct notifier_block *self,
+static int __cpuinit swap_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
long cpu = (long) hcpu;
@@ -80,7 +80,7 @@ static int __cpuinit dbi_cpu_notify(struct notifier_block *self,
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
smp_call_function_single(cpu, sampler_timers_start,
- dbi_timer_restart, 1);
+ swap_timer_restart, 1);
break;
case CPU_DEAD:
case CPU_DEAD_FROZEN:
@@ -91,8 +91,8 @@ static int __cpuinit dbi_cpu_notify(struct notifier_block *self,
return NOTIFY_OK;
}
-static struct notifier_block __refdata dbi_cpu_notifier = {
- .notifier_call = dbi_cpu_notify,
+static struct notifier_block __refdata swap_cpu_notifier = {
+ .notifier_call = swap_cpu_notify,
};
static int do_swap_sampler_start(unsigned int timer_quantum)
@@ -101,14 +101,14 @@ static int do_swap_sampler_start(unsigned int timer_quantum)
return -EINVAL;
sampler_timers_set_quantum(timer_quantum);
- dbi_timer_start();
+ swap_timer_start();
return 0;
}
static void do_swap_sampler_stop(void)
{
- dbi_timer_stop();
+ swap_timer_stop();
}
static DEFINE_MUTEX(mutex_run);
@@ -160,7 +160,7 @@ static int __init sampler_init(void)
{
int retval;
- retval = register_hotcpu_notifier(&dbi_cpu_notifier);
+ retval = register_hotcpu_notifier(&swap_cpu_notifier);
if (retval) {
print_err("Error of register_hotcpu_notifier()\n");
return retval;
@@ -176,7 +176,7 @@ static void __exit sampler_exit(void)
if (sampler_run)
do_swap_sampler_stop();
- unregister_hotcpu_notifier(&dbi_cpu_notifier);
+ unregister_hotcpu_notifier(&swap_cpu_notifier);
print_msg("Sampler uninitialized\n");
}
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c
index dfb12888..8a39906e 100644
--- a/uprobe/arch/asm-arm/swap_uprobes.c
+++ b/uprobe/arch/asm-arm/swap_uprobes.c
@@ -24,18 +24,18 @@
*
*/
-#include <kprobe/dbi_kprobes.h>
-#include <kprobe/arch/asm/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
+#include <kprobe/arch/asm/swap_kprobes.h>
#include <kprobe/arch/asm/trampoline_arm.h>
#include <asm/traps.h>
#include <uprobe/swap_uprobes.h>
#include <uprobe/arch/asm/swap_uprobes.h>
#include <kprobe/swap_slots.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes_deps.h>
#include "trampoline_thumb.h"
// FIXME:
-#include <kprobe/dbi_kdebug.h>
+#include <kprobe/swap_kdebug.h>
#define flush_insns(addr, size) \
@@ -600,7 +600,7 @@ int arch_disarm_urp_inst(struct uretprobe_instance *ri,
struct task_struct *task)
{
struct pt_regs *uregs = task_pt_regs(ri->task);
- unsigned long ra = dbi_get_ret_addr(uregs);
+ unsigned long ra = swap_get_ret_addr(uregs);
unsigned long *tramp;
unsigned long *sp = (unsigned long *)((long)ri->sp & ~1);
unsigned long *stack = sp - RETPROBE_STACK_DEPTH + 1;
@@ -663,7 +663,7 @@ check_lr: /* check lr anyway */
"lr = %08lx - %p\n",
task->comm, task->tgid, task->pid,
ra, ri->rp->up.kp.addr);
- dbi_set_ret_addr(uregs, (unsigned long)ri->ret_addr);
+ swap_set_ret_addr(uregs, (unsigned long)ri->ret_addr);
retval = 0;
} else if (retval) {
printk("---> %s (%d/%d): trampoline NOT found at "
diff --git a/uprobe/arch/asm-arm/swap_uprobes.h b/uprobe/arch/asm-arm/swap_uprobes.h
index 3ba18690..8efb0e74 100644
--- a/uprobe/arch/asm-arm/swap_uprobes.h
+++ b/uprobe/arch/asm-arm/swap_uprobes.h
@@ -29,9 +29,6 @@
#define _ARM_SWAP_UPROBES_H
-#include <kprobe/arch/asm/dbi_kprobes.h>
-
-
struct kprobe;
struct task_struct;
struct uprobe;
diff --git a/uprobe/arch/asm-x86/swap_uprobes.c b/uprobe/arch/asm-x86/swap_uprobes.c
index b542d9a5..e312431f 100644
--- a/uprobe/arch/asm-x86/swap_uprobes.c
+++ b/uprobe/arch/asm-x86/swap_uprobes.c
@@ -25,7 +25,6 @@
*/
#include <linux/kdebug.h>
-#include <kprobe/arch/asm/dbi_kprobes.h>
#include <uprobe/swap_uprobes.h>
#include <uprobe/arch/asm/swap_uprobes.h>
#include <kprobe/swap_slots.h>
diff --git a/uprobe/arch/asm-x86/swap_uprobes.h b/uprobe/arch/asm-x86/swap_uprobes.h
index f51ab2a7..100f2634 100644
--- a/uprobe/arch/asm-x86/swap_uprobes.h
+++ b/uprobe/arch/asm-x86/swap_uprobes.h
@@ -24,11 +24,8 @@
*
*/
-#ifndef _ARM_SWAP_UPROBES_H
-#define _ARM_SWAP_UPROBES_H
-
-
-#include <kprobe/arch/asm/dbi_kprobes.h>
+#ifndef _X86_SWAP_UPROBES_H
+#define _X86_SWAP_UPROBES_H
struct uprobe;
@@ -96,4 +93,4 @@ static inline unsigned long swap_get_uarg(struct pt_regs *regs, unsigned long n)
int swap_arch_init_uprobes(void);
void swap_arch_exit_uprobes(void);
-#endif /* _ARM_SWAP_UPROBES_H */
+#endif /* _X86_SWAP_UPROBES_H */
diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c
index 21d4a28b..2d22754b 100644
--- a/uprobe/swap_uprobes.c
+++ b/uprobe/swap_uprobes.c
@@ -26,7 +26,7 @@
#include "swap_uprobes.h"
-#include <kprobe/dbi_kdebug.h>
+#include <kprobe/swap_kdebug.h>
#include <uprobe/arch/asm/swap_uprobes.h>
@@ -34,7 +34,7 @@
#include <linux/mempolicy.h>
#include <linux/module.h>
#include <kprobe/swap_slots.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes_deps.h>
enum {
UPROBE_HASH_BITS = 10,
@@ -448,7 +448,7 @@ static struct uretprobe_instance *get_free_urp_inst(struct uretprobe *rp)
}
// ===================================================================
-int dbi_register_uprobe(struct uprobe *up)
+int swap_register_uprobe(struct uprobe *up)
{
int ret = 0;
struct kprobe *p, *old_p;
@@ -508,7 +508,7 @@ out:
return ret;
}
-void __dbi_unregister_uprobe(struct uprobe *up, int disarm)
+void __swap_unregister_uprobe(struct uprobe *up, int disarm)
{
struct kprobe *p, *old_p, *list_p;
int cleanup_p;
@@ -574,14 +574,14 @@ valid_p:
}
}
}
-EXPORT_SYMBOL_GPL(__dbi_unregister_uprobe);
+EXPORT_SYMBOL_GPL(__swap_unregister_uprobe);
-void dbi_unregister_uprobe(struct uprobe *up)
+void swap_unregister_uprobe(struct uprobe *up)
{
- __dbi_unregister_uprobe(up, 1);
+ __swap_unregister_uprobe(up, 1);
}
-int dbi_register_ujprobe(struct ujprobe *jp)
+int swap_register_ujprobe(struct ujprobe *jp)
{
int ret = 0;
@@ -589,14 +589,15 @@ int dbi_register_ujprobe(struct ujprobe *jp)
jp->up.kp.pre_handler = setjmp_upre_handler;
jp->up.kp.break_handler = longjmp_break_uhandler;
- ret = dbi_register_uprobe(&jp->up);
+ ret = swap_register_uprobe(&jp->up);
return ret;
}
+EXPORT_SYMBOL_GPL(swap_register_ujprobe);
-void __dbi_unregister_ujprobe(struct ujprobe *jp, int disarm)
+void __swap_unregister_ujprobe(struct ujprobe *jp, int disarm)
{
- __dbi_unregister_uprobe(&jp->up, disarm);
+ __swap_unregister_uprobe(&jp->up, disarm);
/*
* Here is an attempt to unregister even those probes that have not been
* installed (hence not added to the hlist).
@@ -608,12 +609,13 @@ void __dbi_unregister_ujprobe(struct ujprobe *jp, int disarm)
hlist_del_rcu(&jp->up.kp.is_hlist);
}
}
-EXPORT_SYMBOL_GPL(__dbi_unregister_ujprobe);
+EXPORT_SYMBOL_GPL(__swap_unregister_ujprobe);
-void dbi_unregister_ujprobe(struct ujprobe *jp)
+void swap_unregister_ujprobe(struct ujprobe *jp)
{
- __dbi_unregister_ujprobe(jp, 1);
+ __swap_unregister_ujprobe(jp, 1);
}
+EXPORT_SYMBOL_GPL(swap_unregister_ujprobe);
int trampoline_uprobe_handler(struct kprobe *p, struct pt_regs *regs)
{
@@ -713,7 +715,7 @@ static int pre_handler_uretprobe(struct kprobe *p, struct pt_regs *regs)
return 0;
}
-int dbi_register_uretprobe(struct uretprobe *rp)
+int swap_register_uretprobe(struct uretprobe *rp)
{
int i, ret = 0;
struct uretprobe_instance *inst;
@@ -751,7 +753,7 @@ int dbi_register_uretprobe(struct uretprobe *rp)
rp->nmissed = 0;
/* Establish function entry probe point */
- ret = dbi_register_uprobe(&rp->up);
+ ret = swap_register_uprobe(&rp->up);
if (ret)
return ret;
@@ -759,8 +761,9 @@ int dbi_register_uretprobe(struct uretprobe *rp)
return 0;
}
+EXPORT_SYMBOL_GPL(swap_register_uretprobe);
-int dbi_disarm_urp_inst_for_task(struct task_struct *parent, struct task_struct *task)
+int swap_disarm_urp_inst_for_task(struct task_struct *parent, struct task_struct *task)
{
unsigned long flags;
struct uretprobe_instance *ri;
@@ -781,9 +784,9 @@ int dbi_disarm_urp_inst_for_task(struct task_struct *parent, struct task_struct
return 0;
}
-EXPORT_SYMBOL_GPL(dbi_disarm_urp_inst_for_task);
+EXPORT_SYMBOL_GPL(swap_disarm_urp_inst_for_task);
-void dbi_discard_pending_uretprobes(struct task_struct *task)
+void swap_discard_pending_uretprobes(struct task_struct *task)
{
unsigned long flags;
struct uretprobe_instance *ri;
@@ -806,14 +809,14 @@ void dbi_discard_pending_uretprobes(struct task_struct *task)
spin_unlock_irqrestore(&uretprobe_lock, flags);
}
-EXPORT_SYMBOL_GPL(dbi_discard_pending_uretprobes);
+EXPORT_SYMBOL_GPL(swap_discard_pending_uretprobes);
-void __dbi_unregister_uretprobe(struct uretprobe *rp, int disarm)
+void __swap_unregister_uretprobe(struct uretprobe *rp, int disarm)
{
unsigned long flags;
struct uretprobe_instance *ri;
- __dbi_unregister_uprobe(&rp->up, disarm);
+ __swap_unregister_uprobe(&rp->up, disarm);
spin_lock_irqsave (&uretprobe_lock, flags);
while ((ri = get_used_urp_inst(rp)) != NULL) {
@@ -840,14 +843,15 @@ void __dbi_unregister_uretprobe(struct uretprobe *rp, int disarm)
spin_unlock_irqrestore(&uretprobe_lock, flags);
free_urp_inst(rp);
}
-EXPORT_SYMBOL_GPL(__dbi_unregister_uretprobe);
+EXPORT_SYMBOL_GPL(__swap_unregister_uretprobe);
-void dbi_unregister_uretprobe(struct uretprobe *rp)
+void swap_unregister_uretprobe(struct uretprobe *rp)
{
- __dbi_unregister_uretprobe(rp, 1);
+ __swap_unregister_uretprobe(rp, 1);
}
+EXPORT_SYMBOL_GPL(swap_unregister_uretprobe);
-void dbi_unregister_all_uprobes(struct task_struct *task)
+void swap_unregister_all_uprobes(struct task_struct *task)
{
struct hlist_head *head;
struct kprobe *p;
@@ -860,13 +864,16 @@ void dbi_unregister_all_uprobes(struct task_struct *task)
swap_hlist_for_each_entry_safe(p, node, tnode, head, hlist) {
if (kp2up(p)->task->tgid == task->tgid) {
struct uprobe *up = container_of(p, struct uprobe, kp);
- printk("dbi_unregister_all_uprobes: delete uprobe at %p[%lx] for %s/%d\n",
- p->addr, (unsigned long)p->opcode, task->comm, task->pid);
- dbi_unregister_uprobe(up);
+ printk("%s: delete uprobe at %p[%lx] for "
+ "%s/%d\n", __func__, p->addr,
+ (unsigned long)p->opcode,
+ task->comm, task->pid);
+ swap_unregister_uprobe(up);
}
}
}
}
+EXPORT_SYMBOL_GPL(swap_unregister_all_uprobes);
void swap_ujprobe_return(void)
{
@@ -888,12 +895,6 @@ static void __exit exit_uprobes(void)
swap_arch_exit_uprobes();
}
-EXPORT_SYMBOL_GPL(dbi_register_ujprobe);
-EXPORT_SYMBOL_GPL(dbi_unregister_ujprobe);
-EXPORT_SYMBOL_GPL(dbi_register_uretprobe);
-EXPORT_SYMBOL_GPL(dbi_unregister_uretprobe);
-EXPORT_SYMBOL_GPL(dbi_unregister_all_uprobes);
-
module_init(init_uprobes);
module_exit(exit_uprobes);
diff --git a/uprobe/swap_uprobes.h b/uprobe/swap_uprobes.h
index c5e0e3d4..bd830648 100644
--- a/uprobe/swap_uprobes.h
+++ b/uprobe/swap_uprobes.h
@@ -1,5 +1,5 @@
-#ifndef _DBI_UPROBES_H
-#define _DBI_UPROBES_H
+#ifndef _SWAP_UPROBES_H
+#define _SWAP_UPROBES_H
/*
* Dynamic Binary Instrumentation Module based on KProbes
@@ -27,7 +27,7 @@
*
*/
-#include <kprobe/dbi_kprobes.h>
+#include <kprobe/swap_kprobes.h>
#include <uprobe/arch/asm/swap_uprobes.h>
@@ -90,20 +90,20 @@ struct uretprobe_instance {
struct task_struct *task;
};
-int dbi_register_uprobe(struct uprobe *p);
-void dbi_unregister_uprobe(struct uprobe *p);
-void __dbi_unregister_uprobe(struct uprobe *up, int disarm);
+int swap_register_uprobe(struct uprobe *p);
+void swap_unregister_uprobe(struct uprobe *p);
+void __swap_unregister_uprobe(struct uprobe *up, int disarm);
-int dbi_register_ujprobe(struct ujprobe *jp);
-void dbi_unregister_ujprobe(struct ujprobe *jp);
-void __dbi_unregister_ujprobe(struct ujprobe *jp, int disarm);
+int swap_register_ujprobe(struct ujprobe *jp);
+void swap_unregister_ujprobe(struct ujprobe *jp);
+void __swap_unregister_ujprobe(struct ujprobe *jp, int disarm);
-int dbi_register_uretprobe(struct uretprobe *rp);
-void dbi_unregister_uretprobe(struct uretprobe *rp);
-void __dbi_unregister_uretprobe(struct uretprobe *rp, int disarm);
+int swap_register_uretprobe(struct uretprobe *rp);
+void swap_unregister_uretprobe(struct uretprobe *rp);
+void __swap_unregister_uretprobe(struct uretprobe *rp, int disarm);
-void dbi_unregister_all_uprobes(struct task_struct *task);
-void dbi_discard_pending_uretprobes(struct task_struct *task);
+void swap_unregister_all_uprobes(struct task_struct *task);
+void swap_discard_pending_uretprobes(struct task_struct *task);
void swap_ujprobe_return(void);
struct kprobe *get_ukprobe(void *addr, pid_t tgid);
@@ -125,4 +125,4 @@ int trampoline_uprobe_handler(struct kprobe *p, struct pt_regs *regs);
void add_uprobe_table(struct kprobe *p);
-#endif /* _DBI_UPROBES_H */
+#endif /* _SWAP_UPROBES_H */
diff --git a/us_manager/helper.c b/us_manager/helper.c
index 64246da9..eae924c9 100644
--- a/us_manager/helper.c
+++ b/us_manager/helper.c
@@ -23,8 +23,8 @@
*/
-#include <kprobe/dbi_kprobes.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes.h>
+#include <kprobe/swap_kprobes_deps.h>
#include <ksyms/ksyms.h>
#include <writer/kernel_operations.h>
#include <writer/swap_writer_module.h>
@@ -106,9 +106,9 @@ static int register_mf(void)
{
int ret;
- ret = dbi_register_kretprobe(&mf_kretprobe);
+ ret = swap_register_kretprobe(&mf_kretprobe);
if (ret)
- printk("dbi_register_kretprobe(handle_mm_fault) ret=%d!\n",
+ printk("swap_register_kretprobe(handle_mm_fault) ret=%d!\n",
ret);
return ret;
@@ -116,7 +116,7 @@ static int register_mf(void)
static void unregister_mf(void)
{
- dbi_unregister_kretprobe(&mf_kretprobe);
+ swap_unregister_kretprobe(&mf_kretprobe);
}
@@ -160,16 +160,16 @@ static int register_ctx_task(void)
{
int ret = 0;
- ret = dbi_register_kprobe(&ctx_task_kprobe);
+ ret = swap_register_kprobe(&ctx_task_kprobe);
if (ret)
- printk("dbi_register_kprobe(workaround) ret=%d!\n", ret);
+ printk("swap_register_kprobe(workaround) ret=%d!\n", ret);
return ret;
}
static void unregister_ctx_task(void)
{
- dbi_unregister_kprobe(&ctx_task_kprobe);
+ swap_unregister_kprobe(&ctx_task_kprobe);
}
#endif /* CONFIG_ARM */
@@ -187,7 +187,7 @@ static atomic_t copy_process_cnt = ATOMIC_INIT(0);
static void recover_child(struct task_struct *child_task, struct sspt_proc *proc)
{
sspt_proc_uninstall(proc, child_task, US_DISARM);
- dbi_disarm_urp_inst_for_task(current, child_task);
+ swap_disarm_urp_inst_for_task(current, child_task);
}
static void rm_uprobes_child(struct task_struct *task)
@@ -239,20 +239,20 @@ static int register_cp(void)
{
int ret;
- ret = dbi_register_kretprobe(&cp_kretprobe);
+ ret = swap_register_kretprobe(&cp_kretprobe);
if (ret)
- printk("dbi_register_kretprobe(copy_process) ret=%d!\n", ret);
+ printk("swap_register_kretprobe(copy_process) ret=%d!\n", ret);
return ret;
}
static void unregister_cp(void)
{
- dbi_unregister_kretprobe_top(&cp_kretprobe, 0);
+ swap_unregister_kretprobe_top(&cp_kretprobe, 0);
do {
synchronize_sched();
} while (atomic_read(&copy_process_cnt));
- dbi_unregister_kretprobe_bottom(&cp_kretprobe);
+ swap_unregister_kretprobe_bottom(&cp_kretprobe);
}
@@ -276,7 +276,7 @@ static int mr_pre_handler(struct kprobe *p, struct pt_regs *regs)
if (task->tgid != task->pid) {
/* if the thread is killed we need to discard pending
* uretprobe instances which have not triggered yet */
- dbi_discard_pending_uretprobes(task);
+ swap_discard_pending_uretprobes(task);
goto out;
}
@@ -293,16 +293,16 @@ static int register_mr(void)
{
int ret;
- ret = dbi_register_kprobe(&mr_kprobe);
+ ret = swap_register_kprobe(&mr_kprobe);
if (ret)
- printk("dbi_register_kprobe(mm_release) ret=%d!\n", ret);
+ printk("swap_register_kprobe(mm_release) ret=%d!\n", ret);
return ret;
}
static void unregister_mr(void)
{
- dbi_unregister_kprobe(&mr_kprobe);
+ swap_unregister_kprobe(&mr_kprobe);
}
@@ -408,20 +408,20 @@ static int register_unmap(void)
{
int ret;
- ret = dbi_register_kretprobe(&unmap_kretprobe);
+ ret = swap_register_kretprobe(&unmap_kretprobe);
if (ret)
- printk("dbi_register_kprobe(do_munmap) ret=%d!\n", ret);
+ printk("swap_register_kprobe(do_munmap) ret=%d!\n", ret);
return ret;
}
static void unregister_unmap(void)
{
- dbi_unregister_kretprobe_top(&unmap_kretprobe, 0);
+ swap_unregister_kretprobe_top(&unmap_kretprobe, 0);
do {
synchronize_sched();
} while (atomic_read(&unmap_cnt));
- dbi_unregister_kretprobe_bottom(&unmap_kretprobe);
+ swap_unregister_kretprobe_bottom(&unmap_kretprobe);
}
@@ -468,16 +468,16 @@ static int register_mmap(void)
{
int ret;
- ret = dbi_register_kretprobe(&mmap_kretprobe);
+ ret = swap_register_kretprobe(&mmap_kretprobe);
if (ret)
- printk("dbi_register_kretprobe(do_mmap_pgoff) ret=%d!\n", ret);
+ printk("swap_register_kretprobe(do_mmap_pgoff) ret=%d!\n", ret);
return ret;
}
static void unregister_mmap(void)
{
- dbi_unregister_kretprobe(&mmap_kretprobe);
+ swap_unregister_kretprobe(&mmap_kretprobe);
}
diff --git a/us_manager/sspt/sspt.h b/us_manager/sspt/sspt.h
index 2a940723..5cff0915 100644
--- a/us_manager/sspt/sspt.h
+++ b/us_manager/sspt/sspt.h
@@ -53,14 +53,14 @@ static inline int sspt_register_usprobe(struct us_ip *ip)
ip->retprobe.up.task = ip->page->file->proc->task;
ip->retprobe.up.sm = ip->page->file->proc->sm;
- ret = dbi_register_uretprobe(&ip->retprobe);
+ ret = swap_register_uretprobe(&ip->retprobe);
if (ret) {
struct sspt_file *file = ip->page->file;
char *name = file->dentry->d_iname;
unsigned long addr = (unsigned long)ip->retprobe.up.kp.addr;
unsigned long offset = addr - file->vm_start;
- printk("dbi_register_uretprobe() failure %d (%s:%lx|%lx)\n",
+ printk("swap_register_uretprobe() failure %d (%s:%lx|%lx)\n",
ret, name, offset, (unsigned long)ip->retprobe.up.kp.opcode);
}
@@ -69,7 +69,7 @@ static inline int sspt_register_usprobe(struct us_ip *ip)
static inline int do_unregister_usprobe(struct us_ip *ip, int disarm)
{
- __dbi_unregister_uretprobe(&ip->retprobe, disarm);
+ __swap_unregister_uretprobe(&ip->retprobe, disarm);
return 0;
}
diff --git a/us_manager/sspt/sspt_debug.h b/us_manager/sspt/sspt_debug.h
index d51581fc..26f69cef 100644
--- a/us_manager/sspt/sspt_debug.h
+++ b/us_manager/sspt/sspt_debug.h
@@ -25,7 +25,7 @@
*
*/
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes_deps.h>
static inline void print_jprobe(struct jprobe *jp)
{
diff --git a/us_manager/sspt/sspt_file.c b/us_manager/sspt/sspt_file.c
index 72f3af82..95398449 100644
--- a/us_manager/sspt/sspt_file.c
+++ b/us_manager/sspt/sspt_file.c
@@ -30,7 +30,7 @@
#include <linux/list.h>
#include <linux/hash.h>
#include <linux/sched.h>
-#include <kprobe/dbi_kprobes_deps.h>
+#include <kprobe/swap_kprobes_deps.h>
static int calculation_hash_bits(int cnt)
{
diff --git a/us_manager/us_slot_manager.c b/us_manager/us_slot_manager.c
index 0b2e2b76..002a052c 100644
--- a/us_manager/us_slot_manager.c
+++ b/us_manager/us_slot_manager.c
@@ -30,7 +30,7 @@
#include <linux/mman.h>
#include <linux/list.h>
#include <kprobe/swap_slots.h>
-#include <kprobe/arch/asm/dbi_kprobes.h>
+#include <kprobe/arch/asm/swap_kprobes.h>
#include "us_manager_common.h"
diff --git a/writer/swap_writer_module.c b/writer/swap_writer_module.c
index 7bd1c0b1..c4e864e1 100644
--- a/writer/swap_writer_module.c
+++ b/writer/swap_writer_module.c
@@ -34,7 +34,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
-#include <kprobe/arch/asm/dbi_kprobes.h>
+#include <kprobe/arch/asm/swap_kprobes.h>
#include <uprobe/arch/asm/swap_uprobes.h>
#include <buffer/swap_buffer_module.h>