Class: StaticTracing::Provider

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/ruby-static-tracing/provider.rb', line 5

def name
  @name
end

#namespaceObject (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

#destroyObject



55
56
# File 'lib/ruby-static-tracing/provider.rb', line 55

def destroy
end

#disableObject



48
49
# File 'lib/ruby-static-tracing/provider.rb', line 48

def disable
end

#enableObject

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

Returns:

  • (Boolean)


52
53
# File 'lib/ruby-static-tracing/provider.rb', line 52

def enabled?
end

#provider_initializeObject



58
59
# File 'lib/ruby-static-tracing/provider.rb', line 58

def provider_initialize(*)
end