diff options
author | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-04-01 12:08:32 +0400 |
---|---|---|
committer | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-04-01 12:08:32 +0400 |
commit | b699ee1452e3a4b722ec7e72898bc87097ead234 (patch) | |
tree | d2c7c174d062197a270d08cf0cb3acbb237b4afd /uprobe | |
parent | e6f76a5de78b2a10043ed3d64387e276a1aa9a76 (diff) | |
download | swap-modules-b699ee1452e3a4b722ec7e72898bc87097ead234.tar.gz swap-modules-b699ee1452e3a4b722ec7e72898bc87097ead234.tar.bz2 swap-modules-b699ee1452e3a4b722ec7e72898bc87097ead234.zip |
[REFACTOR] new interface get_uprobe()
-struct kprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid)
+struct uprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid)
Diffstat (limited to 'uprobe')
-rw-r--r-- | uprobe/arch/asm-arm/swap_uprobes.c | 2 | ||||
-rw-r--r-- | uprobe/swap_uprobes.c | 8 | ||||
-rw-r--r-- | uprobe/swap_uprobes.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c index 2e689367..eefe8331 100644 --- a/uprobe/arch/asm-arm/swap_uprobes.c +++ b/uprobe/arch/asm-arm/swap_uprobes.c @@ -687,7 +687,7 @@ static int uprobe_handler(struct pt_regs *regs) pid_t tgid = task->tgid; struct kprobe *p; - p = get_uprobe(addr, tgid); + p = &get_uprobe(addr, tgid)->kp; if (p && (check_validity_insn(p, regs, task) != 0)) { printk("no_uprobe live\n"); diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c index 99cfbba2..f1fd2017 100644 --- a/uprobe/swap_uprobes.c +++ b/uprobe/swap_uprobes.c @@ -276,7 +276,7 @@ static void init_uretprobe_inst_table(void) } } -struct kprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid) +struct uprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid) { struct hlist_head *head; struct hlist_node *node; @@ -285,7 +285,7 @@ struct kprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid) head = &uprobe_table[hash_ptr(addr, UPROBE_HASH_BITS)]; hlist_for_each_entry_rcu(p, node, head, hlist) { if (p->addr == addr && p->tgid == tgid) { - return p; + return container_of(p, struct uprobe, kp); } } @@ -539,7 +539,7 @@ int dbi_register_uprobe(struct uprobe *up, int atomic) #endif // get the first item - old_p = get_uprobe(p->addr, p->tgid); + old_p = &get_uprobe(p->addr, p->tgid)->kp; if (old_p) { #ifdef CONFIG_ARM p->safe_arm = old_p->safe_arm; @@ -579,7 +579,7 @@ void dbi_unregister_uprobe(struct uprobe *up, int atomic) int cleanup_p; p = &up->kp; - old_p = get_uprobe(p->addr, p->tgid); + old_p = &get_uprobe(p->addr, p->tgid)->kp; if (unlikely(!old_p)) { return; } diff --git a/uprobe/swap_uprobes.h b/uprobe/swap_uprobes.h index 1d96dccc..cafc9e16 100644 --- a/uprobe/swap_uprobes.h +++ b/uprobe/swap_uprobes.h @@ -92,7 +92,7 @@ void dbi_unregister_uretprobe(struct uretprobe *rp, int atomic); void dbi_unregister_all_uprobes(struct task_struct *task, int atomic); void dbi_uprobe_return(void); -struct kprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid); +struct uprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid); void disarm_uprobe(struct kprobe *p, struct task_struct *task); |