aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-16 03:16:05 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-16 03:16:05 +0000
commit53f97f1c278d2ea22a614682cd47c3ac61e57ef5 (patch)
tree9a875dca9627b91b989c6f803e44bd81601f3c89
parent733d65df5e0ca8e415dd87caeb881e074d64f8ee (diff)
downloadruby-53f97f1c278d2ea22a614682cd47c3ac61e57ef5.tar.gz
* parse.y: add dtrace probe for symbol create.
* probes.d: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--parse.y5
-rw-r--r--probes.d11
3 files changed, 22 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8802572325..f6a0cce829 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Feb 16 12:15:20 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * parse.y: add dtrace probe for symbol create.
+
+ * probes.d: ditto
+
Sat Feb 16 09:27:37 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/extconf.rb: don't test sys/feature_tests.h which is not
diff --git a/parse.y b/parse.y
index 2e81b66ab2..66ed654c38 100644
--- a/parse.y
+++ b/parse.y
@@ -10130,6 +10130,11 @@ static ID
register_symid_str(ID id, VALUE str)
{
OBJ_FREEZE(str);
+
+ if (RUBY_DTRACE_SYMBOL_CREATE_ENABLED()) {
+ RUBY_DTRACE_SYMBOL_CREATE(RSTRING_PTR(str), rb_sourcefile(), rb_sourceline());
+ }
+
st_add_direct(global_symbols.sym_id, (st_data_t)str, id);
st_add_direct(global_symbols.id_str, id, (st_data_t)str);
return id;
diff --git a/probes.d b/probes.d
index 31aef37854..b34764edca 100644
--- a/probes.d
+++ b/probes.d
@@ -151,6 +151,17 @@ provider ruby {
probe string__create(long, const char *, int);
/*
+ ruby:::symbol-create(string, filename, lineno);
+
+ This probe is fired when a Symbol is about to be allocated.
+
+ * `string` the contents of the symbol (string)
+ * `filename` the name of the file where the string is allocated (string)
+ * `lineno` the line number in the file where the string is allocated (int)
+ */
+ probe symbol__create(const char *, const char *, int);
+
+ /*
ruby:::parse-begin(sourcefile, lineno);
Fired just before parsing and compiling a source file.