14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/xray/dtrace/usdt/provider_extensions.rb', line 14
def load
provider_module = original_load
xray_extension_module = Module.new do
@@provider_module = provider_module
def firing(function_prefix, *args)
@@provider_module.send :"#{function_prefix}_start" do |probe|
probe.fire(*args)
end
result = yield
@@provider_module.send :"#{function_prefix}_end" do |probe|
probe.fire(*args)
end
result
end
def fire(function_name, *args)
@@provider_module.send function_name do |p|
p.fire(*args)
end
end
end
provider_module.const_set :XRay, xray_extension_module
provider_module
end
|