Module: Perfetto
- Defined in:
- lib/perfetto.rb,
lib/perfetto/version.rb,
lib/perfetto/perfetto.rb,
lib/perfetto/configure.rb,
lib/perfetto/middleware.rb,
lib/perfetto/interceptor.rb,
ext/perfetto/perfetto.c
Overview
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength
Defined Under Namespace
Modules: Interceptor
Classes: Configure, Middleware
Constant Summary
collapse
- VERSION =
"0.1.16"
Class Method Summary
collapse
-
.fiber_trace_event_begin(category, name) ⇒ Object
(also: trace_event_begin)
-
.fiber_trace_event_begin_with_debug_info(category, name, debug_info_key, debug_info_value) ⇒ Object
(also: trace_event_begin_with_debug_info)
-
.fiber_trace_event_end(category) ⇒ Object
(also: trace_event_end)
-
.fiber_trace_event_instant(category, name) ⇒ Object
(also: trace_event_instant)
-
.fiber_trace_event_instant_with_debug_info(category, name, debug_info_key, debug_info_value) ⇒ Object
(also: trace_event_instant_with_debug_info)
-
.setup(enable_tracing: nil, enable_fiber: nil, buffer_size_kb: nil) ⇒ Object
-
.start_tracing(buffer_size_kb) ⇒ Object
-
.start_tracing_native ⇒ Object
-
.stop_tracing(output_file) ⇒ Object
-
.stop_tracing_native ⇒ Object
-
.thread_trace_event_begin ⇒ Object
Replace thread based methods with fiber based methods.
-
.thread_trace_event_begin_with_debug_info ⇒ Object
-
.thread_trace_event_end ⇒ Object
-
.thread_trace_event_instant ⇒ Object
-
.thread_trace_event_instant_with_debug_info ⇒ Object
-
.trace_counter(category, name, value) ⇒ Object
-
.trace_counter_double(category, name, value) ⇒ Object
-
.trace_counter_i64(category, name, value) ⇒ Object
Class Method Details
.fiber_trace_event_begin(category, name) ⇒ Object
Also known as:
trace_event_begin
88
89
90
91
92
|
# File 'ext/perfetto/perfetto.c', line 88
static VALUE rb_perfetto_fiber_trace_event_begin(VALUE self, VALUE category, VALUE name)
{
perfetto_fiber_trace_event_begin(StringValuePtr(category), StringValuePtr(name), current_fiber_object_id());
return Qnil;
}
|
.fiber_trace_event_begin_with_debug_info(category, name, debug_info_key, debug_info_value) ⇒ Object
Also known as:
trace_event_begin_with_debug_info
112
113
114
115
116
|
# File 'ext/perfetto/perfetto.c', line 112
static VALUE rb_perfetto_fiber_trace_event_begin_with_debug_info(VALUE self, VALUE category, VALUE name, VALUE debug_info_key, VALUE debug_info_value)
{
perfetto_fiber_trace_event_begin_with_debug_info(StringValuePtr(category), StringValuePtr(name), StringValuePtr(debug_info_key), StringValuePtr(debug_info_value), current_fiber_object_id());
return Qnil;
}
|
.fiber_trace_event_end(category) ⇒ Object
Also known as:
trace_event_end
94
95
96
97
98
|
# File 'ext/perfetto/perfetto.c', line 94
static VALUE rb_perfetto_fiber_trace_event_end(VALUE self, VALUE category)
{
perfetto_fiber_trace_event_end(StringValuePtr(category), current_fiber_object_id());
return Qnil;
}
|
.fiber_trace_event_instant(category, name) ⇒ Object
Also known as:
trace_event_instant
100
101
102
103
104
|
# File 'ext/perfetto/perfetto.c', line 100
static VALUE rb_perfetto_fiber_trace_event_instant(VALUE self, VALUE category, VALUE name)
{
perfetto_fiber_trace_event_instant(StringValuePtr(category), StringValuePtr(name), current_fiber_object_id());
return Qnil;
}
|
.fiber_trace_event_instant_with_debug_info(category, name, debug_info_key, debug_info_value) ⇒ Object
Also known as:
trace_event_instant_with_debug_info
106
107
108
109
110
|
# File 'ext/perfetto/perfetto.c', line 106
static VALUE rb_perfetto_fiber_trace_event_instant_with_debug_info(VALUE self, VALUE category, VALUE name, VALUE debug_info_key, VALUE debug_info_value)
{
perfetto_fiber_trace_event_instant_with_debug_info(StringValuePtr(category), StringValuePtr(name), StringValuePtr(debug_info_key), StringValuePtr(debug_info_value), current_fiber_object_id());
return Qnil;
}
|
.setup(enable_tracing: nil, enable_fiber: nil, buffer_size_kb: nil) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/perfetto.rb', line 18
def self.setup(enable_tracing: nil, enable_fiber: nil, buffer_size_kb: nil)
Configure.enable_tracing = enable_tracing unless enable_tracing.nil?
Configure.enable_fiber = enable_fiber unless enable_fiber.nil?
Configure.buffer_size_kb = buffer_size_kb unless buffer_size_kb.nil?
require_relative "perfetto/perfetto_native"
require_relative "perfetto/perfetto"
require_relative "perfetto/interceptor"
end
|
.start_tracing(buffer_size_kb) ⇒ Object
29
30
31
|
# File 'lib/perfetto/perfetto.rb', line 29
def self.start_tracing
start_tracing_native Configure.buffer_size_kb
end
|
.start_tracing_native ⇒ Object
6
|
# File 'lib/perfetto/perfetto.rb', line 6
alias start_tracing_native start_tracing
|
.stop_tracing(output_file) ⇒ Object
17
18
19
|
# File 'ext/perfetto/perfetto.c', line 17
def self.stop_tracing(trace_file_name = "#{Time.now.strftime("%Y%m%d-%H-%M-%S")}.pftrace")
stop_tracing_native trace_file_name
end
|
.stop_tracing_native ⇒ Object
7
|
# File 'lib/perfetto/perfetto.rb', line 7
alias stop_tracing_native stop_tracing
|
.thread_trace_event_begin ⇒ Object
Replace thread based methods with fiber based methods
14
|
# File 'lib/perfetto/perfetto.rb', line 14
alias thread_trace_event_begin trace_event_begin
|
.thread_trace_event_begin_with_debug_info ⇒ Object
17
|
# File 'lib/perfetto/perfetto.rb', line 17
alias thread_trace_event_begin_with_debug_info trace_event_begin_with_debug_info
|
.thread_trace_event_end ⇒ Object
15
|
# File 'lib/perfetto/perfetto.rb', line 15
alias thread_trace_event_end trace_event_end
|
.thread_trace_event_instant ⇒ Object
16
|
# File 'lib/perfetto/perfetto.rb', line 16
alias thread_trace_event_instant trace_event_instant
|
.thread_trace_event_instant_with_debug_info ⇒ Object
18
|
# File 'lib/perfetto/perfetto.rb', line 18
alias thread_trace_event_instant_with_debug_info trace_event_instant_with_debug_info
|
.trace_counter(category, name, value) ⇒ Object
64
|
# File 'ext/perfetto/perfetto.c', line 64
def self.trace_counter(_class_name, _counter_name, _counter_value); end
|
.trace_counter_double(category, name, value) ⇒ Object
40
|
# File 'ext/perfetto/perfetto.c', line 40
def self.trace_counter_double(_class_name, _counter_name, _counter_value); end
|
.trace_counter_i64(category, name, value) ⇒ Object
34
|
# File 'ext/perfetto/perfetto.c', line 34
def self.trace_counter_i64(_class_name, _counter_name, _counter_value); end
|