[REFACTOR] create field 'task' in 'srtuct sspt_procs'
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 7 May 2013 08:43:18 +0000 (12:43 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 7 May 2013 08:43:18 +0000 (12:43 +0400)
driver/sspt/sspt_procs.c
driver/sspt/sspt_procs.h
driver/us_proc_inst.c

index bae8d68..46ca2c2 100644 (file)
 
 static LIST_HEAD(proc_probes_list);
 
-struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid)
+struct sspt_procs *sspt_procs_create(struct dentry* dentry, struct task_struct *task)
 {
        struct sspt_procs *procs = kmalloc(sizeof(*procs), GFP_ATOMIC);
 
        if (procs) {
                INIT_LIST_HEAD(&procs->list);
-               procs->tgid = tgid;
+               procs->tgid = task ? task->tgid : 0;
+               procs->task = task;
                procs->dentry = dentry;
                procs->sm = NULL;
                INIT_LIST_HEAD(&procs->file_list);
@@ -136,7 +137,7 @@ void sspt_procs_add_ip_data(struct sspt_procs *procs, struct dentry* dentry,
 struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task)
 {
        struct sspt_file *file;
-       struct sspt_procs *procs_out = sspt_procs_create(procs->dentry, task->tgid);
+       struct sspt_procs *procs_out = sspt_procs_create(procs->dentry, task);
 
        list_for_each_entry(file, &procs->file_list, list) {
                sspt_procs_add_file(procs_out, sspt_file_copy(file));
index 7a5855c..1099107 100644 (file)
 #include "sspt_file.h"
 
 struct slot_manager;
+struct task_struct;
 
 struct sspt_procs {
        struct list_head list;
        pid_t tgid;
+       struct task_struct *task;
        struct dentry *dentry;
        struct slot_manager *sm;
        struct list_head file_list;
 };
 
 
-struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid);
+struct sspt_procs *sspt_procs_create(struct dentry* dentry, struct task_struct *task);
 struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task);
 void sspt_procs_free(struct sspt_procs *procs);
 
index 1ba4756..4a0a360 100644 (file)
@@ -615,7 +615,7 @@ int register_usprobe(struct task_struct *task, struct us_ip *ip)
        }
 
        ip->jprobe.priv_arg = ip;
-       ip->jprobe.up.task = task;
+       ip->jprobe.up.task = ip->page->file->procs->task;
        ip->jprobe.up.sm = ip->page->file->procs->sm;
        ret = dbi_register_ujprobe(&ip->jprobe);
        if (ret) {
@@ -636,7 +636,7 @@ int register_usprobe(struct task_struct *task, struct us_ip *ip)
                }
 
                ip->retprobe.priv_arg = ip;
-               ip->retprobe.up.task = task;
+               ip->retprobe.up.task = ip->page->file->procs->task;
                ip->retprobe.up.sm = ip->page->file->procs->sm;
                ret = dbi_register_uretprobe(&ip->retprobe);
                if (ret) {