Ruby
2.5.0dev(2017-10-22revision60238)
probes_helper.h
Go to the documentation of this file.
1
#ifndef RUBY_PROBES_HELPER_H
2
#define RUBY_PROBES_HELPER_H
3
4
#include "
ruby/ruby.h
"
5
#include "
probes.h
"
6
7
struct
ruby_dtrace_method_hook_args
{
8
const
char
*
classname
;
9
const
char
*
methodname
;
10
const
char
*
filename
;
11
int
line_no
;
12
volatile
VALUE
klass
;
13
volatile
VALUE
name
;
14
};
15
16
NOINLINE
(
int
ruby_th_dtrace_setup
(
rb_thread_t
*,
VALUE
,
ID
,
struct
ruby_dtrace_method_hook_args
*));
17
18
#define RUBY_DTRACE_METHOD_HOOK(name, th, klazz, id) \
19
do { \
20
if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
21
struct ruby_dtrace_method_hook_args args; \
22
if (ruby_th_dtrace_setup(th, klazz, id, &args)) { \
23
RUBY_DTRACE_##name(args.classname, \
24
args.methodname, \
25
args.filename, \
26
args.line_no); \
27
} \
28
} \
29
} while (0)
30
31
#define RUBY_DTRACE_METHOD_ENTRY_HOOK(th, klass, id) \
32
RUBY_DTRACE_METHOD_HOOK(METHOD_ENTRY, th, klass, id)
33
34
#define RUBY_DTRACE_METHOD_RETURN_HOOK(th, klass, id) \
35
RUBY_DTRACE_METHOD_HOOK(METHOD_RETURN, th, klass, id)
36
37
#define RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, klass, id) \
38
RUBY_DTRACE_METHOD_HOOK(CMETHOD_ENTRY, th, klass, id)
39
40
#define RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, klass, id) \
41
RUBY_DTRACE_METHOD_HOOK(CMETHOD_RETURN, th, klass, id)
42
43
#endif
/* RUBY_PROBES_HELPER_H */
ruby_dtrace_method_hook_args::name
volatile VALUE name
Definition:
probes_helper.h:13
ruby.h
ruby_dtrace_method_hook_args::methodname
const char * methodname
Definition:
probes_helper.h:9
probes.h
ruby_dtrace_method_hook_args::line_no
int line_no
Definition:
probes_helper.h:11
ruby_dtrace_method_hook_args::klass
volatile VALUE klass
Definition:
probes_helper.h:12
rb_thread_struct
Definition:
vm_core.h:785
ruby_dtrace_method_hook_args
Definition:
probes_helper.h:7
ID
unsigned long ID
Definition:
ruby.h:86
VALUE
unsigned long VALUE
Definition:
ruby.h:85
ruby_dtrace_method_hook_args::classname
const char * classname
Definition:
probes_helper.h:8
NOINLINE
NOINLINE(int ruby_th_dtrace_setup(rb_thread_t *, VALUE, ID, struct ruby_dtrace_method_hook_args *))
ruby_th_dtrace_setup
int ruby_th_dtrace_setup(rb_thread_t *th, VALUE klass, ID id, struct ruby_dtrace_method_hook_args *args)
Definition:
vm.c:338
ruby_dtrace_method_hook_args::filename
const char * filename
Definition:
probes_helper.h:10
Generated by
1.8.13