summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-31 01:02:29 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-31 01:02:29 (GMT)
commit9d64a542094efdbcf8fc8b192750d6b0343665c3 (patch)
tree79011dd5107df17b3f7e2c8533a5ed965906c139 /load.c
parent1546ffed499aa40e905485b00293fbb530d7ebd1 (diff)
internal.h: RUBY_DTRACE_HOOK
* internal.h (RUBY_DTRACE_HOOK): extract from RUBY_DTRACE_CREATE_HOOK for other type hooks. * gc.c (RUBY_DTRACE_GC_HOOK): ditto. * parse.y (RUBY_DTRACE_PARSE_HOOK): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r--load.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/load.c b/load.c
index 0a8aeda..3f5e143 100644
--- a/load.c
+++ b/load.c
@@ -698,11 +698,7 @@ rb_f_load(int argc, VALUE *argv)
rb_scan_args(argc, argv, "11", &fname, &wrap);
- if (RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
- RUBY_DTRACE_LOAD_ENTRY(StringValuePtr(fname),
- rb_sourcefile(),
- rb_sourceline());
- }
+ RUBY_DTRACE_HOOK(LOAD_ENTRY, StringValuePtr(fname));
orig_fname = FilePathValue(fname);
fname = rb_str_encode_ospath(orig_fname);
@@ -714,11 +710,7 @@ rb_f_load(int argc, VALUE *argv)
}
rb_load_internal(path, RTEST(wrap));
- if (RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
- RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname),
- rb_sourcefile(),
- rb_sourceline());
- }
+ RUBY_DTRACE_HOOK(LOAD_RETURN, StringValuePtr(fname));
return Qtrue;
}
@@ -967,11 +959,7 @@ rb_require_internal(VALUE fname, int safe)
} volatile saved;
char *volatile ftptr = 0;
- if (RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
- RUBY_DTRACE_REQUIRE_ENTRY(StringValuePtr(fname),
- rb_sourcefile(),
- rb_sourceline());
- }
+ RUBY_DTRACE_HOOK(REQUIRE_ENTRY, StringValuePtr(fname));
TH_PUSH_TAG(th);
saved.safe = rb_safe_level();
@@ -984,20 +972,12 @@ rb_require_internal(VALUE fname, int safe)
FilePathValue(fname);
rb_set_safe_level_force(0);
- if (RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
- RUBY_DTRACE_FIND_REQUIRE_ENTRY(StringValuePtr(fname),
- rb_sourcefile(),
- rb_sourceline());
- }
+ RUBY_DTRACE_HOOK(FIND_REQUIRE_ENTRY, StringValuePtr(fname));
path = rb_str_encode_ospath(fname);
found = search_required(path, &path, safe);
- if (RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
- RUBY_DTRACE_FIND_REQUIRE_RETURN(StringValuePtr(fname),
- rb_sourcefile(),
- rb_sourceline());
- }
+ RUBY_DTRACE_HOOK(FIND_REQUIRE_RETURN, StringValuePtr(fname));
if (found) {
if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
result = 0;
@@ -1036,11 +1016,7 @@ rb_require_internal(VALUE fname, int safe)
th->errinfo = errinfo;
- if (RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
- RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname),
- rb_sourcefile(),
- rb_sourceline());
- }
+ RUBY_DTRACE_HOOK(REQUIRE_RETURN, StringValuePtr(fname));
return result;
}