diff options
author | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-04-01 12:24:38 +0400 |
---|---|---|
committer | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-04-01 12:28:32 +0400 |
commit | ec905d585bdb62e8052b638b03797bde7bfd5685 (patch) | |
tree | 3b4a96c75c78f5290344a873411f4c897895691e /uprobe | |
parent | b699ee1452e3a4b722ec7e72898bc87097ead234 (diff) | |
download | swap-modules-ec905d585bdb62e8052b638b03797bde7bfd5685.tar.gz swap-modules-ec905d585bdb62e8052b638b03797bde7bfd5685.tar.bz2 swap-modules-ec905d585bdb62e8052b638b03797bde7bfd5685.zip |
[REFACTOR] new interface arm_uprobe()
-static void arm_uprobe(struct kprobe *p, struct task_struct *task)
+static void arm_uprobe(struct uprobe *p)
Diffstat (limited to 'uprobe')
-rw-r--r-- | uprobe/swap_uprobes.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c index f1fd2017..ce7e00f0 100644 --- a/uprobe/swap_uprobes.c +++ b/uprobe/swap_uprobes.c @@ -235,12 +235,14 @@ static int register_aggr_uprobe(struct kprobe *old_p, struct kprobe *p) return ret; } -static void arm_uprobe(struct kprobe *p, struct task_struct *task) +static void arm_uprobe(struct uprobe *p) { kprobe_opcode_t insn = BREAKPOINT_INSTRUCTION; - - if (!write_proc_vm_atomic(task, (unsigned long)p->addr, &insn, sizeof(insn))) { - panic("arm_uprobe: failed to write memory %p!\n", p->addr); + int ret = write_proc_vm_atomic(p->task, (unsigned long)p->kp.addr, + &insn, sizeof(insn)); + if (!ret) { + panic("arm_uprobe: failed to write memory " + "tgid=%u addr=%p!\n", p->task->tgid, p->kp.addr); } } @@ -566,7 +568,7 @@ int dbi_register_uprobe(struct uprobe *up, int atomic) INIT_HLIST_NODE(&p->hlist); hlist_add_head_rcu(&p->hlist, &uprobe_table[hash_ptr(p->addr, UPROBE_HASH_BITS)]); add_uprobe_table(p); - arm_uprobe(p, up->task); + arm_uprobe(up); out: DBPRINTF("out ret = 0x%x\n", ret); |