ruby-static-tracing 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/ruby-static-tracing/darwin/provider.c +40 -52
- data/ext/ruby-static-tracing/darwin/provider.h +2 -3
- data/ext/ruby-static-tracing/darwin/ruby_static_tracing.c +4 -5
- data/ext/ruby-static-tracing/darwin/tracepoint.c +66 -91
- data/ext/ruby-static-tracing/darwin/tracepoint.h +4 -4
- data/ext/ruby-static-tracing/extconf.rb +40 -36
- data/ext/ruby-static-tracing/include/ruby_static_tracing.h +2 -1
- data/ext/ruby-static-tracing/lib/deps-extconf.rb +30 -28
- data/ext/ruby-static-tracing/lib/post-extconf.rb +23 -21
- data/ext/ruby-static-tracing/linux/provider.c +87 -61
- data/ext/ruby-static-tracing/linux/provider.h +16 -4
- data/ext/ruby-static-tracing/linux/ruby_static_tracing.c +7 -7
- data/ext/ruby-static-tracing/linux/tracepoint.c +86 -96
- data/ext/ruby-static-tracing/linux/tracepoint.h +2 -2
- data/ext/ruby-static-tracing/linux/types.h +2 -2
- data/lib/ruby-static-tracing.rb +11 -3
- data/lib/ruby-static-tracing/configuration.rb +11 -0
- data/lib/ruby-static-tracing/platform.rb +5 -1
- data/lib/ruby-static-tracing/provider.rb +50 -26
- data/lib/ruby-static-tracing/tracepoint.rb +19 -9
- data/lib/ruby-static-tracing/tracepoints.rb +2 -0
- data/lib/ruby-static-tracing/tracer/base.rb +2 -0
- data/lib/ruby-static-tracing/tracer/concerns/latency_tracer.rb +2 -0
- data/lib/ruby-static-tracing/tracer/helpers.rb +8 -8
- data/lib/ruby-static-tracing/tracer/latency.rb +1 -1
- data/lib/ruby-static-tracing/tracer/stack.rb +4 -2
- data/lib/ruby-static-tracing/tracers.rb +9 -0
- data/lib/ruby-static-tracing/version.rb +2 -1
- metadata +42 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ac00c672308f4c2f3f12935d4a64ed1a0ac190c09a32f0b6ef5f684bd05d4d1
|
4
|
+
data.tar.gz: c1ea10f2f75a1f230789d4dd093af6760a2f949be0cec0b5f30fe66c8b1dc8ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d619816b75f523a10ef9e7f4ecfbc5d5067483661a9931d0199a012406313ab8fa3092ca71bf65fcfdc3e89ac222e6fa7b8848f66d965ab042c0eb4a73c0edcc
|
7
|
+
data.tar.gz: c1c98d614ec92e106a08b83492ec5f9a8c8017a749d394950ee633148927277a470111b5f918eaa16053fc5099e391807baa5ff5cf6c56c32420f193b11bb806
|
@@ -1,45 +1,46 @@
|
|
1
1
|
#include "provider.h"
|
2
2
|
|
3
|
-
static const rb_data_type_t
|
4
|
-
static_tracing_provider_type;
|
3
|
+
static const rb_data_type_t static_tracing_provider_type;
|
5
4
|
|
6
5
|
// Forward decls
|
7
|
-
static const char*
|
8
|
-
check_name_arg(VALUE name);
|
6
|
+
static const char *check_name_arg(VALUE name);
|
9
7
|
|
10
8
|
/*
|
11
9
|
Wraps usdt_create_provider from libusdt.h
|
12
10
|
*/
|
13
11
|
VALUE
|
14
|
-
provider_initialize(VALUE self, VALUE name)
|
15
|
-
{
|
12
|
+
provider_initialize(VALUE self, VALUE name) {
|
16
13
|
const char *c_name_str = NULL;
|
17
14
|
static_tracing_provider_t *res = NULL;
|
18
15
|
|
19
16
|
c_name_str = check_name_arg(name);
|
20
17
|
|
21
|
-
TypedData_Get_Struct(self, static_tracing_provider_t,
|
22
|
-
|
18
|
+
TypedData_Get_Struct(self, static_tracing_provider_t,
|
19
|
+
&static_tracing_provider_type, res);
|
20
|
+
res->usdt_provider = usdt_create_provider(
|
21
|
+
c_name_str,
|
22
|
+
c_name_str); // FIXME make module from name and just prepend "_module_"
|
23
23
|
return self;
|
24
24
|
}
|
25
25
|
|
26
|
-
// // Internal function used to register a tracepoint against a provider
|
27
|
-
|
28
|
-
provider_add_tracepoint_internal(VALUE self, usdt_probedef_t *probedef)
|
29
|
-
{
|
26
|
+
// // Internal function used to register a tracepoint against a provider
|
27
|
+
// instance
|
28
|
+
int provider_add_tracepoint_internal(VALUE self, usdt_probedef_t *probedef) {
|
30
29
|
static_tracing_provider_t *res = NULL;
|
31
|
-
TypedData_Get_Struct(self, static_tracing_provider_t,
|
32
|
-
|
30
|
+
TypedData_Get_Struct(self, static_tracing_provider_t,
|
31
|
+
&static_tracing_provider_type, res);
|
32
|
+
return usdt_provider_add_probe(res->usdt_provider, probedef) == 0 ? Qtrue
|
33
|
+
: Qfalse;
|
33
34
|
}
|
34
35
|
|
35
36
|
/*
|
36
37
|
Wraps usdt_provider_enable from libusdt.h
|
37
38
|
*/
|
38
39
|
VALUE
|
39
|
-
provider_enable(VALUE self)
|
40
|
-
{
|
40
|
+
provider_enable(VALUE self) {
|
41
41
|
static_tracing_provider_t *res = NULL;
|
42
|
-
TypedData_Get_Struct(self, static_tracing_provider_t,
|
42
|
+
TypedData_Get_Struct(self, static_tracing_provider_t,
|
43
|
+
&static_tracing_provider_type, res);
|
43
44
|
return usdt_provider_enable(res->usdt_provider) == 0 ? Qtrue : Qfalse;
|
44
45
|
}
|
45
46
|
|
@@ -47,10 +48,10 @@ provider_enable(VALUE self)
|
|
47
48
|
Wraps usdt_provider_disable from libusdt.h
|
48
49
|
*/
|
49
50
|
VALUE
|
50
|
-
provider_disable(VALUE self)
|
51
|
-
{
|
51
|
+
provider_disable(VALUE self) {
|
52
52
|
static_tracing_provider_t *res = NULL;
|
53
|
-
TypedData_Get_Struct(self, static_tracing_provider_t,
|
53
|
+
TypedData_Get_Struct(self, static_tracing_provider_t,
|
54
|
+
&static_tracing_provider_type, res);
|
54
55
|
return usdt_provider_disable(res->usdt_provider) == 0 ? Qtrue : Qfalse;
|
55
56
|
}
|
56
57
|
|
@@ -58,27 +59,24 @@ provider_disable(VALUE self)
|
|
58
59
|
Wraps usdt_provider_free from libusdt.h
|
59
60
|
*/
|
60
61
|
VALUE
|
61
|
-
provider_destroy(VALUE self)
|
62
|
-
{
|
62
|
+
provider_destroy(VALUE self) {
|
63
63
|
static_tracing_provider_t *res = NULL;
|
64
|
-
TypedData_Get_Struct(self, static_tracing_provider_t,
|
64
|
+
TypedData_Get_Struct(self, static_tracing_provider_t,
|
65
|
+
&static_tracing_provider_type, res);
|
65
66
|
usdt_provider_free(res->usdt_provider);
|
66
67
|
return Qnil;
|
67
68
|
}
|
68
69
|
|
69
70
|
// Allocate a static_tracing_provider_type struct for ruby memory management
|
70
71
|
VALUE
|
71
|
-
static_tracing_provider_alloc(VALUE klass)
|
72
|
-
{
|
72
|
+
static_tracing_provider_alloc(VALUE klass) {
|
73
73
|
static_tracing_provider_t *res;
|
74
|
-
VALUE obj = TypedData_Make_Struct(klass, static_tracing_provider_t,
|
74
|
+
VALUE obj = TypedData_Make_Struct(klass, static_tracing_provider_t,
|
75
|
+
&static_tracing_provider_type, res);
|
75
76
|
return obj;
|
76
77
|
}
|
77
78
|
|
78
|
-
|
79
|
-
static const char*
|
80
|
-
check_name_arg(VALUE name)
|
81
|
-
{
|
79
|
+
static const char *check_name_arg(VALUE name) {
|
82
80
|
const char *c_name_str = NULL;
|
83
81
|
|
84
82
|
if (TYPE(name) != T_SYMBOL && TYPE(name) != T_STRING) {
|
@@ -93,36 +91,26 @@ check_name_arg(VALUE name)
|
|
93
91
|
return c_name_str;
|
94
92
|
}
|
95
93
|
|
96
|
-
static inline void
|
97
|
-
static_tracing_provider_mark(void *ptr)
|
98
|
-
{
|
99
|
-
/* noop */
|
94
|
+
static inline void static_tracing_provider_mark(void *ptr) { /* noop */
|
100
95
|
}
|
101
96
|
|
102
|
-
static inline void
|
103
|
-
|
104
|
-
{
|
105
|
-
static_tracing_provider_t *res = (static_tracing_provider_t *) ptr;
|
106
|
-
//if (res->name) {
|
97
|
+
static inline void static_tracing_provider_free(void *ptr) {
|
98
|
+
static_tracing_provider_t *res = (static_tracing_provider_t *)ptr;
|
99
|
+
// if (res->name) {
|
107
100
|
// free(res->name);
|
108
101
|
// res->name = NULL;
|
109
102
|
//}
|
110
103
|
xfree(res);
|
111
104
|
}
|
112
105
|
|
113
|
-
static inline size_t
|
114
|
-
static_tracing_provider_memsize(const void *ptr)
|
115
|
-
{
|
106
|
+
static inline size_t static_tracing_provider_memsize(const void *ptr) {
|
116
107
|
return sizeof(static_tracing_provider_t);
|
117
108
|
}
|
118
109
|
|
119
|
-
static const rb_data_type_t
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
},
|
127
|
-
NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
|
128
|
-
};
|
110
|
+
static const rb_data_type_t static_tracing_provider_type = {
|
111
|
+
"static_tracing_provider",
|
112
|
+
{static_tracing_provider_mark, static_tracing_provider_free,
|
113
|
+
static_tracing_provider_memsize},
|
114
|
+
NULL,
|
115
|
+
NULL,
|
116
|
+
RUBY_TYPED_FREE_IMMEDIATELY};
|
@@ -56,7 +56,6 @@ provider_destroy(VALUE self);
|
|
56
56
|
VALUE
|
57
57
|
static_tracing_provider_alloc(VALUE klass);
|
58
58
|
|
59
|
-
int
|
60
|
-
provider_add_tracepoint_internal(VALUE self, usdt_probedef_t* probedef);
|
59
|
+
int provider_add_tracepoint_internal(VALUE self, usdt_probedef_t *probedef);
|
61
60
|
|
62
|
-
#endif //STATIC_TRACING_PROVIDER_H
|
61
|
+
#endif // STATIC_TRACING_PROVIDER_H
|
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
VALUE eUSDT, eInternal;
|
4
4
|
|
5
|
-
void Init_ruby_static_tracing()
|
6
|
-
{
|
5
|
+
void Init_ruby_static_tracing() {
|
7
6
|
VALUE cStaticTracing, cProvider, cTracepoint;
|
8
7
|
|
9
8
|
cStaticTracing = rb_const_get(rb_cObject, rb_intern("StaticTracing"));
|
@@ -15,7 +14,7 @@ void Init_ruby_static_tracing()
|
|
15
14
|
*/
|
16
15
|
cProvider = rb_const_get(cStaticTracing, rb_intern("Provider"));
|
17
16
|
|
18
|
-
|
17
|
+
/*
|
19
18
|
* Document-class: Statictracing::Tracepoint
|
20
19
|
*
|
21
20
|
* A Tracepoint is a wrapper around an SDTProbe
|
@@ -41,8 +40,8 @@ void Init_ruby_static_tracing()
|
|
41
40
|
rb_define_method(cProvider, "destroy", provider_destroy, 0);
|
42
41
|
|
43
42
|
rb_define_alloc_func(cTracepoint, static_tracing_tracepoint_alloc);
|
44
|
-
rb_define_method(cTracepoint, "tracepoint_initialize", tracepoint_initialize,
|
43
|
+
rb_define_method(cTracepoint, "tracepoint_initialize", tracepoint_initialize,
|
44
|
+
3);
|
45
45
|
rb_define_method(cTracepoint, "_fire_tracepoint", tracepoint_fire, 1);
|
46
46
|
rb_define_method(cTracepoint, "enabled?", tracepoint_enabled, 0);
|
47
47
|
}
|
48
|
-
|
@@ -1,29 +1,23 @@
|
|
1
1
|
#include "tracepoint.h"
|
2
2
|
|
3
|
-
static const rb_data_type_t
|
4
|
-
static_tracing_tracepoint_type;
|
3
|
+
static const rb_data_type_t static_tracing_tracepoint_type;
|
5
4
|
|
6
|
-
static const char*
|
7
|
-
check_name_arg(VALUE provider);
|
5
|
+
static const char *check_name_arg(VALUE provider);
|
8
6
|
|
9
|
-
static const char*
|
10
|
-
check_provider_arg(VALUE provider);
|
7
|
+
static const char *check_provider_arg(VALUE provider);
|
11
8
|
|
12
|
-
static char
|
13
|
-
**check_vargs(int *argc, VALUE vargs);
|
9
|
+
static char **check_vargs(int *argc, VALUE vargs);
|
14
10
|
|
15
|
-
static void
|
16
|
-
**check_fire_args(int *argc, VALUE vargs);
|
11
|
+
static void **check_fire_args(int *argc, VALUE vargs);
|
17
12
|
|
18
13
|
VALUE
|
19
|
-
tracepoint_initialize(VALUE self, VALUE provider, VALUE name, VALUE vargs)
|
20
|
-
{
|
14
|
+
tracepoint_initialize(VALUE self, VALUE provider, VALUE name, VALUE vargs) {
|
21
15
|
VALUE cStaticTracing, cProvider, cProviderInst;
|
22
16
|
static_tracing_tracepoint_t *tracepoint = NULL;
|
23
17
|
const char *c_name_str = NULL;
|
24
18
|
int argc = 0;
|
25
19
|
|
26
|
-
c_name_str
|
20
|
+
c_name_str = check_name_arg(name);
|
27
21
|
check_provider_arg(provider); // FIXME should only accept string
|
28
22
|
char **args = check_vargs(&argc, vargs);
|
29
23
|
|
@@ -33,11 +27,15 @@ tracepoint_initialize(VALUE self, VALUE provider, VALUE name, VALUE vargs)
|
|
33
27
|
cProviderInst = rb_funcall(cProvider, rb_intern("register"), 1, provider);
|
34
28
|
|
35
29
|
// Create a probe
|
36
|
-
usdt_probedef_t *probe =
|
30
|
+
usdt_probedef_t *probe =
|
31
|
+
usdt_create_probe(c_name_str, c_name_str, argc, args);
|
37
32
|
|
38
33
|
// Use the provider to register a tracepoint
|
39
|
-
int success = provider_add_tracepoint_internal(
|
40
|
-
|
34
|
+
int success = provider_add_tracepoint_internal(
|
35
|
+
cProviderInst, probe); // FIXME handle error checking here and throw an
|
36
|
+
// exception if failure
|
37
|
+
TypedData_Get_Struct(self, static_tracing_tracepoint_t,
|
38
|
+
&static_tracing_tracepoint_type, tracepoint);
|
41
39
|
|
42
40
|
// FIXME check for nulls
|
43
41
|
// FIXME Do we really need to store both references? refactor this.
|
@@ -48,10 +46,10 @@ tracepoint_initialize(VALUE self, VALUE provider, VALUE name, VALUE vargs)
|
|
48
46
|
}
|
49
47
|
|
50
48
|
VALUE
|
51
|
-
tracepoint_fire(VALUE self, VALUE vargs)
|
52
|
-
{
|
49
|
+
tracepoint_fire(VALUE self, VALUE vargs) {
|
53
50
|
static_tracing_tracepoint_t *res = NULL;
|
54
|
-
TypedData_Get_Struct(self, static_tracing_tracepoint_t,
|
51
|
+
TypedData_Get_Struct(self, static_tracing_tracepoint_t,
|
52
|
+
&static_tracing_tracepoint_type, res);
|
55
53
|
int argc = 0;
|
56
54
|
void *args = check_fire_args(&argc, vargs);
|
57
55
|
|
@@ -60,16 +58,14 @@ tracepoint_fire(VALUE self, VALUE vargs)
|
|
60
58
|
}
|
61
59
|
|
62
60
|
VALUE
|
63
|
-
tracepoint_enabled(VALUE self)
|
64
|
-
{
|
61
|
+
tracepoint_enabled(VALUE self) {
|
65
62
|
static_tracing_tracepoint_t *res = NULL;
|
66
|
-
TypedData_Get_Struct(self, static_tracing_tracepoint_t,
|
63
|
+
TypedData_Get_Struct(self, static_tracing_tracepoint_t,
|
64
|
+
&static_tracing_tracepoint_type, res);
|
67
65
|
return usdt_is_enabled(res->usdt_tracepoint_def->probe) == 0 ? Qfalse : Qtrue;
|
68
66
|
}
|
69
67
|
|
70
|
-
static const char*
|
71
|
-
check_name_arg(VALUE name)
|
72
|
-
{
|
68
|
+
static const char *check_name_arg(VALUE name) {
|
73
69
|
const char *c_name_str = NULL;
|
74
70
|
|
75
71
|
if (TYPE(name) != T_SYMBOL && TYPE(name) != T_STRING) {
|
@@ -84,9 +80,7 @@ check_name_arg(VALUE name)
|
|
84
80
|
return c_name_str;
|
85
81
|
}
|
86
82
|
|
87
|
-
static const char*
|
88
|
-
check_provider_arg(VALUE provider)
|
89
|
-
{
|
83
|
+
static const char *check_provider_arg(VALUE provider) {
|
90
84
|
const char *c_provider_str = NULL;
|
91
85
|
|
92
86
|
if (TYPE(provider) != T_SYMBOL && TYPE(provider) != T_STRING) {
|
@@ -101,25 +95,22 @@ check_provider_arg(VALUE provider)
|
|
101
95
|
return c_provider_str;
|
102
96
|
}
|
103
97
|
|
104
|
-
static char
|
105
|
-
|
106
|
-
{
|
107
|
-
if(TYPE(vargs) == T_ARRAY)
|
108
|
-
{
|
98
|
+
static char **check_vargs(int *argc, VALUE vargs) {
|
99
|
+
if (TYPE(vargs) == T_ARRAY) {
|
109
100
|
VALUE rLength = rb_funcall(vargs, rb_intern("length"), 0, Qnil);
|
110
101
|
*argc = NUM2INT(rLength);
|
111
102
|
|
112
|
-
if(*argc > 6)
|
113
|
-
|
114
|
-
|
103
|
+
if (*argc > 6) {
|
104
|
+
printf("ERROR - passed %i args, maximum 6 argument types can be passed",
|
105
|
+
*argc);
|
115
106
|
return NULL;
|
116
107
|
}
|
117
108
|
// FIXME ensure this is freed
|
118
|
-
char **args = malloc(*argc * sizeof(char*));
|
119
|
-
for (int i = 0; i < *argc; i++)
|
120
|
-
|
121
|
-
|
122
|
-
const char*
|
109
|
+
char **args = malloc(*argc * sizeof(char *));
|
110
|
+
for (int i = 0; i < *argc; i++) {
|
111
|
+
VALUE str =
|
112
|
+
rb_funcall(rb_ary_entry(vargs, i), rb_intern("to_s"), 0, Qnil);
|
113
|
+
const char *cStr = RSTRING_PTR(str);
|
123
114
|
if (strcmp(cStr, "Integer")) {
|
124
115
|
args[i] = strdup(cStr);
|
125
116
|
} else if (strcmp(cStr, "String")) {
|
@@ -135,7 +126,6 @@ static char
|
|
135
126
|
}
|
136
127
|
}
|
137
128
|
|
138
|
-
|
139
129
|
/*
|
140
130
|
* Yeah, returning a void ** array is a bit sketchy, but since
|
141
131
|
* usdt_fire_probe takes a void **, that's what we'll give it.
|
@@ -145,42 +135,37 @@ static char
|
|
145
135
|
* We assume that reads will be aligned on 64 bits in the tracer.
|
146
136
|
*
|
147
137
|
* The approach libstapsdt takes is pretty similar, just not an array.
|
148
|
-
*/
|
149
|
-
static void
|
150
|
-
|
151
|
-
{
|
152
|
-
if(TYPE(vargs) == T_ARRAY)
|
153
|
-
{
|
138
|
+
*/
|
139
|
+
static void **check_fire_args(int *argc, VALUE vargs) {
|
140
|
+
if (TYPE(vargs) == T_ARRAY) {
|
154
141
|
VALUE rLength = rb_funcall(vargs, rb_intern("length"), 0, Qnil);
|
155
142
|
*argc = NUM2INT(rLength);
|
156
143
|
|
157
|
-
if(*argc > 6)
|
158
|
-
|
159
|
-
|
144
|
+
if (*argc > 6) {
|
145
|
+
printf("ERROR - passed %i args, maximum 6 argument types can be passed",
|
146
|
+
*argc);
|
160
147
|
return NULL;
|
161
148
|
}
|
162
149
|
|
163
150
|
Tracepoint_fire_arg *args = malloc(*argc * sizeof(Tracepoint_fire_arg));
|
164
|
-
//printf("SIZE: %i ARGC: %i \n", sizeof(Tracepoint_fire_arg), *argc);
|
151
|
+
// printf("SIZE: %i ARGC: %i \n", sizeof(Tracepoint_fire_arg), *argc);
|
165
152
|
// FIXME check against registered argtypes here
|
166
|
-
for (int i = 0; i < *argc; i++)
|
167
|
-
{
|
153
|
+
for (int i = 0; i < *argc; i++) {
|
168
154
|
VALUE val = rb_ary_entry(vargs, i);
|
169
|
-
switch(TYPE(val))
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
break;
|
155
|
+
switch (TYPE(val)) {
|
156
|
+
case T_FIXNUM:
|
157
|
+
args[i].intval = FIX2LONG(val);
|
158
|
+
break;
|
159
|
+
case T_STRING:
|
160
|
+
args[i].strval = RSTRING_PTR(val);
|
161
|
+
break;
|
162
|
+
default:
|
163
|
+
printf("ERROR unsupported type passed for argument %i to fire\n", i);
|
164
|
+
break;
|
180
165
|
}
|
181
166
|
}
|
182
167
|
// This downcast is explained the comment section of this function.
|
183
|
-
return (void **)
|
168
|
+
return (void **)args;
|
184
169
|
} else {
|
185
170
|
printf("ERROR - array was expected\n");
|
186
171
|
return NULL;
|
@@ -189,43 +174,33 @@ static void
|
|
189
174
|
|
190
175
|
// Allocate a static_tracing_tracepoint_type struct for ruby memory management
|
191
176
|
VALUE
|
192
|
-
static_tracing_tracepoint_alloc(VALUE klass)
|
193
|
-
{
|
177
|
+
static_tracing_tracepoint_alloc(VALUE klass) {
|
194
178
|
static_tracing_tracepoint_t *res;
|
195
|
-
VALUE obj = TypedData_Make_Struct(klass, static_tracing_tracepoint_t,
|
179
|
+
VALUE obj = TypedData_Make_Struct(klass, static_tracing_tracepoint_t,
|
180
|
+
&static_tracing_tracepoint_type, res);
|
196
181
|
return obj;
|
197
182
|
}
|
198
183
|
|
199
|
-
static inline void
|
200
|
-
static_tracing_tracepoint_mark(void *ptr)
|
201
|
-
{
|
202
|
-
/* noop */
|
184
|
+
static inline void static_tracing_tracepoint_mark(void *ptr) { /* noop */
|
203
185
|
}
|
204
186
|
|
205
|
-
static inline void
|
206
|
-
|
207
|
-
{
|
208
|
-
static_tracing_tracepoint_t *res = (static_tracing_tracepoint_t *) ptr;
|
209
|
-
//if (res->name) {
|
187
|
+
static inline void static_tracing_tracepoint_free(void *ptr) {
|
188
|
+
static_tracing_tracepoint_t *res = (static_tracing_tracepoint_t *)ptr;
|
189
|
+
// if (res->name) {
|
210
190
|
// free(res->name);
|
211
191
|
// res->name = NULL;
|
212
192
|
//}
|
213
193
|
xfree(res);
|
214
194
|
}
|
215
195
|
|
216
|
-
static inline size_t
|
217
|
-
static_tracing_tracepoint_memsize(const void *ptr)
|
218
|
-
{
|
196
|
+
static inline size_t static_tracing_tracepoint_memsize(const void *ptr) {
|
219
197
|
return sizeof(static_tracing_provider_t);
|
220
198
|
}
|
221
199
|
|
222
|
-
static const rb_data_type_t
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
},
|
230
|
-
NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
|
231
|
-
};
|
200
|
+
static const rb_data_type_t static_tracing_tracepoint_type = {
|
201
|
+
"static_tracing_tracepoint",
|
202
|
+
{static_tracing_tracepoint_mark, static_tracing_tracepoint_free,
|
203
|
+
static_tracing_tracepoint_memsize},
|
204
|
+
NULL,
|
205
|
+
NULL,
|
206
|
+
RUBY_TYPED_FREE_IMMEDIATELY};
|