 +	char *start_probe;
 +	char *end_probe;
 +	
-+	#ifdef ENABLE_DTRACE
++#ifdef ENABLE_DTRACE
 +
 +	args = rb_scan_args(argc, argv, "11", &name, &data);
 +	probe_data = args == 2 ? StringValuePtr(data) : "";

 
 VALUE rb_cProc;
 VALUE rb_cBinding;
@@ -3028,6 +3031,13 @@
 	RETURN(Qfalse);
 
       case NODE_IF:
+#ifdef ENABLE_DTRACE
+	if (RUBY_LINE_ENABLED()) {
+	    if (ruby_current_node && ruby_current_node->nd_file) {
+		  RUBY_LINE(ruby_current_node->nd_file, nd_line(ruby_current_node));
+	    }
+	}
+#endif
 	EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self,
 			ruby_frame->last_func,
 			ruby_frame->last_class);
@@ -3046,6 +3056,13 @@
 	    if (nd_type(node) != NODE_WHEN) goto again;
 	    tag = node->nd_head;
 	    while (tag) {
+#ifdef ENABLE_DTRACE
+		if (RUBY_LINE_ENABLED()) {
+		    if (ruby_current_node && ruby_current_node->nd_file) {
+                RUBY_LINE(ruby_current_node->nd_file, nd_line(ruby_current_node));
+            }
+        }
+#endif		
 		EXEC_EVENT_HOOK(RUBY_EVENT_LINE, tag, self,
 				ruby_frame->last_func,
 				ruby_frame->last_class);
@@ -3087,6 +3104,13 @@
 		}
 		tag = node->nd_head;
 		while (tag) {
+#ifdef ENABLE_DTRACE
+            if (RUBY_LINE_ENABLED()) {
+                if (ruby_current_node && ruby_current_node->nd_file) {
+                    RUBY_LINE(ruby_current_node->nd_file, nd_line(ruby_current_node));
+		        }
+		    }
+#endif			
 		    EXEC_EVENT_HOOK(RUBY_EVENT_LINE, tag, self,
 				    ruby_frame->last_func,
 				    ruby_frame->last_class);
@@ -3307,6 +3331,13 @@
 		rescuing = -1;
 		while (resq) {
 		    ruby_current_node = resq;
+#ifdef ENABLE_DTRACE
+		    if (RUBY_RESCUE_ENABLED()) {
+		        if (ruby_current_node && ruby_current_node->nd_file) {
+                    RUBY_RESCUE(ruby_current_node->nd_file, nd_line(ruby_current_node));
+                }
+            }
+#endif		
 		    if (handle_rescue(self, resq)) {
 			state = 0;
 			rescuing = 1;
@@ -4124,6 +4155,13 @@
 	break;
 
       case NODE_NEWLINE:
+#ifdef ENABLE_DTRACE
+          if (RUBY_LINE_ENABLED()) {
+              if (ruby_current_node && ruby_current_node->nd_file) {
+                  RUBY_LINE(ruby_current_node->nd_file, nd_line(ruby_current_node));
+              }
+          }
+#endif
 	EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node, self, 
 			ruby_frame->last_func,
 			ruby_frame->last_class);
@@ -4598,6 +4636,11 @@
 
     rb_trap_restore_mask();
     if (tag != TAG_FATAL) {
+#ifdef ENABLE_DTRACE
+        if (RUBY_RAISE_ENABLED()) {
+            RUBY_RAISE(rb_obj_classname(ruby_errinfo), ruby_sourcefile, ruby_sourceline);
+        }
+#endif
 	EXEC_EVENT_HOOK(RUBY_EVENT_RAISE, ruby_current_node,
 			ruby_frame->self,
 			ruby_frame->last_func,
@@ -5828,6 +5871,14 @@
 		rb_bug("bad argc (%d) specified for `%s(%s)'",
 		       len, rb_class2name(klass), rb_id2name(id));
 	    }
+#ifdef ENABLE_DTRACE
+       if (RUBY_FUNCTION_ENTRY_ENABLED()) {
+           char *classname = rb_class2name(klass), *methodname = rb_id2name(id);
+  	       if (ruby_current_node && ruby_current_node->nd_file && classname && methodname) {
+               RUBY_FUNCTION_ENTRY(classname, methodname, ruby_current_node->nd_file, nd_line(ruby_current_node));
+           }
+      }
+#endif	
 	    if (event_hooks) {
 		int state;
 
@@ -5846,6 +5897,14 @@
 	    else {
 		result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
 	    }
+#ifdef ENABLE_DTRACE
+        if (RUBY_FUNCTION_RETURN_ENABLED()) {
+            char *classname = rb_class2name(klass), *methodname = rb_id2name(id);
+            if (ruby_current_node && ruby_current_node->nd_file && classname && methodname) {
+	            RUBY_FUNCTION_RETURN(classname, methodname, ruby_current_node->nd_file, nd_line(ruby_current_node));
+	        }
+	    }
+#endif	
 	}
 	break;
 
@@ -5873,12 +5932,28 @@
 
       case NODE_BMETHOD:
 	ruby_frame->flags |= FRAME_DMETH;
+#ifdef ENABLE_DTRACE
+	if (RUBY_FUNCTION_ENTRY_ENABLED()) {
+		char *classname = rb_class2name(klass), *methodname = rb_id2name(id);
+		if (ruby_current_node && ruby_current_node->nd_file && classname && methodname) {
+	        RUBY_FUNCTION_ENTRY(classname, methodname, ruby_current_node->nd_file, nd_line(ruby_current_node));
+	    }
+	 }
+#endif	
 	if (event_hooks) {
 	    struct BLOCK *data;
 	    Data_Get_Struct(body->nd_cval, struct BLOCK, data);
 	    EXEC_EVENT_HOOK(RUBY_EVENT_CALL, data->body, recv, id, klass);
 	}
 	result = proc_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv, klass);
+#ifdef ENABLE_DTRACE
+	 if (RUBY_FUNCTION_RETURN_ENABLED()) {
+	    char *classname = rb_class2name(klass), *methodname = rb_id2name(id);
+	    if (ruby_current_node && ruby_current_node->nd_file && classname && methodname) {
+	        RUBY_FUNCTION_RETURN(classname, methodname, ruby_current_node->nd_file, nd_line(ruby_current_node));
+	    }
+	}
+#endif	
 	if (event_hooks) {
 	    EXEC_EVENT_HOOK(RUBY_EVENT_RETURN, body, recv, id, klass);
 	}
@@ -5992,6 +6067,13 @@
 		    }
 		    ruby_frame->argc = i;
 		}
+#ifdef ENABLE_DTRACE
+		if (RUBY_FUNCTION_ENTRY_ENABLED()) {
+			char *classname = rb_class2name(klass), *methodname = rb_id2name(id);
+			if (ruby_current_node && ruby_current_node->nd_file && classname && methodname)
+		            RUBY_FUNCTION_ENTRY(classname, methodname, ruby_current_node->nd_file, nd_line(ruby_current_node));
+		 }
+#endif		
 		if (event_hooks) {
 		    EXEC_EVENT_HOOK(RUBY_EVENT_CALL, b2, recv, id, klass);
 		}
@@ -6002,6 +6084,14 @@
 		state = 0;
 	    }
 	    POP_TAG();
+#ifdef ENABLE_DTRACE
+       if (RUBY_FUNCTION_RETURN_ENABLED()) {
+           char *classname = rb_class2name(klass), *methodname = rb_id2name(id);
+           if (ruby_current_node && ruby_current_node->nd_file && classname && methodname) {
+               RUBY_FUNCTION_RETURN(classname, methodname, ruby_current_node->nd_file, nd_line(ruby_current_node));
+           }
+      }
+#endif	
 	    if (event_hooks) {
 		EXEC_EVENT_HOOK(RUBY_EVENT_RETURN, body, recv, id, klass);
 	    }

+		/* Build -start and -end strings for probe names */
+		if (RUBY_RUBY_PROBE_ENABLED())
+			RUBY_RUBY_PROBE(start_probe, probe_data);
+#endif
+	
+		ret = rb_yield(Qnil);
+	
+#if ENABLE_DTRACE
+		if (RUBY_RUBY_PROBE_ENABLED())
+			RUBY_RUBY_PROBE(end_probe, probe_data);
+		
