Class: StaticTracing::Provider
- Inherits:
-
Object
- Object
- StaticTracing::Provider
show all
- Defined in:
- lib/ruby-static-tracing/provider.rb,
ext/ruby-static-tracing/darwin/ruby_static_tracing.c,
ext/ruby-static-tracing/linux/ruby_static_tracing.c
Overview
Provider is the wrapper around libstapsdt
Defined Under Namespace
Classes: ProviderNotFound
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(namespace) ⇒ Provider
Returns a new instance of Provider.
44
45
46
47
48
49
50
51
|
# File 'lib/ruby-static-tracing/provider.rb', line 44
def initialize(namespace)
if StaticTracing::Platform.supported_platform?
provider_initialize(namespace)
else
StaticTracing.issue_disabled_tracepoints_warning
end
@namespace = namespace
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5
6
7
|
# File 'lib/ruby-static-tracing/provider.rb', line 5
def name
@name
end
|
#namespace ⇒ Object
Returns the value of attribute namespace.
42
43
44
|
# File 'lib/ruby-static-tracing/provider.rb', line 42
def namespace
@namespace
end
|
Class Method Details
.clean ⇒ Object
31
32
33
|
# File 'lib/ruby-static-tracing/provider.rb', line 31
def clean
@providers = {}
end
|
.disable! ⇒ Object
25
26
27
28
29
|
# File 'lib/ruby-static-tracing/provider.rb', line 25
def disable!
providers.values.each do |provider|
provider.disable
end
end
|
.enable! ⇒ Object
19
20
21
22
23
|
# File 'lib/ruby-static-tracing/provider.rb', line 19
def enable!
providers.values.each do |provider|
provider.enable
end
end
|
.fetch(namespace) ⇒ Object
13
14
15
16
17
|
# File 'lib/ruby-static-tracing/provider.rb', line 13
def fetch(namespace)
providers.fetch(namespace) do
raise ProviderNotFound
end
end
|
.register(namespace) ⇒ Object
9
10
11
|
# File 'lib/ruby-static-tracing/provider.rb', line 9
def register(namespace)
providers[namespace] ||= new(namespace)
end
|
Instance Method Details
#add_tracepoint(method_name, *args) ⇒ Object
53
54
55
|
# File 'lib/ruby-static-tracing/provider.rb', line 53
def add_tracepoint(method_name, *args)
Tracepoint.new(namespace, method_name, *args)
end
|
#destroy ⇒ Object
71
72
|
# File 'lib/ruby-static-tracing/provider.rb', line 71
def destroy
end
|
#disable ⇒ Object
64
65
|
# File 'lib/ruby-static-tracing/provider.rb', line 64
def disable
end
|
#enable ⇒ Object
FIXME - how to store list of tracepoints on provider? Allocate map in C?
def tracepoints
[]
end
61
62
|
# File 'lib/ruby-static-tracing/provider.rb', line 61
def enable
end
|
#enabled? ⇒ Boolean
FIXME add binding to check if enabled
68
69
|
# File 'lib/ruby-static-tracing/provider.rb', line 68
def enabled?
end
|
#provider_initialize ⇒ Object
74
75
|
# File 'lib/ruby-static-tracing/provider.rb', line 74
def provider_initialize(*)
end
|