summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--object.c2
-rwxr-xr-x[-rw-r--r--]tool/gen_dummy_probes.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/object.c b/object.c
index 0b7c1bc441..f515d48ac6 100644
--- a/object.c
+++ b/object.c
@@ -1686,12 +1686,14 @@ rb_obj_alloc(VALUE klass)
klass);
}
+#if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED
if (RUBY_DTRACE_OBJECT_CREATE_ENABLED()) {
const char * file = rb_sourcefile();
RUBY_DTRACE_OBJECT_CREATE(rb_class2name(klass),
file ? file : "",
rb_sourceline());
}
+#endif
obj = (*allocator)(klass);
diff --git a/tool/gen_dummy_probes.rb b/tool/gen_dummy_probes.rb
index 88ad2ca5bf..e7efbd6822 100644..100755
--- a/tool/gen_dummy_probes.rb
+++ b/tool/gen_dummy_probes.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
+# -*- coding: us-ascii -*-
text = ARGF.read
text.upcase!
@@ -7,7 +8,7 @@ text.upcase!
text.gsub!(/^#PRAGMA.*$/, '')
# replace the provider section with the start of the header file
-text.gsub!(/PROVIDER RUBY \{/, "#ifndef\t_PROBES_H\n#define\t_PROBES_H")
+text.gsub!(/PROVIDER RUBY \{/, "#ifndef\t_PROBES_H\n#define\t_PROBES_H\n#define DTRACE_PROBES_DISABLED 1\n")
# finish up the #ifndef sandwich
text.gsub!(/\};/, "#endif\t/* _PROBES_H */")