* vm_core.h, probes_helper.h (RUBY_DTRACE_FUNC_ENTRY_HOOK,

RUBY_DTRACE_FUNC_RETURN_HOOK): move from vm_core.h to new file
  probes_helper.h for narrowing dependency to probes.h.
* common.mk (VM_CORE_H_INCLUDES): remove dependency to probes.h.
* common.mk (vm.$(OBJEXT)): add dependency to probes_helper.h.
* vm.c, vm_insnhelper.c: include probes_helper.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ngoto 2012-11-18 16:30:10 +00:00
parent 2630ad09bd
commit 979dff3ee4
6 changed files with 49 additions and 32 deletions

View File

@ -1,3 +1,12 @@
Mon Nov 19 01:11:59 2012 Naohisa Goto <ngotogenome@gmail.com>
* vm_core.h, probes_helper.h (RUBY_DTRACE_FUNC_ENTRY_HOOK,
RUBY_DTRACE_FUNC_RETURN_HOOK): move from vm_core.h to new file
probes_helper.h for narrowing dependency to probes.h.
* common.mk (VM_CORE_H_INCLUDES): remove dependency to probes.h.
* common.mk (vm.$(OBJEXT)): add dependency to probes_helper.h.
* vm.c, vm_insnhelper.c: include probes_helper.h.
Sun Nov 18 20:46:08 2012 Tadayoshi Funaba <tadf@dotrb.org>
* bignum.c (rb_cstr_to_inum): should accept underscores of

View File

@ -612,7 +612,7 @@ ID_H_INCLUDES = {$(VPATH)}id.h
PROBES_H_INCLUDES = {$(VPATH)}probes.h
VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \
{$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}ruby_atomic.h \
$(ID_H_INCLUDES) $(PROBES_H_INCLUDES)
$(ID_H_INCLUDES)
addr2line.$(OBJEXT): {$(VPATH)}addr2line.c {$(VPATH)}addr2line.h {$(VPATH)}config.h
array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
@ -768,7 +768,8 @@ vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
{$(VPATH)}vm_insnhelper.c {$(VPATH)}vm_insnhelper.h {$(VPATH)}vm_exec.c \
{$(VPATH)}vm_exec.h {$(VPATH)}insns.def {$(VPATH)}vmtc.inc \
{$(VPATH)}vm.inc {$(VPATH)}insns.inc {$(VPATH)}debug.h \
{$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h $(PROBES_H_INCLUDES)
{$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h \
$(PROBES_H_INCLUDES) {$(VPATH)}probes_helper.h
vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
$(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}addr2line.h \
{$(VPATH)}internal.h

35
probes_helper.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef RUBY_PROBES_HELPER_H
#define RUBY_PROBES_HELPER_H
#include "ruby/ruby.h"
#include "probes.h"
#define RUBY_DTRACE_FUNC_ENTRY_HOOK(klass, id) \
if (RUBY_DTRACE_FUNCTION_ENTRY_ENABLED()) { \
const char * classname = rb_class2name((klass)); \
const char * methodname = rb_id2name((id)); \
const char * filename = rb_sourcefile(); \
if (classname && methodname && filename) { \
RUBY_DTRACE_FUNCTION_ENTRY( \
classname, \
methodname, \
filename, \
rb_sourceline()); \
} \
} \
#define RUBY_DTRACE_FUNC_RETURN_HOOK(klass, id) \
if (RUBY_DTRACE_FUNCTION_RETURN_ENABLED()) { \
const char * classname = rb_class2name((klass)); \
const char * methodname = rb_id2name((id)); \
const char * filename = rb_sourcefile(); \
if (classname && methodname && filename) { \
RUBY_DTRACE_FUNCTION_RETURN( \
classname, \
methodname, \
filename, \
rb_sourceline()); \
} \
} \
#endif /* RUBY_PROBES_HELPER_H */

1
vm.c
View File

@ -19,6 +19,7 @@
#include "iseq.h"
#include "eval_intern.h"
#include "probes.h"
#include "probes_helper.h"
static inline VALUE *
VM_EP_LEP(VALUE *ep)

View File

@ -23,7 +23,6 @@
#include "id.h"
#include "method.h"
#include "ruby_atomic.h"
#include "probes.h"
#if defined(_WIN32)
#include "thread_win32.h"
@ -899,35 +898,6 @@ rb_threadptr_exec_event_hooks(rb_thread_t *th, rb_event_flag_t flag, VALUE self,
} \
} while (0)
#define RUBY_DTRACE_FUNC_ENTRY_HOOK(klass, id) \
if (RUBY_DTRACE_FUNCTION_ENTRY_ENABLED()) { \
const char * classname = rb_class2name((klass)); \
const char * methodname = rb_id2name((id)); \
const char * filename = rb_sourcefile(); \
if (classname && methodname && filename) { \
RUBY_DTRACE_FUNCTION_ENTRY( \
classname, \
methodname, \
filename, \
rb_sourceline()); \
} \
} \
#define RUBY_DTRACE_FUNC_RETURN_HOOK(klass, id) \
if (RUBY_DTRACE_FUNCTION_RETURN_ENABLED()) { \
const char * classname = rb_class2name((klass)); \
const char * methodname = rb_id2name((id)); \
const char * filename = rb_sourcefile(); \
if (classname && methodname && filename) { \
RUBY_DTRACE_FUNCTION_RETURN( \
classname, \
methodname, \
filename, \
rb_sourceline()); \
} \
} \
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif

View File

@ -14,6 +14,7 @@
#include "constant.h"
#include "internal.h"
#include "probes.h"
#include "probes_helper.h"
/* control stack frame */