Class: StaticTracing::Tracepoint

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-static-tracing/tracepoint.rb

Overview

:nodoc:

Defined Under Namespace

Classes: InvalidArgType, InvalidArgumentError

Constant Summary collapse

VALID_ARGS_TYPES =
[Integer, String]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider, name, *args) ⇒ Tracepoint

Returns a new instance of Tracepoint.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby-static-tracing/tracepoint.rb', line 13

def initialize(provider, name, *args)
  @provider = provider
  @name = name
  validate_args(args)
  @args = args

  if StaticTracing::Platform.linux?
    tracepoint_initialize(provider, name, args)
  else
    StaticTracing.issue_disabled_tracepoints_warning
  end
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



11
12
13
# File 'lib/ruby-static-tracing/tracepoint.rb', line 11

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/ruby-static-tracing/tracepoint.rb', line 11

def name
  @name
end

#providerObject (readonly)

Returns the value of attribute provider.



11
12
13
# File 'lib/ruby-static-tracing/tracepoint.rb', line 11

def provider
  @provider
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


32
33
# File 'lib/ruby-static-tracing/tracepoint.rb', line 32

def enabled?
end

#fire(*values) ⇒ Object



26
27
28
29
30
# File 'lib/ruby-static-tracing/tracepoint.rb', line 26

def fire(*values)
  values.each_with_index do |arg, i|
    raise InvalidArgumentError unless arg.is_a?(args[i])
  end
end