Revert "Fixed libonly instrumentation (#264)"
authorNikita Kalyazin <n.kalyazin@samsung.com>
Fri, 6 Jul 2012 12:46:07 +0000 (16:46 +0400)
committerNikita Kalyazin <n.kalyazin@samsung.com>
Fri, 6 Jul 2012 12:46:07 +0000 (16:46 +0400)
This reverts commit f8292b787f894df3b47fc7ee80b486f7dd5dac53.

The trace is not collected from Browser application (App&Lib inst) if
the application is launched after start tracing.

driver/probes_manager.c
driver/us_proc_inst.c

index 6173459..cf614cb 100644 (file)
@@ -415,12 +415,11 @@ def_jprobe_event_handler (unsigned long arg1, unsigned long arg2, unsigned long
        {
                if (us_proc_probes & US_PROC_EXEC_INSTLD)
                        /*
-                        * FIXME: This is not a good choice to call
-                        * do_fork_probe_pre_code() here.  The function should
-                        * have more common name explaining that we deinstall
-                        * all the user space instrumentation from this task.
+                        * FIXME: This is not a good choice to call do_exit_probe_pre_code()
+                        * here.  The function should have more common name explaining that
+                        * we deinstall all the user space instrumentation from this task.
                         */
-                       do_fork_probe_pre_code();
+                       do_exit_probe_pre_code ();
                if (!(probes_flags & PROBE_FLAG_EXEC_INSTLD))
                        skip = 1;
        }
index 0cf97be..ade596f 100644 (file)
@@ -1336,14 +1336,6 @@ void do_page_fault_ret_pre_code (void)
        if (!us_proc_info.path)
                return;
 
-       if (task->flags & PF_FORKNOEXEC)
-               /*
-                * TODO:
-                * Call something like do_page_fault_ret_pre_code after exec
-                */
-               DPRINTF("ignored probe insertion during exec\n");
-               return;
-
        if (task->flags & PF_KTHREAD) {
                DPRINTF("ignored kernel thread %d\n", task->pid);
                return;
@@ -1497,16 +1489,15 @@ void do_fork_probe_pre_code(void)
        }
 
        if (!strcmp(us_proc_info.path,"*")) {
-               task_inst_info = get_task_inst_node(current->group_leader);
-               if (!task_inst_info) {
-                       return;
-               }
-               ret = uninstall_mapped_ips(current->group_leader,
-                                           task_inst_info, 1);
-               if (ret != 0) {
-                       EPRINTF("failed to uninstall IPs (%d)!", ret);
+               task_inst_info = get_task_inst_node(current);
+               if (task_inst_info)  {
+                       ret = uninstall_mapped_ips (current, task_inst_info, 1);
+                       if (ret != 0) {
+                               EPRINTF("failed to uninstall IPs (%d)!", ret);
+                       }
+                       dbi_unregister_all_uprobes(current, 1);
                }
-               dbi_unregister_all_uprobes(current->group_leader, 1);
+               return;
        } else {
                if (current->tgid != us_proc_info.tgid) {
                        return;