[前][次][番号順一覧][スレッド一覧]

ruby-changes:25574

From: tenderlove <ko1@a...>
Date: Tue, 13 Nov 2012 06:52:45 +0900 (JST)
Subject: [ruby-changes:25574] tenderlove:r37631 (trunk): * probes.d: add DTrace probe declarations.

tenderlove	2012-11-13 06:52:12 +0900 (Tue, 13 Nov 2012)

  New Revision: 37631

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37631

  Log:
    * probes.d: add DTrace probe declarations. [ruby-core:27448]
    
    * array.c (empty_ary_alloc, ary_new): added array create DTrace probe.
    
    * compile.c (rb_insns_name): allowing DTrace probes to access
      instruction sequence name.
    
    * Makefile.in: translate probes.d file to appropriate header file.
    
    * common.mk: declare dependencies on the DTrace header.
    
    * configure.in: add a test for existence of DTrace.
    
    * eval.c (setup_exception): add a probe for when an exception is
      raised.
    
    * gc.c: Add DTrace probes for mark begin and end, and sweep begin and
      end.
    
    * hash.c (empty_hash_alloc): Add a probe for hash allocation.
    
    * insns.def: Add probes for function entry and return.
    
    * internal.h: function declaration for compile.c change.
    
    * load.c (rb_f_load): add probes for `load` entry and exit, require
      entry and exit, and wrapping search_required for load path search.
    
    * object.c (rb_obj_alloc): added a probe for general object creation.
    
    * parse.y (yycompile0): added a probe around parse and compile phase.
    
    * string.c (empty_str_alloc, str_new): DTrace probes for string
      allocation.
    
    * test/dtrace/*: tests for DTrace probes.
    
    * vm.c (vm_invoke_proc): add probes for function return on exception
      raise, hash create, and instruction sequence execution.
    
    * vm_core.h: add probe declarations for function entry and exit.
    
    * vm_dump.c: add probes header file.
    
    * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
      function entry and return.
    
    * vm_exec.c: expose instruction number to instruction name function.
    
    * vm_insnshelper.c: add function entry and exit probes for cfunc
      methods.
    
    * vm_insnhelper.h: vm usage information is always collected, so
      uncomment the functions.
    
    12 19:14:50 2012  Akinori MUSHA  <knu@i...>
    
    * configure.in (isinf, isnan): isinf() and isnan() are macros on
      DragonFly which cannot be found by AC_REPLACE_FUNCS().  This
      workaround enforces the fact that they exist on DragonFly.
    
    12 15:59:38 2012  Shugo Maeda  <shugo@r...>
    
    * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
      vm_insnhelper.c (vm_search_method): revert r37616 because it's too
      slow.  [ruby-dev:46477]
    
    * test/ruby/test_refinement.rb (test_inline_method_cache): skip
      the test until the bug is fixed efficiently.

  Added directories:
    trunk/test/dtrace/
  Added files:
    trunk/probes.d
    trunk/test/dtrace/dummy.rb
    trunk/test/dtrace/helper.rb
    trunk/test/dtrace/test_array_create.rb
    trunk/test/dtrace/test_function_entry.rb
    trunk/test/dtrace/test_gc.rb
    trunk/test/dtrace/test_hash_create.rb
    trunk/test/dtrace/test_load.rb
    trunk/test/dtrace/test_object_create_start.rb
    trunk/test/dtrace/test_raise.rb
    trunk/test/dtrace/test_require.rb
    trunk/test/dtrace/test_singleton_function.rb
    trunk/test/dtrace/test_string.rb
    trunk/tool/gen_dummy_probes.sed
  Modified files:
    trunk/.gitignore
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/array.c
    trunk/common.mk
    trunk/compile.c
    trunk/configure.in
    trunk/eval.c
    trunk/gc.c
    trunk/hash.c
    trunk/insns.def
    trunk/internal.h
    trunk/load.c
    trunk/object.c
    trunk/parse.y
    trunk/string.c
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_dump.c
    trunk/vm_eval.c
    trunk/vm_exec.c
    trunk/vm_insnhelper.c
    trunk/vm_insnhelper.h

Index: array.c
===================================================================
--- array.c	(revision 37630)
+++ array.c	(revision 37631)
@@ -16,6 +16,7 @@
 #include "ruby/st.h"
 #include "ruby/encoding.h"
 #include "internal.h"
+#include "probes.h"
 
 #ifndef ARRAY_DEBUG
 # define NDEBUG
@@ -373,6 +374,16 @@
 }
 
 static VALUE
+empty_ary_alloc(VALUE klass)
+{
+    if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+	RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
+    }
+
+    return ary_alloc(klass);
+}
+
+static VALUE
 ary_new(VALUE klass, long capa)
 {
     VALUE ary;
@@ -383,6 +394,11 @@
     if (capa > ARY_MAX_SIZE) {
 	rb_raise(rb_eArgError, "array size too big");
     }
+
+    if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+	RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
+    }
+
     ary = ary_alloc(klass);
     if (capa > RARRAY_EMBED_LEN_MAX) {
         FL_UNSET_EMBED(ary);
@@ -5282,7 +5298,7 @@
     rb_cArray  = rb_define_class("Array", rb_cObject);
     rb_include_module(rb_cArray, rb_mEnumerable);
 
-    rb_define_alloc_func(rb_cArray, ary_alloc);
+    rb_define_alloc_func(rb_cArray, empty_ary_alloc);
     rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1);
     rb_define_singleton_method(rb_cArray, "try_convert", rb_ary_s_try_convert, 1);
     rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1);
Index: configure.in
===================================================================
--- configure.in	(revision 37630)
+++ configure.in	(revision 37631)
@@ -372,6 +372,9 @@
 if test x"${build}" != x"${host}"; then
   AC_CHECK_TOOL(CC, gcc)
 fi
+
+AC_CHECK_TOOL(DTRACE, dtrace)
+
 AC_PROG_CC
 AC_PROG_CXX
 RUBY_MINGW32
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37630)
+++ ChangeLog	(revision 37631)
@@ -1,3 +1,60 @@
+Tue Nov 13 06:50:02 2012  Aaron Patterson <aaron@t...>
+
+	* probes.d: add DTrace probe declarations. [ruby-core:27448]
+
+	* array.c (empty_ary_alloc, ary_new): added array create DTrace probe.
+
+	* compile.c (rb_insns_name): allowing DTrace probes to access
+	  instruction sequence name.
+
+	* Makefile.in: translate probes.d file to appropriate header file.
+
+	* common.mk: declare dependencies on the DTrace header.
+
+	* configure.in: add a test for existence of DTrace.
+
+	* eval.c (setup_exception): add a probe for when an exception is
+	  raised.
+	
+	* gc.c: Add DTrace probes for mark begin and end, and sweep begin and
+	  end.
+	
+	* hash.c (empty_hash_alloc): Add a probe for hash allocation.
+
+	* insns.def: Add probes for function entry and return.
+
+	* internal.h: function declaration for compile.c change.
+
+	* load.c (rb_f_load): add probes for `load` entry and exit, require
+	  entry and exit, and wrapping search_required for load path search.
+
+	* object.c (rb_obj_alloc): added a probe for general object creation.
+
+	* parse.y (yycompile0): added a probe around parse and compile phase.
+
+	* string.c (empty_str_alloc, str_new): DTrace probes for string
+	  allocation.
+
+	* test/dtrace/*: tests for DTrace probes.
+
+	* vm.c (vm_invoke_proc): add probes for function return on exception
+	  raise, hash create, and instruction sequence execution.
+
+	* vm_core.h: add probe declarations for function entry and exit.
+
+	* vm_dump.c: add probes header file.
+
+	* vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
+	  function entry and return.
+	
+	* vm_exec.c: expose instruction number to instruction name function.
+
+	* vm_insnshelper.c: add function entry and exit probes for cfunc
+	  methods.
+	
+	* vm_insnhelper.h: vm usage information is always collected, so
+	  uncomment the functions.
+
 Mon Nov 12 19:14:50 2012  Akinori MUSHA  <knu@i...>
 
 	* configure.in (isinf, isnan): isinf() and isnan() are macros on
Index: insns.def
===================================================================
--- insns.def	(revision 37630)
+++ insns.def	(revision 37631)
@@ -524,6 +524,11 @@
 (VALUE val) // inc += 1 - num;
 {
     rb_num_t i;
+
+    if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
+	RUBY_DTRACE_HASH_CREATE(num, rb_sourcefile(), rb_sourceline());
+    }
+
     val = rb_hash_new();
 
     for (i = num; i > 0; i -= 2) {
@@ -838,6 +843,34 @@
 {
     rb_event_flag_t flag = (rb_event_flag_t)nf;
 
+    if (RUBY_DTRACE_FUNCTION_ENTRY_ENABLED()) {
+        if (flag == RUBY_EVENT_CALL || flag == RUBY_EVENT_C_CALL) {
+          VALUE klass;
+          ID called_id;
+
+          rb_thread_method_id_and_class(th, &called_id, &klass);
+
+          RUBY_DTRACE_FUNCTION_ENTRY(
+                  RSTRING_PTR(rb_inspect(klass)),
+                  rb_id2name(called_id),
+                  rb_sourcefile(),
+                  rb_sourceline());
+        }
+    }
+    if (RUBY_DTRACE_FUNCTION_RETURN_ENABLED()) {
+        if (flag == RUBY_EVENT_RETURN || flag == RUBY_EVENT_C_RETURN) {
+          VALUE klass;
+          ID called_id;
+
+          rb_thread_method_id_and_class(th, &called_id, &klass);
+
+          RUBY_DTRACE_FUNCTION_RETURN(
+                  RSTRING_PTR(rb_inspect(klass)),
+                  rb_id2name(called_id),
+                  rb_sourcefile(),
+                  rb_sourceline());
+        }
+    }
     EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */);
 }
 
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 37630)
+++ vm_core.h	(revision 37631)
@@ -23,6 +23,7 @@
 #include "id.h"
 #include "method.h"
 #include "ruby_atomic.h"
+#include "probes.h"
 
 #if   defined(_WIN32)
 #include "thread_win32.h"
@@ -898,6 +899,35 @@
     } \
 } while (0)
 
+#define RUBY_DTRACE_FUNC_ENTRY_HOOK(klass, id) \
+    if (RUBY_DTRACE_FUNCTION_ENTRY_ENABLED()) { \
+	const char * classname  = rb_class2name((klass)); \
+	const char * methodname = rb_id2name((id)); \
+	const char * filename   = rb_sourcefile(); \
+	if (classname && methodname && filename) { \
+	    RUBY_DTRACE_FUNCTION_ENTRY( \
+		    classname, \
+		    methodname, \
+		    filename, \
+		    rb_sourceline()); \
+	} \
+    } \
+
+#define RUBY_DTRACE_FUNC_RETURN_HOOK(klass, id) \
+    if (RUBY_DTRACE_FUNCTION_RETURN_ENABLED()) { \
+	const char * classname  = rb_class2name((klass)); \
+	const char * methodname = rb_id2name((id)); \
+	const char * filename   = rb_sourcefile(); \
+	if (classname && methodname && filename) { \
+	    RUBY_DTRACE_FUNCTION_RETURN( \
+		    classname, \
+		    methodname, \
+		    filename, \
+		    rb_sourceline()); \
+	} \
+    } \
+
+
 #if defined __GNUC__ && __GNUC__ >= 4
 #pragma GCC visibility push(default)
 #endif
Index: string.c
===================================================================
--- string.c	(revision 37630)
+++ string.c	(revision 37631)
@@ -17,6 +17,7 @@
 #include "node.h"
 #include "eval_intern.h"
 #include "internal.h"
+#include "probes.h"
 #include <assert.h>
 
 #define BEG(no) (regs->beg[(no)])
@@ -381,6 +382,15 @@
     return (VALUE)str;
 }
 
+static inline VALUE
+empty_str_alloc(VALUE klass)
+{
+    if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
+	RUBY_DTRACE_STRING_CREATE(0, rb_sourcefile(), rb_sourceline());
+    }
+    return str_alloc(klass);
+}
+
 static VALUE
 str_new(VALUE klass, const char *ptr, long len)
 {
@@ -390,6 +400,10 @@
 	rb_raise(rb_eArgError, "negative string size (or size too big)");
     }
 
+    if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
+	RUBY_DTRACE_STRING_CREATE(len, rb_sourcefile(), rb_sourceline());
+    }
+
     str = str_alloc(klass);
     if (len > RSTRING_EMBED_LEN_MAX) {
 	RSTRING(str)->as.heap.aux.capa = len;
@@ -918,6 +932,10 @@
 VALUE
 rb_str_resurrect(VALUE str)
 {
+    if(RUBY_DTRACE_STRING_CREATE_ENABLED()) {
+	RUBY_DTRACE_STRING_CREATE(
+            RSTRING_LEN(str), rb_sourcefile(), rb_sourceline());
+    }
     return str_replace(str_alloc(rb_cString), str);
 }
 
@@ -7920,7 +7938,7 @@
 
     rb_cString  = rb_define_class("String", rb_cObject);
     rb_include_module(rb_cString, rb_mComparable);
-    rb_define_alloc_func(rb_cString, str_alloc);
+    rb_define_alloc_func(rb_cString, empty_str_alloc);
     rb_define_singleton_method(rb_cString, "try_convert", rb_str_s_try_convert, 1);
     rb_define_method(rb_cString, "initialize", rb_str_init, -1);
     rb_define_method(rb_cString, "initialize_copy", rb_str_replace, 1);
Index: object.c
===================================================================
--- object.c	(revision 37630)
+++ object.c	(revision 37631)
@@ -22,6 +22,7 @@
 #include <float.h>
 #include "constant.h"
 #include "internal.h"
+#include "probes.h"
 
 VALUE rb_cBasicObject;
 VALUE rb_mKernel;
@@ -1685,7 +1686,15 @@
 		 klass);
     }
 
+    if (RUBY_DTRACE_OBJECT_CREATE_ENABLED()) {
+        const char * file = rb_sourcefile();
+        RUBY_DTRACE_OBJECT_CREATE(rb_class2name(klass),
+                                 file ? file : "",
+                                 rb_sourceline());
+    }
+
     obj = (*allocator)(klass);
+
     if (rb_obj_class(obj) != rb_class_real(klass)) {
 	rb_raise(rb_eTypeError, "wrong instance allocation");
     }
Index: load.c
===================================================================
--- load.c	(revision 37630)
+++ load.c	(revision 37631)
@@ -7,6 +7,7 @@
 #include "internal.h"
 #include "dln.h"
 #include "eval_intern.h"
+#include "probes.h"
 
 VALUE ruby_dln_librefs;
 
@@ -621,6 +622,14 @@
     VALUE fname, wrap, path;
 
     rb_scan_args(argc, argv, "11", &fname, &wrap);
+
+    if(RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
+      RUBY_DTRACE_LOAD_ENTRY(
+          StringValuePtr(fname),
+          rb_sourcefile(),
+          rb_sourceline());
+    }
+
     path = rb_find_file(FilePathValue(fname));
     if (!path) {
 	if (!rb_file_load_ok(RSTRING_PTR(fname)))
@@ -628,6 +637,11 @@
 	path = fname;
     }
     rb_load_internal(path, RTEST(wrap));
+
+    if(RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
+      RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname));
+    }
+
     return Qtrue;
 }
 
@@ -861,6 +875,13 @@
     } volatile saved;
     char *volatile ftptr = 0;
 
+    if(RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
+      RUBY_DTRACE_REQUIRE_ENTRY(
+          StringValuePtr(fname),
+          rb_sourcefile(),
+          rb_sourceline());
+    }
+
     PUSH_TAG();
     saved.safe = rb_safe_level();
     if ((state = EXEC_TAG()) == 0) {
@@ -871,7 +892,22 @@
 	rb_set_safe_level_force(safe);
 	FilePathValue(fname);
 	rb_set_safe_level_force(0);
+
+	if(RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
+	    RUBY_DTRACE_FIND_REQUIRE_ENTRY(
+		    StringValuePtr(fname),
+		    rb_sourcefile(),
+		    rb_sourceline());
+	}
+
 	found = search_required(fname, &path, safe);
+
+	if(RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
+	    RUBY_DTRACE_FIND_REQUIRE_RETURN(
+		    StringValuePtr(fname),
+		    rb_sourcefile(),
+		    rb_sourceline());
+	}
 	if (found) {
 	    if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
 		result = Qfalse;
@@ -907,6 +943,10 @@
 
     th->errinfo = errinfo;
 
+    if(RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
+      RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname));
+    }
+
     return result;
 }
 
Index: compile.c
===================================================================
--- compile.c	(revision 37630)
+++ compile.c	(revision 37631)
@@ -5348,6 +5348,12 @@
     printf("---------------------\n");
 }
 
+const char *
+rb_insns_name(int i)
+{
+    return insn_name_info[i];
+}
+
 VALUE
 rb_insns_name_array(void)
 {
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 37630)
+++ vm_eval.c	(revision 37631)
@@ -55,6 +55,7 @@
 {
     VALUE val;
 
+    RUBY_DTRACE_FUNC_ENTRY_HOOK(ci->defined_class, ci->mid);
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, ci->recv, ci->mid, ci->defined_class);
     {
 	rb_control_frame_t *reg_cfp = th->cfp;
@@ -84,6 +85,7 @@
 	}
     }
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, ci->recv, ci->mid, ci->defined_class);
+    RUBY_DTRACE_FUNC_RETURN_HOOK(ci->defined_class, ci->mid);
 
     return val;
 }
@@ -93,6 +95,7 @@
 {
     VALUE val;
 
+    RUBY_DTRACE_FUNC_ENTRY_HOOK(ci->defined_class, ci->mid);
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, ci->recv, ci->mid, ci->defined_class);
     {
 	rb_control_frame_t *reg_cfp = th->cfp;
@@ -116,6 +119,7 @@
 	vm_pop_frame(th);
     }
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, ci->recv, ci->mid, ci->defined_class);
+    RUBY_DTRACE_FUNC_RETURN_HOOK(ci->defined_class, ci->mid);
 
     return val;
 }
@@ -1007,6 +1011,7 @@
 		    if (UNLIKELY(VM_FRAME_TYPE(th->cfp) == VM_FRAME_MAGIC_CFUNC)) {
 			const rb_method_entry_t *me = th->cfp->me;
 			EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, th->cfp->self, me->called_id, me->klass);
+			RUBY_DTRACE_FUNC_RETURN_HOOK(me->klass, me->called_id);
 		    }
 
 		    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
Index: probes.d
===================================================================
--- probes.d	(revision 0)
+++ probes.d	(revision 37631)
@@ -0,0 +1,37 @@
+provider ruby {
+  probe function__entry(const char *, const char *, const char *, int);
+  probe function__return(const char *, const char *, const char *, int);
+
+  probe require__entry(const char *, const char *, int);
+  probe require__return(const char *);
+
+  probe find__require__entry(const char *, const char *, int);
+  probe find__require__return(const char *, const char *, int);
+
+  probe load__entry(const char *, const char *, int);
+  probe load__return(const char *);
+
+  probe raise(const char *, const char *, int);
+
+  probe object__create(const char *, const char *, int);
+  probe array__create(long, const char *, int);
+  probe hash__create(long, const char *, int);
+  probe string__create(long, const char *, int);
+
+  probe parse__begin(const char *, int);
+  probe parse__end(const char *, int);
+
+  probe insn(const char *);
+  probe insn__operand(const char *, const char *);
+
+  probe gc__mark__begin();
+  probe gc__mark__end();
+  probe gc__sweep__begin();
+  probe gc__sweep__end();
+};
+
+#pragma D attributes Stable/Evolving/Common provider ruby provider
+#pragma D attributes Stable/Evolving/Common provider ruby module
+#pragma D attributes Stable/Evolving/Common provider ruby function
+#pragma D attributes Evolving/Evolving/Common provider ruby name
+#pragma D attributes Evolving/Evolving/Common provider ruby args
Index: common.mk
===================================================================
--- common.mk	(revision 37630)
+++ common.mk	(revision 37631)
@@ -2,7 +2,7 @@
 lib: $(LIBRUBY)
 dll: $(LIBRUBY_SO)
 
-.SUFFIXES: .inc .h .c .y .i
+.SUFFIXES: .inc .h .c .y .i .d
 
 # V=0 quiet, V=1 verbose.  other values don't work.
 V = 0
@@ -609,13 +609,14 @@
 		     {$(VPATH)}subst.h
 ENCODING_H_INCLUDES= {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h
 ID_H_INCLUDES      = {$(VPATH)}id.h
+PROBES_H_INCLUDES  = {$(VPATH)}probes.h
 VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \
 		     {$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}ruby_atomic.h \
-		     $(ID_H_INCLUDES)
+		     $(ID_H_INCLUDES) $(PROBES_H_INCLUDES)
 
 addr2line.$(OBJEXT): {$(VPATH)}addr2line.c {$(VPATH)}addr2line.h {$(VPATH)}config.h
 array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
-  $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
+  $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
 bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
   {$(VPATH)}thread.h {$(VPATH)}internal.h
 class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) \
@@ -648,11 +649,11 @@
 eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_intern.h {$(VPATH)}vm.h \
   $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_error.c \
   {$(VPATH)}eval_jump.c {$(VPATH)}debug.h {$(VPATH)}gc.h {$(VPATH)}iseq.h \
-  $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
+  $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
 load.$(OBJEXT): {$(VPATH)}load.c {$(VPATH)}eval_intern.h \
   {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
   {$(VPATH)}dln.h {$(VPATH)}debug.h \
-  {$(VPATH)}internal.h
+  {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
 file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
   $(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}dln.h \
   {$(VPATH)}internal.h
@@ -660,9 +661,9 @@
   {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
   {$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
   {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h \
-  {$(VPATH)}thread.h
+  {$(VPATH)}thread.h $(PROBES_H_INCLUDES)
 hash.$(OBJEXT): {$(VPATH)}hash.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
-  $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
+  $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
 inits.$(OBJEXT): {$(VPATH)}inits.c $(RUBY_H_INCLUDES) \
   {$(VPATH)}internal.h
 io.$(OBJEXT): {$(VPATH)}io.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
@@ -679,7 +680,7 @@
 numeric.$(OBJEXT): {$(VPATH)}numeric.c $(RUBY_H_INCLUDES) \
   {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
 object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
-  {$(VPATH)}internal.h {$(VPATH)}constant.h $(ENCODING_H_INCLUDES)
+  {$(VPATH)}internal.h {$(VPATH)}constant.h $(ENCODING_H_INCLUDES) $(PROBES_H_INCLUDES)
 pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES) {$(VPATH)}encoding.h \
   {$(VPATH)}oniguruma.h
 parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
@@ -730,7 +731,7 @@
 strftime.$(OBJEXT): {$(VPATH)}strftime.c $(RUBY_H_INCLUDES) \
   {$(VPATH)}timev.h $(ENCODING_H_INCLUDES)
 string.$(OBJEXT): {$(VPATH)}string.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
-  {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
+  {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
 struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
 thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
   $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
@@ -761,13 +762,14 @@
 iseq.$(OBJEXT): {$(VPATH)}iseq.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
   $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
   {$(VPATH)}insns_info.inc {$(VPATH)}node_name.inc {$(VPATH)}debug.h {$(VPATH)}internal.h
+{$(VPATH)}vm_insnhelper.c:$(PROBES_H_INCLUDES)
 vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
   {$(VPATH)}eval_intern.h $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
   $(VM_CORE_H_INCLUDES) {$(VPATH)}vm_method.c {$(VPATH)}vm_eval.c \
   {$(VPATH)}vm_insnhelper.c {$(VPATH)}vm_insnhelper.h {$(VPATH)}vm_exec.c \
   {$(VPATH)}vm_exec.h {$(VPATH)}insns.def {$(VPATH)}vmtc.inc \
   {$(VPATH)}vm.inc {$(VPATH)}insns.inc {$(VPATH)}debug.h \
-  {$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h
+  {$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h $(PROBES_H_INCLUDES)
 vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
   $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}addr2line.h \
   {$(VPATH)}internal.h
Index: eval.c
===================================================================
--- eval.c	(revision 37630)
+++ eval.c	(revision 37631)
@@ -18,6 +18,7 @@
 #include "ruby/encoding.h"
 #include "internal.h"
 #include "vm_core.h"
+#include "probes.h"
 
 #define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
 
@@ -499,6 +500,11 @@
     }
 
     if (tag != TAG_FATAL) {
+	if(RUBY_DTRACE_RAISE_ENABLED()) {
+	    RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
+		    rb_sourcefile(),
+		    rb_sourceline());
+	}
 	EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0);
     }
 }
Index: gc.c
===================================================================
--- gc.c	(revision 37630)
+++ gc.c	(revision 37631)
@@ -23,6 +23,7 @@
 #include "gc.h"
 #include "constant.h"
 #include "ruby_atomic.h"
+#include "probes.h"
 #include <stdio.h>
 #include <setjmp.h>
 #include <sys/types.h>
@@ -120,7 +121,6 @@
 #endif
 } gc_profile_record;
 
-
 #if defined(_MSC (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]