[REFACTOR] remove field 'name' from 'struct sspt_file'
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 14 Jun 2013 08:41:02 +0000 (12:41 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 14 Jun 2013 08:41:02 +0000 (12:41 +0400)
us_manager/pf/pf_group.c
us_manager/sspt/sspt_debug.h
us_manager/sspt/sspt_file.c
us_manager/sspt/sspt_file.h
us_manager/sspt/sspt_proc.c
us_manager/sspt/sspt_proc.h

index e5b7adb..24d116b 100644 (file)
@@ -54,18 +54,14 @@ static void del_pl_struct(struct pl_struct *pls)
 
 void copy_proc_form_img_to_sspt(struct img_proc *i_proc, struct sspt_proc *proc)
 {
-       char *file_name;
        struct sspt_file *file;
        struct ip_data ip_d;
-       struct dentry *dentry;
 
        struct img_file *i_file;
        struct img_ip *i_ip;
 
        list_for_each_entry(i_file, &i_proc->file_list, list) {
-               dentry = i_file->dentry;
-               file_name = dentry->d_iname;
-               file = sspt_proc_find_file_or_new(proc, dentry, file_name);
+               file = sspt_proc_find_file_or_new(proc, i_file->dentry);
 
                list_for_each_entry(i_ip, &i_file->ip_list, list) {
                        ip_d.flag_retprobe = 1;
index 3861c48..d79552a 100644 (file)
@@ -75,7 +75,7 @@ static inline void print_file_probes(const struct sspt_file *file)
        name = (file->dentry) ? file->dentry->d_iname : NA;
 
        printk("### print_file_probes: path=%s, d_iname=%s, table_size=%lu, vm_start=%lx\n",
-                       file->name, name, table_size, file->vm_start);
+                       file->dentry->d_iname, name, table_size, file->vm_start);
 
        for (i = 0; i < table_size; ++i) {
                head = &file->page_probes_table[i];
index 42745a7..206a9ad 100644 (file)
@@ -41,7 +41,7 @@ static int calculation_hash_bits(int cnt)
        return bits;
 }
 
-struct sspt_file *sspt_file_create(char *name, struct dentry *dentry, int page_cnt)
+struct sspt_file *sspt_file_create(struct dentry *dentry, int page_cnt)
 {
        struct sspt_file *obj = kmalloc(sizeof(*obj), GFP_ATOMIC);
 
@@ -49,7 +49,6 @@ struct sspt_file *sspt_file_create(char *name, struct dentry *dentry, int page_c
                int i, table_size;
                INIT_LIST_HEAD(&obj->list);
                obj->proc = NULL;
-               obj->name = name;
                obj->dentry = dentry;
                obj->loaded = 0;
                obj->vm_start = 0;
@@ -128,8 +127,8 @@ struct sspt_page *sspt_find_page_mapped(struct sspt_file *file, unsigned long pa
 
        if (file->vm_start > page || file->vm_end < page) {
                // TODO: or panic?!
-               printk("ERROR: file_p[vm_start..vm_end] <> page: file_p[vm_start=%lx, vm_end=%lx, path=%s, d_iname=%s] page=%lx\n",
-                               file->vm_start, file->vm_end, file->name, file->dentry->d_iname, page);
+               printk("ERROR: file_p[vm_start..vm_end] <> page: file_p[vm_start=%lx, vm_end=%lx, d_iname=%s] page=%lx\n",
+                               file->vm_start, file->vm_end, file->dentry->d_iname, page);
                return NULL;
        }
 
@@ -236,6 +235,6 @@ void sspt_file_set_mapping(struct sspt_file *file, struct vm_area_struct *vma)
        file->vm_end = vma->vm_end;
 
        ptr_pack_task_event_info(task, DYN_LIB_PROBE_ID, RECORD_ENTRY, "dspdd",
-                                task->tgid, file->name, vma->vm_start,
+                                task->tgid, file->dentry->d_iname, vma->vm_start,
                                 vma->vm_end - vma->vm_start, 0);
 }
index 064e65a..fd17704 100644 (file)
@@ -34,7 +34,6 @@ struct sspt_file {
        struct list_head list;                  // for proc_probes
        struct sspt_proc *proc;
        struct dentry *dentry;
-       char *name;
        int loaded;
        unsigned long vm_start;
        unsigned long vm_end;
@@ -44,7 +43,7 @@ struct sspt_file {
 };
 
 
-struct sspt_file *sspt_file_create(char *name, struct dentry *dentry, int page_cnt);
+struct sspt_file *sspt_file_create(struct dentry *dentry, int page_cnt);
 void sspt_file_free(struct sspt_file *file);
 
 struct sspt_page *sspt_find_page_mapped(struct sspt_file *file, unsigned long page);
index a8ee2d1..19bb175 100644 (file)
@@ -127,13 +127,13 @@ static void sspt_proc_add_file(struct sspt_proc *proc, struct sspt_file *file)
 }
 
 struct sspt_file *sspt_proc_find_file_or_new(struct sspt_proc *proc,
-               struct dentry *dentry, char *name)
+                                            struct dentry *dentry)
 {
        struct sspt_file *file;
 
        file = sspt_proc_find_file(proc, dentry);
        if (file == NULL) {
-               file = sspt_file_create(name, dentry, 10);
+               file = sspt_file_create(dentry, 10);
                sspt_proc_add_file(proc, file);
        }
 
index 22e70d3..0603266 100644 (file)
@@ -55,7 +55,7 @@ void sspt_proc_free_all(void);
 
 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);
+                                            struct dentry *dentry);
 
 void sspt_proc_install_page(struct sspt_proc *proc, unsigned long page_addr);
 void sspt_proc_install(struct sspt_proc *proc);