Class: RubyProf::Thread

Inherits:
Object
  • Object
show all
Defined in:
ext/ruby_prof/rp_thread.c

Instance Method Summary collapse

Instance Method Details

#idNumeric

Returns the id of this thread.

Returns:

  • (Numeric)


199
200
201
202
203
204
# File 'ext/ruby_prof/rp_thread.c', line 199

static VALUE
prof_thread_id(VALUE self)
{
    thread_data_t* thread = prof_get_thread(self);
	return thread->thread_id;
}

#methodsArray of MethodInfo

Returns an array of methods that were called from this thread during program execution.

Returns:



211
212
213
214
215
216
217
218
219
220
221
# File 'ext/ruby_prof/rp_thread.c', line 211

static VALUE
prof_thread_methods(VALUE self)
{
    thread_data_t* thread = prof_get_thread(self);
	if (thread->methods == Qnil)
	{
		thread->methods = rb_ary_new();
	    st_foreach(thread->method_table, collect_methods, thread->methods);
	}
	return thread->methods;
}

#methodMethodInfo

Returns the top level method for this thread (ie, the starting method).

Returns:



228
229
230
231
232
233
# File 'ext/ruby_prof/rp_thread.c', line 228

static VALUE
prof_thread_top_method(VALUE self)
{
    thread_data_t* thread = prof_get_thread(self);
	return  prof_method_wrap(thread->top);
}