blob: 9324cb8872b9e5a9112b3cdbdefa7c648f565c81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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 */
|