From 4d7e8b7305c392646f68a785df8f4019ec1e69c9 Mon Sep 17 00:00:00 2001 From: kosaki Date: Thu, 22 Nov 2012 08:01:49 +0000 Subject: [PATCH] * Makefile.in: run preprocessor when making probe.h * probes.d: define probe insn and insn__operand only when VM_COLLECT_USAGE_DETAILS is 1. [Bug #7370] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ Makefile.in | 2 +- probes.d | 4 ++++ vm.c | 4 ---- vm_core.h | 4 ++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a5af334d3..91114667b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Nov 22 16:58:26 2012 KOSAKI Motohiro + + * Makefile.in: run preprocessor when making probe.h + * probes.d: define probe insn and insn__operand only when + VM_COLLECT_USAGE_DETAILS is 1. [Bug #7370] + Thu Nov 22 16:20:49 2012 KOSAKI Motohiro * vm.c: Don't define vm_collect_usage_operand() and diff --git a/Makefile.in b/Makefile.in index f6ea67d196..aae4d061ba 100644 --- a/Makefile.in +++ b/Makefile.in @@ -334,7 +334,7 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd .d.h: @$(ECHO) translating probes $< - $(Q) $(DTRACE) -o $@.tmp -h -s $< + $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $< $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@ $(Q) $(RM) $@.tmp diff --git a/probes.d b/probes.d index b3e8c1be5b..16122ab330 100644 --- a/probes.d +++ b/probes.d @@ -1,3 +1,5 @@ +#include "vm_core.h" + provider ruby { probe function__entry(const char *, const char *, const char *, int); probe function__return(const char *, const char *, const char *, int); @@ -21,8 +23,10 @@ provider ruby { probe parse__begin(const char *, int); probe parse__end(const char *, int); +#if VM_COLLECT_USAGE_DETAILS probe insn(const char *); probe insn__operand(const char *, const char *); +#endif probe gc__mark__begin(); probe gc__mark__end(); diff --git a/vm.c b/vm.c index 62a16ecfad..f4ecec4d84 100644 --- a/vm.c +++ b/vm.c @@ -63,10 +63,6 @@ rb_vm_control_frame_block_ptr(rb_control_frame_t *cfp) return VM_CF_BLOCK_PTR(cfp); } -#ifndef VM_COLLECT_USAGE_DETAILS -#define VM_COLLECT_USAGE_DETAILS 0 -#endif - #if VM_COLLECT_USAGE_DETAILS static void vm_collect_usage_operand(int insn, int n, VALUE op); static void vm_collect_usage_insn(int insn); diff --git a/vm_core.h b/vm_core.h index fffaa5e986..2e85eec524 100644 --- a/vm_core.h +++ b/vm_core.h @@ -14,6 +14,10 @@ #define RUBY_VM_THREAD_MODEL 2 +#ifndef VM_COLLECT_USAGE_DETAILS +#define VM_COLLECT_USAGE_DETAILS 0 +#endif + #include "ruby/ruby.h" #include "ruby/st.h"