Class: StaticTracing::Provider
- Inherits:
-
Object
- Object
- StaticTracing::Provider
- Defined in:
- lib/ruby-static-tracing/provider.rb,
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
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Class Method Summary collapse
Instance Method Summary collapse
- #add_tracepoint(method_name, *args) ⇒ Object
- #destroy ⇒ Object
- #disable ⇒ Object
-
#enable ⇒ Object
FIXME - how to store list of tracepoints on provider? Allocate map in C? def tracepoints [] end.
-
#enabled? ⇒ Boolean
FIXME add binding to check if enabled.
-
#initialize(namespace) ⇒ Provider
constructor
A new instance of Provider.
- #provider_initialize ⇒ Object
Constructor Details
#initialize(namespace) ⇒ Provider
Returns a new instance of Provider.
28 29 30 31 32 33 34 35 |
# File 'lib/ruby-static-tracing/provider.rb', line 28 def initialize(namespace) if StaticTracing::Platform.linux? 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 (readonly)
Returns the value of attribute namespace.
26 27 28 |
# File 'lib/ruby-static-tracing/provider.rb', line 26 def namespace @namespace end |
Class Method Details
.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
37 38 39 |
# File 'lib/ruby-static-tracing/provider.rb', line 37 def add_tracepoint(method_name, *args) Tracepoint.new(namespace, method_name, *args) end |
#destroy ⇒ Object
55 56 |
# File 'lib/ruby-static-tracing/provider.rb', line 55 def destroy end |
#disable ⇒ Object
48 49 |
# File 'lib/ruby-static-tracing/provider.rb', line 48 def disable end |
#enable ⇒ Object
FIXME - how to store list of tracepoints on provider? Allocate map in C?
def tracepoints
[]
end
45 46 |
# File 'lib/ruby-static-tracing/provider.rb', line 45 def enable end |
#enabled? ⇒ Boolean
FIXME add binding to check if enabled
52 53 |
# File 'lib/ruby-static-tracing/provider.rb', line 52 def enabled? end |
#provider_initialize ⇒ Object
58 59 |
# File 'lib/ruby-static-tracing/provider.rb', line 58 def provider_initialize(*) end |