Ruby: probes_helper.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Functions
probes_helper.h File Reference
`#include "ruby/ruby.h"`

Go to the source code of this file.

## Data Structures
struct | ruby_dtrace_method_hook_args

## Macros
#define | RUBY_DTRACE_METHOD_HOOK(name, ec, klazz, id)
#define | RUBY_DTRACE_METHOD_ENTRY_HOOK(ec, klass, id) RUBY_DTRACE_METHOD_HOOK(METHOD_ENTRY, ec, klass, id)
#define | RUBY_DTRACE_METHOD_RETURN_HOOK(ec, klass, id) RUBY_DTRACE_METHOD_HOOK(METHOD_RETURN, ec, klass, id)
#define | RUBY_DTRACE_CMETHOD_ENTRY_HOOK(ec, klass, id) RUBY_DTRACE_METHOD_HOOK(CMETHOD_ENTRY, ec, klass, id)
#define | RUBY_DTRACE_CMETHOD_RETURN_HOOK(ec, klass, id) RUBY_DTRACE_METHOD_HOOK(CMETHOD_RETURN, ec, klass, id)

## Functions
int | rb_dtrace_setup (rb_execution_context_t *, VALUE, ID, struct ruby_dtrace_method_hook_args *)

## Macro Definition Documentation

## ◆ RUBY_DTRACE_CMETHOD_ENTRY_HOOK

#define RUBY_DTRACE_CMETHOD_ENTRY_HOOK | ( |  | ec,
|  |  | klass,
|  |  | id
| ) |  | RUBY_DTRACE_METHOD_HOOK(CMETHOD_ENTRY, ec, klass, id)

Definition at line 38 of file probes_helper.h.

## ◆ RUBY_DTRACE_CMETHOD_RETURN_HOOK

#define RUBY_DTRACE_CMETHOD_RETURN_HOOK | ( |  | ec,
|  |  | klass,
|  |  | id
| ) |  | RUBY_DTRACE_METHOD_HOOK(CMETHOD_RETURN, ec, klass, id)

Definition at line 41 of file probes_helper.h.

## ◆ RUBY_DTRACE_METHOD_ENTRY_HOOK

#define RUBY_DTRACE_METHOD_ENTRY_HOOK | ( |  | ec,
|  |  | klass,
|  |  | id
| ) |  | RUBY_DTRACE_METHOD_HOOK(METHOD_ENTRY, ec, klass, id)

Definition at line 32 of file probes_helper.h.

## ◆ RUBY_DTRACE_METHOD_HOOK

#define RUBY_DTRACE_METHOD_HOOK | ( |  | name,
|  |  | ec,
|  |  | klazz,
|  |  | id
| ) |  |

Value:
do { \
if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
struct ruby_dtrace_method_hook_args args; \
if (rb_dtrace_setup(ec, klazz, id, &args)) { \
RUBY_DTRACE_##name(args.classname, \
args.methodname, \
args.filename, \
args.line_no); \
} \
} \
} while (0)
UNLIKELY
#define UNLIKELY(x)
Definition: ffi_common.h:126
name
const char * name
Definition: nkf.c:208
rb_dtrace_setup
int rb_dtrace_setup(rb_execution_context_t *, VALUE, ID, struct ruby_dtrace_method_hook_args *)
Definition: vm.c:431
ruby_dtrace_method_hook_args
Definition: probes_helper.h:6

Definition at line 19 of file probes_helper.h.

## ◆ RUBY_DTRACE_METHOD_RETURN_HOOK

#define RUBY_DTRACE_METHOD_RETURN_HOOK | ( |  | ec,
|  |  | klass,
|  |  | id
| ) |  | RUBY_DTRACE_METHOD_HOOK(METHOD_RETURN, ec, klass, id)

Definition at line 35 of file probes_helper.h.

## Function Documentation

## ◆ rb_dtrace_setup()

int rb_dtrace_setup | ( | rb_execution_context_t * | ec,
|  | VALUE | klass,
|  | ID | id,
|  | struct ruby_dtrace_method_hook_args * | args
| ) |  |

Definition at line 431 of file vm.c.

References BUILTIN_TYPE, ruby_dtrace_method_hook_args::classname, FALSE, ruby_dtrace_method_hook_args::filename, FL_SINGLETON, FL_TEST, ruby_dtrace_method_hook_args::klass, rb_callcache::klass, ruby_dtrace_method_hook_args::line_no, ruby_dtrace_method_hook_args::methodname, name, ruby_dtrace_method_hook_args::name, NIL_P, rb_attr_get(), rb_class_path(), rb_ec_frame_method_id_and_class(), rb_id2name(), rb_source_location_cstr(), RBASIC, StringValuePtr, T_CLASS, T_ICLASS, T_MODULE, and TRUE.