Skip to content

Commit

Permalink
Get pause/resume tests passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Savage committed Jan 7, 2013
1 parent 9af9bfd commit c9d2c0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ext/ruby_prof/rp_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ prof_stack_pop(prof_stack_t *stack, double measurement)
frame = --stack->ptr;

/* Calculate the total time this method took */
//prof_frame_unpause(frame, measurement);
prof_frame_unpause(frame, measurement);
total_time = measurement - frame->start_time - frame->dead_time;
self_time = total_time - frame->child_time - frame->wait_time;

Expand Down
9 changes: 4 additions & 5 deletions ext/ruby_prof/rp_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,25 +179,24 @@ switch_thread(void* prof, VALUE thread_id)
return thread_data;
}


int pause_thread(st_data_t key, st_data_t value, st_data_t data)
{
thread_data_t* thread_data = (thread_data_t *) value;
double measurement = (double) data;
prof_profile_t* profile = (prof_profile_t*)data;

prof_frame_t* frame = prof_stack_peek(thread_data->stack);
prof_frame_pause(frame, measurement);
prof_frame_pause(frame, profile->measurement_at_pause_resume);

return ST_CONTINUE;
}

int unpause_thread(st_data_t key, st_data_t value, st_data_t data)
{
thread_data_t* thread_data = (thread_data_t *) value;
double measurement = (double) data;
prof_profile_t* profile = (prof_profile_t*)data;

prof_frame_t* frame = prof_stack_peek(thread_data->stack);
prof_frame_unpause(frame, measurement);
prof_frame_unpause(frame, profile->measurement_at_pause_resume);

return ST_CONTINUE;
}
Expand Down

0 comments on commit c9d2c0a

Please sign in to comment.