Class: Babeltrace::Trace

Inherits:
Object
  • Object
show all
Defined in:
lib/babeltrace/trace_handle.rb

Direct Known Subclasses

CTF::Trace

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, handle_id) ⇒ Trace

Returns a new instance of Trace.



5
6
7
8
# File 'lib/babeltrace/trace_handle.rb', line 5

def initialize(context, handle_id)
  @context = context
  @handle_id = handle_id
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



3
4
5
# File 'lib/babeltrace/trace_handle.rb', line 3

def context
  @context
end

#handle_idObject (readonly)

Returns the value of attribute handle_id.



4
5
6
# File 'lib/babeltrace/trace_handle.rb', line 4

def handle_id
  @handle_id
end

Instance Method Details

#get_pathObject



10
11
12
# File 'lib/babeltrace/trace_handle.rb', line 10

def get_path
  Babeltrace.bt_trace_handle_get_path(@context, @handle_id)
end

#get_timestamp_begin(clock_type = :REAL) ⇒ Object



14
15
16
17
# File 'lib/babeltrace/trace_handle.rb', line 14

def get_timestamp_begin(clock_type = :REAL)
  t = Babeltrace.bt_trace_handle_get_timestamp_begin(@context, @handle_id, clock_type)
  t = Time.at(0, t, :nsec) if clock_type == :REAL
end

#get_timestamp_end(clock_type = :REAL) ⇒ Object



19
20
21
22
# File 'lib/babeltrace/trace_handle.rb', line 19

def get_timestamp_end(clock_type = :REAL)
  t = Babeltrace.bt_trace_handle_get_timestamp_end(@context, @handle_id, clock_type)
  t = Time.at(0, t, :nsec) if clock_type == :REAL
end