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

ruby-changes:25579

From: naruse <ko1@a...>
Date: Tue, 13 Nov 2012 15:13:49 +0900 (JST)
Subject: [ruby-changes:25579] naruse:r37636 (trunk): Fix dtrace commit r37631, it is [Feature #2565]

naruse	2012-11-13 15:13:39 +0900 (Tue, 13 Nov 2012)

  New Revision: 37636

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

  Log:
    Fix dtrace commit r37631, it is [Feature #2565]
    
    * configure.in: disable dtrace because it doesn't work on FreeBSD.
    
    * common.mk (clean-local): rm probes.h.
    
    * common.mk (parse.o): depend $(PROBES_H_INCLUDES).
    
    * common.mk (.d.h): moved from Makefile.in and use BASERUBY.
    
    * tool/gen_dummy_probes.rb: reimplemented with ruby because sed is not
      available on Windows Microsoft VC++ environment.

  Added files:
    trunk/tool/gen_dummy_probes.rb
  Removed files:
    trunk/tool/gen_dummy_probes.sed
  Modified files:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/common.mk
    trunk/configure.in

Index: configure.in
===================================================================
--- configure.in	(revision 37635)
+++ configure.in	(revision 37636)
@@ -374,6 +374,9 @@
 fi
 
 AC_CHECK_TOOL(DTRACE, dtrace)
+AS_CASE(["$target_os"],
+[freebsd*], [DTRACE=]
+)
 
 AC_PROG_CC
 AC_PROG_CXX
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37635)
+++ ChangeLog	(revision 37636)
@@ -1,3 +1,18 @@
+Tue Nov 13 12:27:11 2012  NARUSE, Yui  <naruse@r...>
+
+	* configure.in: disable dtrace because it doesn't work on FreeBSD.
+
+	* common.mk (clean-local): rm probes.h.
+
+	* common.mk (parse.o): depend $(PROBES_H_INCLUDES).
+
+	* common.mk (.d.h): moved from Makefile.in and use BASERUBY.
+
+	* tool/gen_dummy_probes.rb: reimplemented with ruby because sed is not
+	  available on Windows Microsoft VC++ environment.
+
+Tue Nov 13 06:50:02 2012  Aaron Patterson <aaron@t...>
+
 Tue Nov 13 12:30:26 2012  NAKAMURA Usaku  <usa@r...>
 
 	* win32/README.win32: added mention about build directory.  currently
@@ -28,10 +43,10 @@
 
 	* 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.
@@ -59,12 +74,12 @@
 
 	* 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.
 
Index: common.mk
===================================================================
--- common.mk	(revision 37635)
+++ common.mk	(revision 37636)
@@ -435,7 +435,7 @@
 clean-local:: PHONY
 	$(Q)$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
 	$(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
-	$(Q)$(RM) y.tab.c y.output encdb.h transdb.h prelude.c config.log rbconfig.rb $(ruby_pc)
+	$(Q)$(RM) y.tab.c y.output encdb.h transdb.h prelude.c config.log rbconfig.rb $(ruby_pc) probes.h
 clean-ext:: PHONY
 clean-golf: PHONY
 	$(Q)$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
@@ -614,6 +614,16 @@
 		     {$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}ruby_atomic.h \
 		     $(ID_H_INCLUDES) $(PROBES_H_INCLUDES)
 
+.d.h:
+	@$(ECHO) translating probes $<
+	$(Q)if test -n '$(DTRACE)'; then\
+	  $(DTRACE) -o $@.tmp -h -s $<; \
+	  sed -e 's/RUBY_/RUBY_DTRACE_/g' $@.tmp | sed -e 's/PROBES_H_TMP/PROBES_H/g' >$@; \
+	  $(RM) $@.tmp; \
+	else \
+	  $(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $< > $@; \
+	fi
+
 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 $(PROBES_H_INCLUDES)
@@ -688,7 +698,7 @@
   {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c \
   {$(VPATH)}defs/keywords {$(VPATH)}id.c {$(VPATH)}parse.y \
   {$(VPATH)}parse.h {$(VPATH)}vm_opts.h \
-  {$(VPATH)}internal.h
+  {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
 proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
   $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
   {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}iseq.h
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 37635)
+++ Makefile.in	(revision 37636)
@@ -321,16 +321,6 @@
 	@$(ECHO) preprocessing $<
 	$(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
 
-.d.h:
-	@$(ECHO) translating probes $<
-	$(Q)if test -n '$(DTRACE)'; then\
-	  $(DTRACE) -o $@.tmp -h -s $<; \
-	  sed -e 's/RUBY_/RUBY_DTRACE_/g' $@.tmp | sed -e 's/PROBES_H_TMP/PROBES_H/g' >$@; \
-	  rm $@.tmp; \
-	else \
-	  sed -f $(srcdir)/tool/gen_dummy_probes.sed $< > $@; \
-	fi
-
 clean-local::
 	$(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
 		enc/encinit.c enc/encinit.$(OBJEXT)
Index: tool/gen_dummy_probes.sed
===================================================================
--- tool/gen_dummy_probes.sed	(revision 37635)
+++ tool/gen_dummy_probes.sed	(revision 37636)
@@ -1,24 +0,0 @@
-
-# upper case everything
-y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
-
-# remove the pragma declarations
-s/^#PRAGMA.*$//
-
-# replace the provider section with the start of the header file
-s/PROVIDER RUBY {/#ifndef	_PROBES_H\
-#define	_PROBES_H/
-
-# finish up the #ifndef sandwich
-s/};/#endif	\/* _PROBES_H *\//
-
-s/__/_/g
-
-s/([^,)]\{1,\})/(arg0)/
-s/([^,)]\{1,\},[^,)]\{1,\})/(arg0, arg1)/
-s/([^,)]\{1,\},[^,)]\{1,\},[^,)]\{1,\})/(arg0, arg1, arg2)/
-s/([^,)]\{1,\},[^,)]\{1,\},[^,)]\{1,\},[^,)]\{1,\})/(arg0, arg1, arg2, arg3)/
-s/([^,)]\{1,\},[^,)]\{1,\},[^,)]\{1,\},[^,)]\{1,\},[^,)]\{1,\})/(arg0, arg1, arg2, arg3, arg4)/
-
-s/[ ]*PROBE[ ]\([^\(]*\)\(([^\)]*)\);/#define RUBY_DTRACE_\1_ENABLED() 0\
-#define RUBY_DTRACE_\1\2\ do \{ \} while\(0\)/
Index: tool/gen_dummy_probes.rb
===================================================================
--- tool/gen_dummy_probes.rb	(revision 0)
+++ tool/gen_dummy_probes.rb	(revision 37636)
@@ -0,0 +1,24 @@
+#!/usr/bin/ruby
+
+text = ARGF.read
+text.upcase!
+
+# remove the pragma declarations
+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")
+
+# finish up the #ifndef sandwich
+text.gsub!(/\};/, "#endif\t/* _PROBES_H */")
+
+text.gsub!(/__/, '_')
+
+text.gsub!(/\([^,)]+\)/, '(arg0)')
+text.gsub!(/\([^,)]+,[^,)]+\)/, '(arg0, arg1)')
+text.gsub!(/\([^,)]+,[^,)]+,[^,)]+\)/, '(arg0, arg1, arg2)')
+text.gsub!(/\([^,)]+,[^,)]+,[^,)]+,[^,)]+\)/, '(arg0, arg1, arg2, arg3)')
+text.gsub!(/\([^,)]+,[^,)]+,[^,)]+,[^,)]+,[^,)]+\)/, '(arg0, arg1, arg2, arg3, arg4)')
+
+text.gsub!(/ *PROBE ([^\(]*)(\([^\)]*\));/, "#define RUBY_DTRACE_\\1_ENABLED() 0\n#define RUBY_DTRACE_\\1\\2\ do \{ \} while\(0\)")
+print text

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

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