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

ruby-changes:27214

From: tenderlove <ko1@a...>
Date: Sat, 16 Feb 2013 12:21:04 +0900 (JST)
Subject: [ruby-changes:27214] tenderlove:r39266 (trunk): * parse.y: add dtrace probe for symbol create.

tenderlove	2013-02-16 12:16:05 +0900 (Sat, 16 Feb 2013)

  New Revision: 39266

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

  Log:
    * parse.y: add dtrace probe for symbol create.
    
    * probes.d: ditto

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
    trunk/probes.d

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39265)
+++ ChangeLog	(revision 39266)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Feb 16 12:15:20 2013  Aaron Patterson <aaron@t...>
+
+	* parse.y: add dtrace probe for symbol create.
+
+	* probes.d: ditto
+
 Sat Feb 16 09:27:37 2013  Tanaka Akira  <akr@f...>
 
 	* ext/socket/extconf.rb: don't test sys/feature_tests.h which is not
Index: probes.d
===================================================================
--- probes.d	(revision 39265)
+++ probes.d	(revision 39266)
@@ -151,6 +151,17 @@ provider ruby { https://github.com/ruby/ruby/blob/trunk/probes.d#L151
   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.
Index: parse.y
===================================================================
--- parse.y	(revision 39265)
+++ parse.y	(revision 39266)
@@ -10130,6 +10130,11 @@ static ID https://github.com/ruby/ruby/blob/trunk/parse.y#L10130
 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;

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

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