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);
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));
#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);
}
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) {
}
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) {