ruby-dtrace 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Manifest.txt +10 -1
- data/Rakefile +3 -1
- data/ext/dtrace_aggdata.c +139 -0
- data/ext/dtrace_api.c +17 -9
- data/ext/dtrace_api.h +15 -7
- data/ext/dtrace_bufdata.c +91 -0
- data/ext/dtrace_hdl.c +101 -0
- data/ext/dtrace_probedata.c +129 -0
- data/ext/dtrace_recdesc.c +0 -23
- data/ext/dtrace_util.c +91 -0
- data/ext/extconf.rb +1 -1
- data/lib/dtrace.rb +6 -1
- data/lib/dtraceaggregate.rb +13 -0
- data/lib/dtraceconsumer.rb +99 -0
- data/lib/dtraceprobe.rb +13 -0
- data/lib/dtraceprobedata.rb +16 -0
- data/lib/dtracerecord.rb +8 -0
- data/plugin/dtrace/lib/dtracer.rb +6 -5
- data/test/test_dtrace.rb +0 -306
- data/test/test_dtrace_workapi.rb +142 -0
- metadata +13 -3
- data/ext/dtrace_aggregate.c +0 -150
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-dtrace
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-12-
|
6
|
+
version: 0.0.2
|
7
|
+
date: 2007-12-07 00:00:00 +00:00
|
8
8
|
summary: Ruby bindings for libdtrace
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -34,16 +34,24 @@ files:
|
|
34
34
|
- Manifest.txt
|
35
35
|
- README.txt
|
36
36
|
- Rakefile
|
37
|
-
- ext/
|
37
|
+
- ext/dtrace_aggdata.c
|
38
38
|
- ext/dtrace_api.c
|
39
39
|
- ext/dtrace_api.h
|
40
|
+
- ext/dtrace_bufdata.c
|
40
41
|
- ext/dtrace_hdl.c
|
41
42
|
- ext/dtrace_probe.c
|
43
|
+
- ext/dtrace_probedata.c
|
42
44
|
- ext/dtrace_program.c
|
43
45
|
- ext/dtrace_programinfo.c
|
44
46
|
- ext/dtrace_recdesc.c
|
47
|
+
- ext/dtrace_util.c
|
45
48
|
- ext/extconf.rb
|
46
49
|
- lib/dtrace.rb
|
50
|
+
- lib/dtraceaggregate.rb
|
51
|
+
- lib/dtraceconsumer.rb
|
52
|
+
- lib/dtraceprobe.rb
|
53
|
+
- lib/dtraceprobedata.rb
|
54
|
+
- lib/dtracerecord.rb
|
47
55
|
- plugin/dtrace/README
|
48
56
|
- plugin/dtrace/Rakefile
|
49
57
|
- plugin/dtrace/bin/dtracer.rb
|
@@ -58,8 +66,10 @@ files:
|
|
58
66
|
- plugin/dtrace/test/dtrace_test.rb
|
59
67
|
- plugin/dtrace/views/dtrace/_report.rhtml
|
60
68
|
- test/test_dtrace.rb
|
69
|
+
- test/test_dtrace_workapi.rb
|
61
70
|
test_files:
|
62
71
|
- test/test_dtrace.rb
|
72
|
+
- test/test_dtrace_workapi.rb
|
63
73
|
rdoc_options:
|
64
74
|
- --main
|
65
75
|
- README.txt
|
data/ext/dtrace_aggregate.c
DELETED
@@ -1,150 +0,0 @@
|
|
1
|
-
/* Ruby-Dtrace
|
2
|
-
* (c) 2007 Chris Andrews <chris@nodnol.org>
|
3
|
-
*/
|
4
|
-
|
5
|
-
#include "dtrace_api.h"
|
6
|
-
|
7
|
-
RUBY_EXTERN VALUE cDtraceProbe;
|
8
|
-
RUBY_EXTERN VALUE cDtraceRecDesc;
|
9
|
-
|
10
|
-
/* :nodoc: */
|
11
|
-
VALUE dtraceaggdata_init(VALUE self)
|
12
|
-
{
|
13
|
-
dtrace_aggdata_t *aggdata;
|
14
|
-
|
15
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
16
|
-
return self;
|
17
|
-
}
|
18
|
-
|
19
|
-
/*
|
20
|
-
* Returns the description of this aggregate.
|
21
|
-
*/
|
22
|
-
VALUE dtraceaggdata_desc(VALUE self)
|
23
|
-
{
|
24
|
-
VALUE string;
|
25
|
-
dtrace_aggdata_t *aggdata;
|
26
|
-
dtrace_aggdesc_t *aggdesc;
|
27
|
-
dtrace_recdesc_t *nrec, *irec;
|
28
|
-
char *name, c[256];
|
29
|
-
|
30
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
31
|
-
|
32
|
-
aggdesc = aggdata->dtada_desc;
|
33
|
-
nrec = &aggdesc->dtagd_rec[1];
|
34
|
-
irec = &aggdesc->dtagd_rec[2];
|
35
|
-
|
36
|
-
name = aggdata->dtada_data + nrec->dtrd_offset;
|
37
|
-
string = rb_str_new2(name);
|
38
|
-
return string;
|
39
|
-
}
|
40
|
-
|
41
|
-
/*
|
42
|
-
* Returns the value of this aggregate.
|
43
|
-
*/
|
44
|
-
VALUE dtraceaggdata_value(VALUE self)
|
45
|
-
{
|
46
|
-
dtrace_aggdata_t *aggdata;
|
47
|
-
dtrace_aggdesc_t *aggdesc;
|
48
|
-
dtrace_recdesc_t *nrec, *irec;
|
49
|
-
|
50
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
51
|
-
|
52
|
-
aggdesc = aggdata->dtada_desc;
|
53
|
-
nrec = &aggdesc->dtagd_rec[1];
|
54
|
-
irec = &aggdesc->dtagd_rec[2];
|
55
|
-
|
56
|
-
uint64_t n = *((uint64_t *)(aggdata->dtada_data + irec->dtrd_offset));
|
57
|
-
|
58
|
-
return INT2FIX(n);
|
59
|
-
}
|
60
|
-
|
61
|
-
/*
|
62
|
-
* Returns the size of this aggregate.
|
63
|
-
*/
|
64
|
-
VALUE dtraceaggdata_size(VALUE self)
|
65
|
-
{
|
66
|
-
dtrace_aggdata_t *aggdata;
|
67
|
-
|
68
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
69
|
-
|
70
|
-
return INT2FIX(aggdata->dtada_size);
|
71
|
-
}
|
72
|
-
|
73
|
-
/*
|
74
|
-
* Yields each record for this aggregate.
|
75
|
-
*/
|
76
|
-
VALUE dtraceaggdata_each_record(VALUE self)
|
77
|
-
{
|
78
|
-
VALUE dtracerecdesc;
|
79
|
-
dtrace_aggdata_t *aggdata;
|
80
|
-
dtrace_aggdesc_t *aggdesc;
|
81
|
-
dtrace_recdesc_t *rec;
|
82
|
-
int i;
|
83
|
-
caddr_t data;
|
84
|
-
|
85
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
86
|
-
aggdesc = aggdata->dtada_desc;
|
87
|
-
|
88
|
-
for (i = 0; i < aggdesc->dtagd_nrecs; i++) {
|
89
|
-
rec = &aggdesc->dtagd_rec[i];
|
90
|
-
dtracerecdesc = Data_Wrap_Struct(cDtraceRecDesc, 0, NULL, rec);
|
91
|
-
rb_iv_set(dtracerecdesc, "@aggdata", self);
|
92
|
-
rb_yield(dtracerecdesc);
|
93
|
-
}
|
94
|
-
|
95
|
-
return Qnil;
|
96
|
-
}
|
97
|
-
|
98
|
-
/*
|
99
|
-
* Return the number of records in this aggregate.
|
100
|
-
*/
|
101
|
-
VALUE dtraceaggdata_num_records(VALUE self)
|
102
|
-
{
|
103
|
-
VALUE dtracerecdesc;
|
104
|
-
dtrace_aggdata_t *aggdata;
|
105
|
-
dtrace_aggdesc_t *aggdesc;
|
106
|
-
|
107
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
108
|
-
aggdesc = aggdata->dtada_desc;
|
109
|
-
|
110
|
-
return INT2FIX(aggdesc->dtagd_nrecs);
|
111
|
-
}
|
112
|
-
|
113
|
-
/*
|
114
|
-
* Access the array of records in this aggregate.
|
115
|
-
*/
|
116
|
-
VALUE dtraceaggdata_record(VALUE self, VALUE index)
|
117
|
-
{
|
118
|
-
VALUE dtracerecdesc;
|
119
|
-
dtrace_aggdata_t *aggdata;
|
120
|
-
dtrace_aggdesc_t *aggdesc;
|
121
|
-
dtrace_recdesc_t *rec;
|
122
|
-
int i;
|
123
|
-
|
124
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
125
|
-
aggdesc = aggdata->dtada_desc;
|
126
|
-
|
127
|
-
i = FIX2INT(index);
|
128
|
-
if (i >= aggdesc->dtagd_nrecs)
|
129
|
-
return Qnil;
|
130
|
-
else {
|
131
|
-
rec = &aggdesc->dtagd_rec[i];
|
132
|
-
dtracerecdesc = Data_Wrap_Struct(cDtraceRecDesc, 0, NULL, rec);
|
133
|
-
rb_iv_set(dtracerecdesc, "@aggdata", self);
|
134
|
-
return dtracerecdesc;
|
135
|
-
}
|
136
|
-
}
|
137
|
-
|
138
|
-
/*
|
139
|
-
* Return the probe associated with this aggregate.
|
140
|
-
*/
|
141
|
-
VALUE dtraceaggdata_probe(VALUE self)
|
142
|
-
{
|
143
|
-
VALUE probe;
|
144
|
-
dtrace_aggdata_t *aggdata;
|
145
|
-
|
146
|
-
Data_Get_Struct(self, dtrace_aggdata_t, aggdata);
|
147
|
-
probe = Data_Wrap_Struct(cDtraceProbe, 0, NULL, (dtrace_probedesc_t *)aggdata->dtada_pdesc);
|
148
|
-
|
149
|
-
return probe;
|
150
|
-
}
|