do_page_fault instrumentation workaround for x86 platform
authorVasiliy Ulyanov <v.ulyanov@samsung.com>
Mon, 16 Jul 2012 06:05:22 +0000 (10:05 +0400)
committerVasiliy Ulyanov <v.ulyanov@samsung.com>
Mon, 16 Jul 2012 06:05:22 +0000 (10:05 +0400)
driver/probes_manager.c

index cf614cb..85748b9 100644 (file)
@@ -384,8 +384,20 @@ def_jprobe_event_handler (unsigned long arg1, unsigned long arg2, unsigned long
 
        if (pf_probe == probe)
        {
+#ifdef CONFIG_X86
+               /* FIXME on x86 targets do_page_fault instrumentation may lead to
+                * abnormal termination of some applications (in most cases GUI apps).
+                * It looks like when do_page_fault probe is hit and the
+                * def_jprobe_event_handler is executed it tries to write event info
+                * into the SWAP buffer which seems not to be mapped into the
+                * process memory yet. Such behaviour causes segmentation faults.
+                * For now as a workaround we just avoid to write the ENTRY event into
+                * the buffer in all cases. */
+               skip = 1;
+#else /* CONFIG_X86 */
                if (!(probes_flags & PROBE_FLAG_PF_INSTLD))
                        skip = 1;
+#endif /* CONFIG_X86 */
        }
        else if (exit_probe == probe)
        {