Skip to content

Commit

Permalink
Adding enabled? method on Tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Hanrigou committed Apr 21, 2008
1 parent 37d38ad commit 134af0d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion patch-for-dtrace-instrumentation-of-matz-1.8.6-p114.diff
Expand Up @@ -131,7 +131,7 @@ Index: tracer.c
===================================================================
--- tracer.c (revision 0)
+++ tracer.c (revision 0)
@@ -0,0 +1,62 @@
@@ -0,0 +1,73 @@
+#include "ruby.h"
+
+#ifdef ENABLE_DTRACE
Expand Down Expand Up @@ -188,11 +188,22 @@ Index: tracer.c
+ return ret;
+}
+
+static VALUE
+ruby_dtrace_enabled(klass)
+ VALUE klass;
+{
+#ifdef ENABLE_DTRACE
+ return RUBY_RUBY_PROBE_ENABLED() ? Qtrue : Qfalse;
+#else
+ return Qfalse;
+#endif
+}
+
+void Init_Tracer()
+{
+ rb_mDtrace = rb_define_module("Tracer");
+ rb_define_module_function(rb_mDtrace, "fire", ruby_dtrace_fire, -1);
+ rb_define_module_function(rb_mDtrace, "enabled?", ruby_dtrace_enabled, 0);
+}
Index: dtrace.d
===================================================================
Expand Down

0 comments on commit 134af0d

Please sign in to comment.