From 576d63a0f724a26eb85d7cff9256a8726181869b Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Wed, 15 May 2013 17:52:05 +0400 Subject: [PATCH] [REFACTOR] rename sspt_procs* --> sspt_proc* --- driver/Kbuild | 2 +- driver/device_driver.c | 4 +- driver/java_inst.c | 8 +- driver/java_inst.h | 6 +- driver/sspt/sspt.h | 20 ++--- driver/sspt/sspt_debug.h | 4 +- driver/sspt/{sspt_procs.c => sspt_proc.c} | 66 ++++++++-------- driver/sspt/{sspt_procs.h => sspt_proc.h} | 18 ++--- driver/storage.h | 2 +- driver/us_proc_inst.c | 120 +++++++++++++++--------------- 10 files changed, 125 insertions(+), 125 deletions(-) rename driver/sspt/{sspt_procs.c => sspt_proc.c} (53%) rename driver/sspt/{sspt_procs.h => sspt_proc.h} (69%) diff --git a/driver/Kbuild b/driver/Kbuild index b50621d..7106512 100644 --- a/driver/Kbuild +++ b/driver/Kbuild @@ -3,4 +3,4 @@ EXTRA_CFLAGS := $(extra_cflags) obj-m := swap_driver.o swap_driver-y := error_storage.o device_driver.o ec.o legacy.o module.o probes.o \ probes_manager.o storage.o us_proc_inst.o java_inst.o \ - sspt/ip.o sspt/sspt_page.o sspt/sspt_file.o sspt/sspt_procs.o + sspt/ip.o sspt/sspt_page.o sspt/sspt_file.o sspt/sspt_proc.o diff --git a/driver/device_driver.c b/driver/device_driver.c index c7d04b1..993a807 100644 --- a/driver/device_driver.c +++ b/driver/device_driver.c @@ -19,7 +19,7 @@ #include "device_driver.h" // device driver #include "handlers_core.h" #include -#include "sspt/sspt_procs.h" +#include "sspt/sspt_proc.h" #ifdef OVERHEAD_DEBUG extern unsigned long swap_sum_time; @@ -537,7 +537,7 @@ static long device_ioctl (struct file *file UNUSED, unsigned int cmd, unsigned l goto sad_cleanup; } - sspt_procs_free_all(); + sspt_proc_free_all(); vfree(bundle); result = 0; diff --git a/driver/java_inst.c b/driver/java_inst.c index f5cd98d..84b61c9 100644 --- a/driver/java_inst.c +++ b/driver/java_inst.c @@ -35,7 +35,7 @@ #include "storage.h" #include "debug.h" #include "sspt/ip.h" -#include "sspt/sspt_procs.h" +#include "sspt/sspt_proc.h" /* Defines below are for libdvm.so with md5sum: @@ -52,7 +52,7 @@ struct dentry *dentry_by_path(const char *path); unsigned long ujprobe_event_pre_handler(struct us_ip *ip, struct pt_regs *regs); void ujprobe_event_handler (unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, unsigned long arg6); -void add_java_inst(struct sspt_procs *procs) +void add_java_inst(struct sspt_proc *proc) { struct dentry *dentry = dentry_by_path("/system/lib/libdvm.so"); libdvm_dentry = dentry; @@ -67,7 +67,7 @@ void add_java_inst(struct sspt_procs *procs) .flag_retprobe = 0 }; - sspt_procs_add_ip_data(procs, dentry, name, &ipd_entry); + sspt_proc_add_ip_data(proc, dentry, name, &ipd_entry); struct ip_data ipd_return = { @@ -79,7 +79,7 @@ void add_java_inst(struct sspt_procs *procs) .flag_retprobe = 0 }; - sspt_procs_add_ip_data(procs, dentry, name, &ipd_return); + sspt_proc_add_ip_data(proc, dentry, name, &ipd_return); } extern void dbi_uprobe_return(void); diff --git a/driver/java_inst.h b/driver/java_inst.h index 5eec385..2718bc8 100644 --- a/driver/java_inst.h +++ b/driver/java_inst.h @@ -26,13 +26,13 @@ */ struct pt_regs; -struct sspt_procs; +struct sspt_proc; #ifdef __ANDROID -void add_java_inst(struct sspt_procs *procs); +void add_java_inst(struct sspt_proc *proc); int handle_java_event(struct pt_regs *regs); #else /* __ANDROID */ -static inline void add_java_inst(struct sspt_procs *procs) +static inline void add_java_inst(struct sspt_proc *proc) { } diff --git a/driver/sspt/sspt.h b/driver/sspt/sspt.h index cdf0eaa..8878cc2 100644 --- a/driver/sspt/sspt.h +++ b/driver/sspt/sspt.h @@ -28,7 +28,7 @@ #include "ip.h" #include "sspt_page.h" #include "sspt_file.h" -#include "sspt_procs.h" +#include "sspt_proc.h" #include "sspt_debug.h" #include "../us_proc_inst.h" @@ -36,18 +36,18 @@ #include "../storage.h" #include "../java_inst.h" -static void print_proc_probes(const struct sspt_procs *procs); +static void print_proc_probes(const struct sspt_proc *proc); -static inline struct sspt_procs *get_file_probes(const inst_us_proc_t *task_inst_info) +static inline struct sspt_proc *get_file_probes(const inst_us_proc_t *task_inst_info) { - struct sspt_procs *procs = sspt_procs_create(task_inst_info->m_f_dentry, 0); + struct sspt_proc *proc = sspt_proc_create(task_inst_info->m_f_dentry, 0); printk("####### get START #######\n"); - if (procs) { + if (proc) { int i; - printk("#2# get_file_probes: proc_p[dentry=%p]\n", procs->dentry); + printk("#2# get_file_probes: proc_p[dentry=%p]\n", proc->dentry); for (i = 0; i < task_inst_info->libs_count; ++i) { int k, j; @@ -76,18 +76,18 @@ static inline struct sspt_procs *get_file_probes(const inst_us_proc_t *task_inst pd.jp_handler = (unsigned long) ip->jprobe.entry; pd.rp_handler = ip->retprobe.handler; - sspt_procs_add_ip_data(procs, dentry, name, &pd); + sspt_proc_add_ip_data(proc, dentry, name, &pd); } } } - add_java_inst(procs); + add_java_inst(proc); -// print_proc_probes(procs); +// print_proc_probes(proc); printk("####### get END #######\n"); - return procs; + return proc; } diff --git a/driver/sspt/sspt_debug.h b/driver/sspt/sspt_debug.h index 68e4cde..663e094 100644 --- a/driver/sspt/sspt_debug.h +++ b/driver/sspt/sspt_debug.h @@ -83,12 +83,12 @@ static inline void print_file_probes(const struct sspt_file *file) } } -static inline void print_proc_probes(const struct sspt_procs *procs) +static inline void print_proc_probes(const struct sspt_proc *proc) { struct sspt_file *file; printk("### print_proc_probes\n"); - list_for_each_entry(file, &procs->file_list, list) { + list_for_each_entry(file, &proc->file_list, list) { print_file_probes(file); } printk("### print_proc_probes\n"); diff --git a/driver/sspt/sspt_procs.c b/driver/sspt/sspt_proc.c similarity index 53% rename from driver/sspt/sspt_procs.c rename to driver/sspt/sspt_proc.c index ca5bb27..d10548b 100644 --- a/driver/sspt/sspt_procs.c +++ b/driver/sspt/sspt_proc.c @@ -1,6 +1,6 @@ /* * Dynamic Binary Instrumentation Module based on KProbes - * modules/driver/sspt/sspt_procs.c + * modules/driver/sspt/sspt_proc.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,42 +22,42 @@ * */ -#include "sspt_procs.h" +#include "sspt_proc.h" #include #include extern struct list_head proc_probes_list; -struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid) +struct sspt_proc *sspt_proc_create(struct dentry* dentry, pid_t tgid) { - struct sspt_procs *procs = kmalloc(sizeof(*procs), GFP_ATOMIC); + struct sspt_proc *proc = kmalloc(sizeof(*proc), GFP_ATOMIC); - if (procs) { - INIT_LIST_HEAD(&procs->list); - procs->tgid = tgid; - procs->dentry = dentry; - INIT_LIST_HEAD(&procs->file_list); + if (proc) { + INIT_LIST_HEAD(&proc->list); + proc->tgid = tgid; + proc->dentry = dentry; + INIT_LIST_HEAD(&proc->file_list); } - return procs; + return proc; } -void sspt_procs_free(struct sspt_procs *procs) +void sspt_proc_free(struct sspt_proc *proc) { struct sspt_file *file, *n; - list_for_each_entry_safe(file, n, &procs->file_list, list) { + list_for_each_entry_safe(file, n, &proc->file_list, list) { list_del(&file->list); sspt_file_free(file); } - kfree(procs); + kfree(proc); } // TODO: remove "us_proc_info" #include "../storage.h" extern inst_us_proc_t us_proc_info; -void sspt_procs_free_all(void) +void sspt_proc_free_all(void) { // is user-space instrumentation if (us_proc_info.path == NULL) { @@ -66,64 +66,64 @@ void sspt_procs_free_all(void) if (strcmp(us_proc_info.path,"*") == 0) { // libonly - struct sspt_procs *procs, *n; - list_for_each_entry_safe(procs, n, &proc_probes_list, list) { - list_del(&procs->list); - sspt_procs_free(procs); + struct sspt_proc *proc, *n; + list_for_each_entry_safe(proc, n, &proc_probes_list, list) { + list_del(&proc->list); + sspt_proc_free(proc); } } else { // app - sspt_procs_free(us_proc_info.pp); + sspt_proc_free(us_proc_info.pp); us_proc_info.pp = NULL; } } -static void sspt_procs_add_file(struct sspt_procs *procs, struct sspt_file *file) +static void sspt_proc_add_file(struct sspt_proc *proc, struct sspt_file *file) { - list_add(&file->list, &procs->file_list); + list_add(&file->list, &proc->file_list); } -struct sspt_file *sspt_procs_find_file_or_new(struct sspt_procs *procs, +struct sspt_file *sspt_proc_find_file_or_new(struct sspt_proc *proc, struct dentry *dentry, char *name) { struct sspt_file *file; - list_for_each_entry(file, &procs->file_list, list) { + list_for_each_entry(file, &proc->file_list, list) { if (file->dentry == dentry) { return file; } } file = sspt_file_create(name, dentry, 10); - sspt_procs_add_file(procs, file); + sspt_proc_add_file(proc, file); return file; } -void sspt_procs_add_ip_data(struct sspt_procs *procs, struct dentry* dentry, +void sspt_proc_add_ip_data(struct sspt_proc *proc, struct dentry* dentry, char *name, struct ip_data *ip_d) { - struct sspt_file *file = sspt_procs_find_file_or_new(procs, dentry, name); + struct sspt_file *file = sspt_proc_find_file_or_new(proc, dentry, name); sspt_file_add_ip(file, ip_d); } -struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task) +struct sspt_proc *sspt_proc_copy(struct sspt_proc *proc, struct task_struct *task) { struct sspt_file *file; - struct sspt_procs *procs_out = sspt_procs_create(procs->dentry, task->tgid); + struct sspt_proc *proc_out = sspt_proc_create(proc->dentry, task->tgid); - list_for_each_entry(file, &procs->file_list, list) { - sspt_procs_add_file(procs_out, sspt_file_copy(file)); + list_for_each_entry(file, &proc->file_list, list) { + sspt_proc_add_file(proc_out, sspt_file_copy(file)); } - return procs_out; + return proc_out; } -struct sspt_file *sspt_procs_find_file(struct sspt_procs *procs, struct dentry *dentry) +struct sspt_file *sspt_proc_find_file(struct sspt_proc *proc, struct dentry *dentry) { struct sspt_file *file; - list_for_each_entry(file, &procs->file_list, list) { + list_for_each_entry(file, &proc->file_list, list) { if (dentry == file->dentry) { return file; } diff --git a/driver/sspt/sspt_procs.h b/driver/sspt/sspt_proc.h similarity index 69% rename from driver/sspt/sspt_procs.h rename to driver/sspt/sspt_proc.h index 5cd1015..2897357 100644 --- a/driver/sspt/sspt_procs.h +++ b/driver/sspt/sspt_proc.h @@ -3,7 +3,7 @@ /* * Dynamic Binary Instrumentation Module based on KProbes - * modules/driver/sspt/sspt_procs.h + * modules/driver/sspt/sspt_proc.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include #include "sspt_file.h" -struct sspt_procs { +struct sspt_proc { struct list_head list; pid_t tgid; struct dentry *dentry; @@ -36,15 +36,15 @@ struct sspt_procs { }; -struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid); -struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task); -void sspt_procs_free(struct sspt_procs *procs); -void sspt_procs_free_all(void); +struct sspt_proc *sspt_proc_create(struct dentry* dentry, pid_t tgid); +struct sspt_proc *sspt_proc_copy(struct sspt_proc *proc, struct task_struct *task); +void sspt_proc_free(struct sspt_proc *proc); +void sspt_proc_free_all(void); -void sspt_procs_add_ip_data(struct sspt_procs *procs, struct dentry* dentry, +void sspt_proc_add_ip_data(struct sspt_proc *proc, struct dentry* dentry, char *name, struct ip_data *ip_d); -struct sspt_file *sspt_procs_find_file(struct sspt_procs *procs, struct dentry *dentry); -struct sspt_file *sspt_procs_find_file_or_new(struct sspt_procs *procs, +struct sspt_file *sspt_proc_find_file(struct sspt_proc *proc, struct dentry *dentry); +struct sspt_file *sspt_proc_find_file_or_new(struct sspt_proc *proc, struct dentry *dentry, char *name); #endif /* __SSPT_PROC__ */ diff --git a/driver/storage.h b/driver/storage.h index dfff677..1eb08e9 100644 --- a/driver/storage.h +++ b/driver/storage.h @@ -212,7 +212,7 @@ typedef struct us_proc_lib_t *p_libs; // new_dpf - struct sspt_procs *pp; + struct sspt_proc *pp; } inst_us_proc_t; typedef struct diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index 5c3d12c..8b582aa 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -95,9 +95,9 @@ static inline int is_us_instrumentation(void) return !!us_proc_info.path; } -static struct sspt_procs *get_proc_probes_by_task(struct task_struct *task) +static struct sspt_proc *get_proc_probes_by_task(struct task_struct *task) { - struct sspt_procs *procs, *tmp; + struct sspt_proc *proc, *tmp; if (!is_libonly()) { if (task != current) { @@ -108,29 +108,29 @@ static struct sspt_procs *get_proc_probes_by_task(struct task_struct *task) return us_proc_info.pp; } - list_for_each_entry_safe(procs, tmp, &proc_probes_list, list) { - if (procs->tgid == task->tgid) { - return procs; + list_for_each_entry_safe(proc, tmp, &proc_probes_list, list) { + if (proc->tgid == task->tgid) { + return proc; } } return NULL; } -static void add_proc_probes(struct task_struct *task, struct sspt_procs *procs) +static void add_proc_probes(struct task_struct *task, struct sspt_proc *proc) { - list_add_tail(&procs->list, &proc_probes_list); + list_add_tail(&proc->list, &proc_probes_list); } -static struct sspt_procs *get_proc_probes_by_task_or_new(struct task_struct *task) +static struct sspt_proc *get_proc_probes_by_task_or_new(struct task_struct *task) { - struct sspt_procs *procs = get_proc_probes_by_task(task); - if (procs == NULL) { - procs = sspt_procs_copy(us_proc_info.pp, task); - add_proc_probes(task, procs); + struct sspt_proc *proc = get_proc_probes_by_task(task); + if (proc == NULL) { + proc = sspt_proc_copy(us_proc_info.pp, task); + add_proc_probes(task, proc); } - return procs; + return proc; } #ifdef SLP_APP @@ -292,7 +292,7 @@ static int find_task_by_path (const char *path, struct task_struct **p_task, str } static void set_mapping_file(struct sspt_file *file, - const struct sspt_procs *procs, + const struct sspt_proc *proc, const struct task_struct *task, const struct vm_area_struct *vma); @@ -312,7 +312,7 @@ int install_otg_ip(unsigned long addr, unsigned long offset_addr = addr - vma->vm_start; struct dentry *dentry = vma->vm_file->f_dentry; char *name = dentry->d_iname; - struct sspt_procs *procs = get_proc_probes_by_task(task); + struct sspt_proc *proc = get_proc_probes_by_task(task); struct ip_data pd = { .offset = offset_addr, .pre_handler = pre_handler, @@ -321,18 +321,18 @@ int install_otg_ip(unsigned long addr, .flag_retprobe = 1 }; - struct sspt_file *file = sspt_procs_find_file_or_new(procs, dentry, name); + struct sspt_file *file = sspt_proc_find_file_or_new(proc, dentry, name); struct sspt_page *page = sspt_get_page(file, offset_addr); struct us_ip *ip = sspt_find_ip(page, offset_addr & ~PAGE_MASK); if (!file->loaded) { - set_mapping_file(file, procs, task, vma); + set_mapping_file(file, proc, task, vma); file->loaded = 1; } if (ip == NULL) { - // TODO: sspt_procs_find_file_or_new --> sspt_procs_find_file ?! - struct sspt_file *file = sspt_procs_find_file_or_new(procs, dentry, name); + // TODO: sspt_proc_find_file_or_new --> sspt_proc_find_file ?! + struct sspt_file *file = sspt_proc_find_file_or_new(proc, dentry, name); sspt_file_add_ip(file, &pd); /* if addr mapping, that probe install, else it be installed in do_page_fault handler */ @@ -389,7 +389,7 @@ static int uninstall_kernel_probe (unsigned long addr, int uflag, int kflag, ker return iRet; } -static int uninstall_us_proc_probes(struct task_struct *task, struct sspt_procs *procs, enum US_FLAGS flag); +static int uninstall_us_proc_probes(struct task_struct *task, struct sspt_proc *proc, enum US_FLAGS flag); int deinst_usr_space_proc (void) { @@ -426,12 +426,12 @@ int deinst_usr_space_proc (void) EPRINTF ("uninstall_kernel_probe(do_munmap) result=%d!", iRet); if (is_libonly()) { - struct sspt_procs *procs; + struct sspt_proc *proc; for_each_process(task) { - procs = get_proc_probes_by_task(task); - if (procs) { - int ret = uninstall_us_proc_probes(task, procs, US_UNREGS_PROBE); + proc = get_proc_probes_by_task(task); + if (proc) { + int ret = uninstall_us_proc_probes(task, proc, US_UNREGS_PROBE); if (ret) { EPRINTF ("failed to uninstall IPs (%d)!", ret); } @@ -510,7 +510,7 @@ static int install_kernel_probe (unsigned long addr, int uflag, int kflag, kerne return 0; } -static void install_proc_probes(struct task_struct *task, struct sspt_procs *procs, int atomic); +static void install_proc_probes(struct task_struct *task, struct sspt_proc *proc, int atomic); int inst_usr_space_proc (void) { @@ -556,7 +556,7 @@ int inst_usr_space_proc (void) { // FIXME: clear_task_inst_info(); for_each_process (task) { - struct sspt_procs *procs; + struct sspt_proc *proc; if (task->flags & PF_KTHREAD){ DPRINTF("ignored kernel thread %d\n", @@ -564,9 +564,9 @@ int inst_usr_space_proc (void) continue; } - procs = get_proc_probes_by_task_or_new(task); + proc = get_proc_probes_by_task_or_new(task); DPRINTF("trying process"); - install_proc_probes(task, procs, 1); + install_proc_probes(task, proc, 1); //put_task_struct (task); } } @@ -651,11 +651,11 @@ unsigned long imi_sum_time = 0; unsigned long imi_sum_hit = 0; static void set_mapping_file(struct sspt_file *file, - const struct sspt_procs *procs, + const struct sspt_proc *proc, const struct task_struct *task, const struct vm_area_struct *vma) { - int app_flag = (vma->vm_file->f_dentry == procs->dentry); + int app_flag = (vma->vm_file->f_dentry == proc->dentry); file->vm_start = vma->vm_start; file->vm_end = vma->vm_end; @@ -731,7 +731,7 @@ static int unregister_us_page_probe(struct task_struct *task, return err; } -static void install_page_probes(unsigned long page_addr, struct task_struct *task, struct sspt_procs *procs, int atomic) +static void install_page_probes(unsigned long page_addr, struct task_struct *task, struct sspt_proc *proc, int atomic) { int lock; struct mm_struct *mm; @@ -742,11 +742,11 @@ static void install_page_probes(unsigned long page_addr, struct task_struct *tas vma = find_vma(mm, page_addr); if (vma && check_vma(vma)) { struct dentry *dentry = vma->vm_file->f_dentry; - struct sspt_file *file = sspt_procs_find_file(procs, dentry); + struct sspt_file *file = sspt_proc_find_file(proc, dentry); if (file) { struct sspt_page *page; if (!file->loaded) { - set_mapping_file(file, procs, task, vma); + set_mapping_file(file, proc, task, vma); file->loaded = 1; } @@ -775,7 +775,7 @@ static void install_file_probes(struct task_struct *task, struct mm_struct *mm, } } -static void install_proc_probes(struct task_struct *task, struct sspt_procs *procs, int atomic) +static void install_proc_probes(struct task_struct *task, struct sspt_proc *proc, int atomic) { int lock; struct vm_area_struct *vma; @@ -786,10 +786,10 @@ static void install_proc_probes(struct task_struct *task, struct sspt_procs *pro for (vma = mm->mmap; vma; vma = vma->vm_next) { if (check_vma(vma)) { struct dentry *dentry = vma->vm_file->f_dentry; - struct sspt_file *file = sspt_procs_find_file(procs, dentry); + struct sspt_file *file = sspt_proc_find_file(proc, dentry); if (file) { if (!file->loaded) { - set_mapping_file(file, procs, task, vma); + set_mapping_file(file, proc, task, vma); file->loaded = 1; } @@ -847,12 +847,12 @@ static int unregister_us_file_probes(struct task_struct *task, struct sspt_file return err; } -static int uninstall_us_proc_probes(struct task_struct *task, struct sspt_procs *procs, enum US_FLAGS flag) +static int uninstall_us_proc_probes(struct task_struct *task, struct sspt_proc *proc, enum US_FLAGS flag) { int err = 0; struct sspt_file *file; - list_for_each_entry_rcu(file, &procs->file_list, list) { + list_for_each_entry_rcu(file, &proc->file_list, list) { err = unregister_us_file_probes(task, file, flag); if (err != 0) { // TODO: @@ -896,7 +896,7 @@ void do_page_fault_ret_pre_code (void) { struct task_struct *task = current->group_leader; struct mm_struct *mm = task->mm; - struct sspt_procs *procs = NULL; + struct sspt_proc *proc = NULL; /* * Because process threads have same address space * we instrument only group_leader of all this threads @@ -934,7 +934,7 @@ void do_page_fault_ret_pre_code (void) } if (is_libonly()) { - procs = get_proc_probes_by_task_or_new(task); + proc = get_proc_probes_by_task_or_new(task); } else { // find task if (us_proc_info.tgid == 0) { @@ -948,16 +948,16 @@ void do_page_fault_ret_pre_code (void) } if (us_proc_info.tgid == task->tgid) { - procs = us_proc_info.pp; + proc = us_proc_info.pp; } } - if (procs) { + if (proc) { unsigned long page = addr & PAGE_MASK; // overhead do_gettimeofday(&imi_tv1); - install_page_probes(page, task, procs, 1); + install_page_probes(page, task, proc, 1); do_gettimeofday(&imi_tv2); imi_sum_hit++; imi_sum_time += ((imi_tv2.tv_sec - imi_tv1.tv_sec) * USEC_IN_SEC_NUM + @@ -992,7 +992,7 @@ void print_vma(struct mm_struct *mm) printk("### print_vma: END\n"); } -static int remove_unmap_probes(struct task_struct *task, struct sspt_procs *procs, unsigned long start, size_t len) +static int remove_unmap_probes(struct task_struct *task, struct sspt_proc *proc, unsigned long start, size_t len) { struct mm_struct *mm = task->mm; struct vm_area_struct *vma; @@ -1011,7 +1011,7 @@ static int remove_unmap_probes(struct task_struct *task, struct sspt_procs *proc unsigned long end = start + len; struct dentry *dentry = vma->vm_file->f_dentry; - file = sspt_procs_find_file(procs, dentry); + file = sspt_proc_find_file(proc, dentry); if (file) { if (vma->vm_start == start || vma->vm_end == end) { unregister_us_file_probes(task, file, US_NOT_RP2); @@ -1039,7 +1039,7 @@ static int remove_unmap_probes(struct task_struct *task, struct sspt_procs *proc void do_munmap_probe_pre_code(struct mm_struct *mm, unsigned long start, size_t len) { - struct sspt_procs *procs = NULL; + struct sspt_proc *proc = NULL; struct task_struct *task = current; //if user-space instrumentation is not set @@ -1048,15 +1048,15 @@ void do_munmap_probe_pre_code(struct mm_struct *mm, unsigned long start, size_t } if (is_libonly()) { - procs = get_proc_probes_by_task(task); + proc = get_proc_probes_by_task(task); } else { if (task->tgid == us_proc_info.tgid) { - procs = us_proc_info.pp; + proc = us_proc_info.pp; } } - if (procs) { - if (remove_unmap_probes(task, procs, start, len)) { + if (proc) { + if (remove_unmap_probes(task, proc, start, len)) { printk("ERROR do_munmap: start=%lx, len=%x\n", start, len); } } @@ -1066,23 +1066,23 @@ EXPORT_SYMBOL_GPL(do_munmap_probe_pre_code); void mm_release_probe_pre_code(void) { struct task_struct *task = current; - struct sspt_procs *procs = NULL; + struct sspt_proc *proc = NULL; if (!is_us_instrumentation() || task->tgid != task->pid) { return; } if (is_libonly()) { - procs = get_proc_probes_by_task(task); + proc = get_proc_probes_by_task(task); } else { if (task->tgid == us_proc_info.tgid) { - procs = get_proc_probes_by_task(task); + proc = get_proc_probes_by_task(task); us_proc_info.tgid = 0; } } - if (procs) { - int ret = uninstall_us_proc_probes(task, procs, US_NOT_RP2); + if (proc) { + int ret = uninstall_us_proc_probes(task, proc, US_NOT_RP2); if (ret != 0) { EPRINTF ("failed to uninstall IPs (%d)!", ret); } @@ -1093,18 +1093,18 @@ void mm_release_probe_pre_code(void) EXPORT_SYMBOL_GPL(mm_release_probe_pre_code); -static void recover_child(struct task_struct *child_task, struct sspt_procs *procs) +static void recover_child(struct task_struct *child_task, struct sspt_proc *proc) { - uninstall_us_proc_probes(child_task, procs, US_DISARM); + uninstall_us_proc_probes(child_task, proc, US_DISARM); dbi_disarm_urp_inst_for_task(current, child_task); } static void rm_uprobes_child(struct task_struct *new_task) { if (is_libonly()) { - struct sspt_procs *procs = get_proc_probes_by_task(current); - if(procs) { - recover_child(new_task, procs); + struct sspt_proc *proc = get_proc_probes_by_task(current); + if(proc) { + recover_child(new_task, proc); } } else { if(us_proc_info.tgid == current->tgid) { -- 2.7.4