[FEATURE] 'on the go' US probe 64/39864/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 7 Nov 2014 18:53:34 +0000 (22:53 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 18 May 2015 09:43:37 +0000 (12:43 +0300)
Change-Id: Ia3501c4ed5a95a3c190dfe38730a8636801eb034
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
us_manager/sspt/sspt_proc.c
us_manager/sspt/sspt_proc.h

index c573e4d..5152925 100644 (file)
@@ -268,6 +268,35 @@ struct sspt_file *sspt_proc_find_file(struct sspt_proc *proc,
        return NULL;
 }
 
+void sspt_proc_install_probe(struct sspt_proc *proc, unsigned long vaddr,
+                            struct probe_info *probe_i)
+{
+       struct vm_area_struct *vma;
+       struct task_struct *task = proc->task;
+       struct mm_struct *mm = task->mm;
+       unsigned long page_vaddr = vaddr & PAGE_MASK;
+
+       vma = find_vma_intersection(mm, page_vaddr, page_vaddr + 1);
+       if (vma && check_vma(vma)) {
+               struct sspt_file *file;
+               struct dentry *dentry = vma->vm_file->f_dentry;
+
+               file = sspt_proc_find_file_or_new(proc, dentry);
+               if (file) {
+                       unsigned long addr = vaddr - vma->vm_start;
+                       struct sspt_page *page;
+
+                       sspt_file_set_mapping(file, vma);
+                       sspt_file_add_ip(file, addr, probe_i);
+
+                       page = sspt_find_page_mapped(file, page_vaddr);
+                       if (page)
+                               sspt_register_page(page, file);
+               }
+       }
+}
+EXPORT_SYMBOL_GPL(sspt_proc_install_probe);
+
 /**
  * @brief Install probes on the page to monitored process
  *
index 8659648..9fcee58 100644 (file)
@@ -72,6 +72,8 @@ struct sspt_file *sspt_proc_find_file(struct sspt_proc *proc,
 struct sspt_file *sspt_proc_find_file_or_new(struct sspt_proc *proc,
                                             struct dentry *dentry);
 
+void sspt_proc_install_probe(struct sspt_proc *proc, unsigned long vaddr,
+                            struct probe_info *probe_i);
 void sspt_proc_install_page(struct sspt_proc *proc, unsigned long page_addr);
 void sspt_proc_install(struct sspt_proc *proc);
 int sspt_proc_uninstall(struct sspt_proc *proc,