summaryrefslogtreecommitdiff
path: root/us_manager/helper.c
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2013-06-14 13:48:53 +0400
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>2013-06-14 13:48:53 +0400
commit8cb77c42fba70f8de76b9fe6d24367fb3d88fd57 (patch)
treee1cf913d3a70e20a887ca57b77249e5f7f71f224 /us_manager/helper.c
parent663746d114b33f21aff9bf6c950f373aa984827a (diff)
downloadswap-modules-8cb77c42fba70f8de76b9fe6d24367fb3d88fd57.tar.gz
swap-modules-8cb77c42fba70f8de76b9fe6d24367fb3d88fd57.tar.bz2
swap-modules-8cb77c42fba70f8de76b9fe6d24367fb3d88fd57.zip
[REFACTOR] redesign call_page_fault()
Diffstat (limited to 'us_manager/helper.c')
-rw-r--r--us_manager/helper.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/us_manager/helper.c b/us_manager/helper.c
index 4f9a1fd6..d2b8590b 100644
--- a/us_manager/helper.c
+++ b/us_manager/helper.c
@@ -40,11 +40,19 @@ static int entry_handler_pf(struct kretprobe_instance *ri, struct pt_regs *regs)
static int ret_handler_pf(struct kretprobe_instance *ri, struct pt_regs *regs)
{
struct task_struct *task;
- struct sspt_proc *proc;
+ unsigned long page_addr;
+
+ task = current->group_leader;
+ if (is_kthread(task))
+ return 0;
- call_page_fault(((struct pf_data *)ri->data)->addr);
+ page_addr = ((struct pf_data *)ri->data)->addr & PAGE_MASK;
+ call_page_fault(task, page_addr);
return 0;
+
+ struct sspt_proc *proc;
+
/*
* Because process threads have same address space
* we instrument only group_leader of all this threads