ruby-dtrace 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
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.2
7
- date: 2007-12-07 00:00:00 +00:00
6
+ version: 0.0.3
7
+ date: 2008-01-08 00:00:00 +00:00
8
8
  summary: Ruby bindings for libdtrace
9
9
  require_paths:
10
10
  - lib
@@ -34,6 +34,7 @@ files:
34
34
  - Manifest.txt
35
35
  - README.txt
36
36
  - Rakefile
37
+ - examples/scsi.rb
37
38
  - ext/dtrace_aggdata.c
38
39
  - ext/dtrace_api.c
39
40
  - ext/dtrace_api.h
@@ -41,6 +42,7 @@ files:
41
42
  - ext/dtrace_hdl.c
42
43
  - ext/dtrace_probe.c
43
44
  - ext/dtrace_probedata.c
45
+ - ext/dtrace_process.c
44
46
  - ext/dtrace_program.c
45
47
  - ext/dtrace_programinfo.c
46
48
  - ext/dtrace_recdesc.c
@@ -48,10 +50,14 @@ files:
48
50
  - ext/extconf.rb
49
51
  - lib/dtrace.rb
50
52
  - lib/dtraceaggregate.rb
53
+ - lib/dtraceaggregateset.rb
51
54
  - lib/dtraceconsumer.rb
55
+ - lib/dtracedata.rb
56
+ - lib/dtraceprintfrecord.rb
52
57
  - lib/dtraceprobe.rb
53
58
  - lib/dtraceprobedata.rb
54
59
  - lib/dtracerecord.rb
60
+ - lib/dtracestackrecord.rb
55
61
  - plugin/dtrace/README
56
62
  - plugin/dtrace/Rakefile
57
63
  - plugin/dtrace/bin/dtracer.rb
@@ -66,10 +72,18 @@ files:
66
72
  - plugin/dtrace/test/dtrace_test.rb
67
73
  - plugin/dtrace/views/dtrace/_report.rhtml
68
74
  - test/test_dtrace.rb
69
- - test/test_dtrace_workapi.rb
75
+ - test/test_dtrace_aggregates.rb
76
+ - test/test_dtrace_processes.rb
77
+ - test/test_dtrace_profile.rb
78
+ - test/test_dtrace_repeat.rb
79
+ - test/test_dtrace_rubyprobe.rb
70
80
  test_files:
71
81
  - test/test_dtrace.rb
72
- - test/test_dtrace_workapi.rb
82
+ - test/test_dtrace_aggregates.rb
83
+ - test/test_dtrace_processes.rb
84
+ - test/test_dtrace_profile.rb
85
+ - test/test_dtrace_repeat.rb
86
+ - test/test_dtrace_rubyprobe.rb
73
87
  rdoc_options:
74
88
  - --main
75
89
  - README.txt
@@ -91,5 +105,5 @@ dependencies:
91
105
  requirements:
92
106
  - - ">="
93
107
  - !ruby/object:Gem::Version
94
- version: 1.3.0
108
+ version: 1.4.0
95
109
  version:
@@ -1,142 +0,0 @@
1
- require 'dtrace'
2
- require 'test/unit'
3
-
4
- class TestDtrace < Test::Unit::TestCase
5
- def test_dtrace
6
- t = Dtrace.new
7
- assert t
8
- assert_equal Object, Dtrace.superclass
9
- assert_equal Dtrace, t.class
10
- end
11
-
12
- def test_work_dprogram_compile
13
- t = Dtrace.new
14
- assert t
15
-
16
- progtext = "syscall::select:entry { trace(probefunc); trace(execname); }"
17
-
18
- prog = t.compile progtext
19
- assert prog
20
- prog.execute
21
-
22
- info = prog.info
23
- assert info
24
- assert_equal 1, info.matches_count
25
- end
26
-
27
- def test_work_dprogram_run
28
- t = Dtrace.new
29
- t.setopt("bufsize", "4m")
30
- t.setopt("aggsize", "4m")
31
-
32
- progtext = "syscall:::entry { trace(probefunc); trace(execname); }"
33
-
34
- prog = t.compile progtext
35
- prog.execute
36
-
37
- c = DtraceConsumer.new(t)
38
- assert c
39
-
40
- begin
41
- i = 0
42
- c.consume do |e|
43
- assert e
44
- assert e.probedesc
45
- assert_equal 'syscall', e.probedesc.provider
46
- assert_equal 'entry', e.probedesc.name
47
- records = e.records
48
- assert records
49
- assert_equal 2, records.length
50
- assert_equal DtraceRecord, records[0].class
51
- assert_equal DtraceRecord, records[1].class
52
-
53
- i = i + 1
54
- if i > 10
55
- break
56
- end
57
- end
58
- rescue Interrupt
59
- puts "interrupted"
60
- end
61
- end
62
-
63
- def test_work_dprogram_aggregates
64
- t = Dtrace.new
65
- t.setopt("bufsize", "4m")
66
- t.setopt("aggsize", "4m")
67
-
68
- progtext = <<EOD
69
- ruby*:::function-entry
70
- {
71
- @a[execname, copyinstr(arg1), copyinstr(arg2)] = count();
72
- printf("foo");
73
- }
74
-
75
- profile-10
76
- {
77
- printa(@a)
78
- }
79
- EOD
80
-
81
- prog = t.compile progtext
82
- prog.execute
83
-
84
- c = DtraceConsumer.new(t)
85
-
86
- begin
87
- i = 0
88
- c.consume do |e|
89
- assert e
90
- case e.class.to_s
91
- when "DtraceProbeData"
92
- assert e.probedesc
93
- e.each_record do |r|
94
- assert r.value
95
- end
96
- when "DtraceRecord"
97
- assert e.value
98
- when "DtraceAggregate"
99
- assert e.value
100
- assert e.tuple
101
- assert_equal 3, e.tuple.length
102
- end
103
-
104
- i = i + 1
105
- if i > 100
106
- break
107
- end
108
- end
109
- rescue Interrupt
110
- puts "interrupted"
111
- end
112
-
113
- end
114
-
115
- def test_work_dprogram_once
116
- t = Dtrace.new
117
- t.setopt("bufsize", "4m")
118
- t.setopt("aggsize", "4m")
119
-
120
- progtext = "ruby*:::function-entry{ @a[execname, copyinstr(arg1), copyinstr(arg2)] = count(); } END { printa(@a); }"
121
-
122
- prog = t.compile progtext
123
- prog.execute
124
-
125
- t.go
126
-
127
- foo = 0
128
- (1..1000).each do |i|
129
- foo = foo + i
130
- end
131
-
132
- c = DtraceConsumer.new(t)
133
- c.consume_once do |e|
134
- if e && e.class == DtraceAggregate
135
- assert e.value
136
- assert e.tuple
137
- assert_equal 3, e.tuple.length
138
- end
139
- end
140
- end
141
-
142
- end