Rename retro_perf_start/retro_perf_stop

This commit is contained in:
twinaphex 2016-05-16 09:53:54 +02:00
parent 18355d4748
commit f5bc75c640
20 changed files with 45 additions and 45 deletions

View File

@ -537,7 +537,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
return false; return false;
rarch_perf_init(&audio_convert_s16, "audio_convert_s16"); rarch_perf_init(&audio_convert_s16, "audio_convert_s16");
retro_perf_start(&audio_convert_s16); performance_counter_start(&audio_convert_s16);
audio_convert_s16_to_float(audio_driver_data.data, data, samples, audio_convert_s16_to_float(audio_driver_data.data, data, samples,
audio_driver_data.volume_gain); audio_driver_data.volume_gain);
performance_counter_stop(&audio_convert_s16); performance_counter_stop(&audio_convert_s16);
@ -551,7 +551,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
if (audio_driver_data.dsp) if (audio_driver_data.dsp)
{ {
rarch_perf_init(&audio_dsp, "audio_dsp"); rarch_perf_init(&audio_dsp, "audio_dsp");
retro_perf_start(&audio_dsp); performance_counter_start(&audio_dsp);
rarch_dsp_filter_process(audio_driver_data.dsp, &dsp_data); rarch_dsp_filter_process(audio_driver_data.dsp, &dsp_data);
performance_counter_stop(&audio_dsp); performance_counter_stop(&audio_dsp);
@ -580,7 +580,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
if (!audio_driver_data.use_float) if (!audio_driver_data.use_float)
{ {
rarch_perf_init(&audio_convert_float, "audio_convert_float"); rarch_perf_init(&audio_convert_float, "audio_convert_float");
retro_perf_start(&audio_convert_float); performance_counter_start(&audio_convert_float);
audio_convert_float_to_s16(audio_driver_data.output_samples.conv_buf, audio_convert_float_to_s16(audio_driver_data.output_samples.conv_buf,
(const float*)output_data, output_frames * 2); (const float*)output_data, output_frames * 2);
performance_counter_stop(&audio_convert_float); performance_counter_stop(&audio_convert_float);
@ -837,7 +837,7 @@ bool audio_driver_init_resampler(void)
void audio_driver_process_resampler(struct resampler_data *data) void audio_driver_process_resampler(struct resampler_data *data)
{ {
rarch_perf_init(&resampler_proc, "resampler_proc"); rarch_perf_init(&resampler_proc, "resampler_proc");
retro_perf_start(&resampler_proc); performance_counter_start(&resampler_proc);
rarch_resampler_process(audio_driver_resampler, rarch_resampler_process(audio_driver_resampler,
audio_driver_resampler_data, data); audio_driver_resampler_data, data);
performance_counter_stop(&resampler_proc); performance_counter_stop(&resampler_proc);

View File

@ -170,7 +170,7 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
(void)current_tick; (void)current_tick;
rarch_perf_init(&ctraudio_f, "ctraudio_f"); rarch_perf_init(&ctraudio_f, "ctraudio_f");
retro_perf_start(&ctraudio_f); performance_counter_start(&ctraudio_f);
ctr_csnd_audio_update_playpos(ctr); ctr_csnd_audio_update_playpos(ctr);

View File

@ -117,7 +117,7 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
} }
rarch_perf_init(&ctraudio_dsp_f, "ctraudio_dsp_f"); rarch_perf_init(&ctraudio_dsp_f, "ctraudio_dsp_f");
retro_perf_start(&ctraudio_dsp_f); performance_counter_start(&ctraudio_dsp_f);
pos = ctr->pos << 2; pos = ctr->pos << 2;

View File

@ -71,7 +71,7 @@ static void process_image(video4linux_t *v4l, const uint8_t *buffer_yuv)
static struct retro_perf_counter yuv_convert_direct = {0}; static struct retro_perf_counter yuv_convert_direct = {0};
rarch_perf_init(&yuv_convert_direct, "yuv_convert_direct"); rarch_perf_init(&yuv_convert_direct, "yuv_convert_direct");
retro_perf_start(&yuv_convert_direct); performance_counter_start(&yuv_convert_direct);
scaler_ctx_scale(&v4l->scaler, v4l->buffer_output, buffer_yuv); scaler_ctx_scale(&v4l->scaler, v4l->buffer_output, buffer_yuv);
performance_counter_stop(&yuv_convert_direct); performance_counter_stop(&yuv_convert_direct);
} }

View File

@ -1228,7 +1228,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
cb->get_perf_counter = cpu_features_get_perf_counter; cb->get_perf_counter = cpu_features_get_perf_counter;
cb->perf_register = retro_perf_register; cb->perf_register = retro_perf_register;
cb->perf_start = retro_perf_start; cb->perf_start = performance_counter_start;
cb->perf_stop = performance_counter_stop; cb->perf_stop = performance_counter_stop;
cb->perf_log = retro_perf_log; cb->perf_log = retro_perf_log;
break; break;

View File

@ -1448,7 +1448,7 @@ static bool d3d_frame(void *data, const void *frame,
video_driver_get_size(&width, &height); video_driver_get_size(&width, &height);
rarch_perf_init(&d3d_frame, "d3d_frame"); rarch_perf_init(&d3d_frame, "d3d_frame");
retro_perf_start(&d3d_frame); performance_counter_start(&d3d_frame);
/* We cannot recover in fullscreen. */ /* We cannot recover in fullscreen. */
if (d3d->needs_restore) if (d3d->needs_restore)

View File

@ -1505,7 +1505,7 @@ static bool cg_d3d9_renderchain_read_viewport(void *data, uint8_t *buffer)
video_driver_get_size(&width, &height); video_driver_get_size(&width, &height);
rarch_perf_init(&d3d_read_viewport, "d3d_read_viewport"); rarch_perf_init(&d3d_read_viewport, "d3d_read_viewport");
retro_perf_start(&d3d_read_viewport); performance_counter_start(&d3d_read_viewport);
(void)data; (void)data;
(void)buffer; (void)buffer;

View File

@ -620,7 +620,7 @@ static bool ctr_frame(void* data, const void* frame,
fflush(stdout); fflush(stdout);
rarch_perf_init(&ctrframe_f, "ctrframe_f"); rarch_perf_init(&ctrframe_f, "ctrframe_f");
retro_perf_start(&ctrframe_f); performance_counter_start(&ctrframe_f);
if (ctr->should_resize) if (ctr->should_resize)
ctr_update_viewport(ctr); ctr_update_viewport(ctr);

View File

@ -1470,7 +1470,7 @@ static INLINE void gl_copy_frame(gl_t *gl, const void *frame,
static struct retro_perf_counter copy_frame = {0}; static struct retro_perf_counter copy_frame = {0};
rarch_perf_init(&copy_frame, "copy_frame"); rarch_perf_init(&copy_frame, "copy_frame");
retro_perf_start(&copy_frame); performance_counter_start(&copy_frame);
#if defined(HAVE_OPENGLES2) #if defined(HAVE_OPENGLES2)
#if defined(HAVE_EGL) #if defined(HAVE_EGL)
@ -1661,7 +1661,7 @@ static void gl_pbo_async_readback(gl_t *gl)
/* Read asynchronously into PBO buffer. */ /* Read asynchronously into PBO buffer. */
rarch_perf_init(&async_readback, "async_readback"); rarch_perf_init(&async_readback, "async_readback");
retro_perf_start(&async_readback); performance_counter_start(&async_readback);
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
#ifdef HAVE_OPENGLES3 #ifdef HAVE_OPENGLES3
glReadPixels(gl->vp.x, gl->vp.y, glReadPixels(gl->vp.x, gl->vp.y,
@ -1771,7 +1771,7 @@ static bool gl_frame(void *data, const void *frame,
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
rarch_perf_init(&frame_run, "frame_run"); rarch_perf_init(&frame_run, "frame_run");
retro_perf_start(&frame_run); performance_counter_start(&frame_run);
if (!gl) if (!gl)
return false; return false;
@ -2023,7 +2023,7 @@ static bool gl_frame(void *data, const void *frame,
static struct retro_perf_counter gl_fence = {0}; static struct retro_perf_counter gl_fence = {0};
rarch_perf_init(&gl_fence, "gl_fence"); rarch_perf_init(&gl_fence, "gl_fence");
retro_perf_start(&gl_fence); performance_counter_start(&gl_fence);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
gl->fences[gl->fence_count++] = gl->fences[gl->fence_count++] =
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
@ -3138,7 +3138,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
context_bind_hw_render(false); context_bind_hw_render(false);
rarch_perf_init(&read_viewport, "read_viewport"); rarch_perf_init(&read_viewport, "read_viewport");
retro_perf_start(&read_viewport); performance_counter_start(&read_viewport);
num_pixels = gl->vp.width * gl->vp.height; num_pixels = gl->vp.width * gl->vp.height;

View File

@ -1438,7 +1438,7 @@ static bool gx_frame(void *data, const void *frame,
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
rarch_perf_init(&gx_frame, "gx_frame"); rarch_perf_init(&gx_frame, "gx_frame");
retro_perf_start(&gx_frame); performance_counter_start(&gx_frame);
if(!gx || (!frame && !gx->menu_texture_enable)) if(!gx || (!frame && !gx->menu_texture_enable))
return true; return true;
@ -1474,7 +1474,7 @@ static bool gx_frame(void *data, const void *frame,
static struct retro_perf_counter gx_frame_convert = {0}; static struct retro_perf_counter gx_frame_convert = {0};
rarch_perf_init(&gx_frame_convert, "gx_frame_convert"); rarch_perf_init(&gx_frame_convert, "gx_frame_convert");
retro_perf_start(&gx_frame_convert); performance_counter_start(&gx_frame_convert);
if (gx->rgb32) if (gx->rgb32)
convert_texture32(frame, g_tex.data, width, height, pitch); convert_texture32(frame, g_tex.data, width, height, pitch);

View File

@ -527,7 +527,7 @@ static bool psp_frame(void *data, const void *frame,
psp->draw_buffer = FROM_GU_POINTER(sceGuSwapBuffers()); psp->draw_buffer = FROM_GU_POINTER(sceGuSwapBuffers());
rarch_perf_init(&psp_frame_run, "psp_frame_run"); rarch_perf_init(&psp_frame_run, "psp_frame_run");
retro_perf_start(&psp_frame_run); performance_counter_start(&psp_frame_run);
if (psp->should_resize) if (psp->should_resize)
psp_update_viewport(psp); psp_update_viewport(psp);

View File

@ -348,7 +348,7 @@ static void sdl_refresh_input_size(sdl2_video_t *vid, bool menu, bool rgb32,
sdl_tex_zero(target); sdl_tex_zero(target);
rarch_perf_init(&sdl_create_texture, "sdl_create_texture"); rarch_perf_init(&sdl_create_texture, "sdl_create_texture");
retro_perf_start(&sdl_create_texture); performance_counter_start(&sdl_create_texture);
if (menu) if (menu)
format = rgb32 ? SDL_PIXELFORMAT_ARGB8888 : SDL_PIXELFORMAT_RGBA4444; format = rgb32 ? SDL_PIXELFORMAT_ARGB8888 : SDL_PIXELFORMAT_RGBA4444;
@ -512,7 +512,7 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
sdl_refresh_input_size(vid, false, vid->video.rgb32, width, height, pitch); sdl_refresh_input_size(vid, false, vid->video.rgb32, width, height, pitch);
rarch_perf_init(&sdl_copy_frame, "sdl_copy_frame"); rarch_perf_init(&sdl_copy_frame, "sdl_copy_frame");
retro_perf_start(&sdl_copy_frame); performance_counter_start(&sdl_copy_frame);
SDL_UpdateTexture(vid->frame.tex, NULL, frame, pitch); SDL_UpdateTexture(vid->frame.tex, NULL, frame, pitch);
@ -627,7 +627,7 @@ static bool sdl2_gfx_read_viewport(void *data, uint8_t *buffer)
static struct retro_perf_counter sdl2_gfx_read_viewport = {0}; static struct retro_perf_counter sdl2_gfx_read_viewport = {0};
rarch_perf_init(&sdl2_gfx_read_viewport, "sdl2_gfx_read_viewport"); rarch_perf_init(&sdl2_gfx_read_viewport, "sdl2_gfx_read_viewport");
retro_perf_start(&sdl2_gfx_read_viewport); performance_counter_start(&sdl2_gfx_read_viewport);
video_driver_cached_frame_render(); video_driver_cached_frame_render();
@ -703,7 +703,7 @@ static void sdl2_poke_set_texture_frame(void *data, const void *frame, bool rgb3
width * (rgb32 ? 4 : 2)); width * (rgb32 ? 4 : 2));
rarch_perf_init(&copy_texture_frame, "copy_texture_frame"); rarch_perf_init(&copy_texture_frame, "copy_texture_frame");
retro_perf_start(&copy_texture_frame); performance_counter_start(&copy_texture_frame);
SDL_UpdateTexture(vid->menu.tex, NULL, frame, vid->menu.pitch); SDL_UpdateTexture(vid->menu.tex, NULL, frame, vid->menu.pitch);

View File

@ -343,7 +343,7 @@ static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
SDL_LockSurface(vid->screen); SDL_LockSurface(vid->screen);
rarch_perf_init(&sdl_scale, "sdl_scale"); rarch_perf_init(&sdl_scale, "sdl_scale");
retro_perf_start(&sdl_scale); performance_counter_start(&sdl_scale);
video_frame_scale( video_frame_scale(
&vid->scaler, &vid->scaler,

View File

@ -375,7 +375,7 @@ static bool vg_frame(void *data, const void *frame,
static struct retro_perf_counter vg_image = {0}; static struct retro_perf_counter vg_image = {0};
rarch_perf_init(&vg_fr, "vg_fr"); rarch_perf_init(&vg_fr, "vg_fr");
retro_perf_start(&vg_fr); performance_counter_start(&vg_fr);
video_driver_get_size(&width, &height); video_driver_get_size(&width, &height);
@ -402,7 +402,7 @@ static bool vg_frame(void *data, const void *frame,
vgSeti(VG_SCISSORING, VG_TRUE); vgSeti(VG_SCISSORING, VG_TRUE);
rarch_perf_init(&vg_image, "vg_image"); rarch_perf_init(&vg_image, "vg_image");
retro_perf_start(&vg_image); performance_counter_start(&vg_image);
vg_copy_frame(vg, frame, frame_width, frame_height, pitch); vg_copy_frame(vg, frame, frame_width, frame_height, pitch);
performance_counter_stop(&vg_image); performance_counter_stop(&vg_image);

View File

@ -1463,7 +1463,7 @@ static bool vulkan_frame(void *data, const void *frame,
rarch_perf_init(&begin_cmd, "begin_command"); rarch_perf_init(&begin_cmd, "begin_command");
rarch_perf_init(&build_cmd, "build_command"); rarch_perf_init(&build_cmd, "build_command");
rarch_perf_init(&end_cmd, "end_command"); rarch_perf_init(&end_cmd, "end_command");
retro_perf_start(&frame_run); performance_counter_start(&frame_run);
video_driver_get_size(&width, &height); video_driver_get_size(&width, &height);
@ -1475,7 +1475,7 @@ static bool vulkan_frame(void *data, const void *frame,
vulkan_buffer_chain_discard(&chain->vbo); vulkan_buffer_chain_discard(&chain->vbo);
vulkan_buffer_chain_discard(&chain->ubo); vulkan_buffer_chain_discard(&chain->ubo);
retro_perf_start(&begin_cmd); performance_counter_start(&begin_cmd);
/* Start recording the command buffer. */ /* Start recording the command buffer. */
vk->cmd = chain->cmd; vk->cmd = chain->cmd;
begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
@ -1489,7 +1489,7 @@ static bool vulkan_frame(void *data, const void *frame,
vulkan_flush_caches(vk); vulkan_flush_caches(vk);
/* Upload texture */ /* Upload texture */
retro_perf_start(&copy_frame); performance_counter_start(&copy_frame);
if (frame && !vk->hw.enable) if (frame && !vk->hw.enable)
{ {
unsigned y; unsigned y;
@ -1544,7 +1544,7 @@ static bool vulkan_frame(void *data, const void *frame,
vulkan_filter_chain_notify_sync_index(vk->filter_chain, frame_index); vulkan_filter_chain_notify_sync_index(vk->filter_chain, frame_index);
vulkan_filter_chain_set_frame_count(vk->filter_chain, frame_count); vulkan_filter_chain_set_frame_count(vk->filter_chain, frame_count);
retro_perf_start(&build_cmd); performance_counter_start(&build_cmd);
/* Render offscreen filter chain passes. */ /* Render offscreen filter chain passes. */
{ {
/* Set the source texture in the filter chain */ /* Set the source texture in the filter chain */
@ -1717,7 +1717,7 @@ static bool vulkan_frame(void *data, const void *frame,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT); VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT);
} }
retro_perf_start(&end_cmd); performance_counter_start(&end_cmd);
VKFUNC(vkEndCommandBuffer)(vk->cmd); VKFUNC(vkEndCommandBuffer)(vk->cmd);
performance_counter_stop(&end_cmd); performance_counter_stop(&end_cmd);
@ -1753,7 +1753,7 @@ static bool vulkan_frame(void *data, const void *frame,
performance_counter_stop(&frame_run); performance_counter_stop(&frame_run);
retro_perf_start(&queue_submit); performance_counter_start(&queue_submit);
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
slock_lock(vk->context->queue_lock); slock_lock(vk->context->queue_lock);
@ -1765,7 +1765,7 @@ static bool vulkan_frame(void *data, const void *frame,
#endif #endif
performance_counter_stop(&queue_submit); performance_counter_stop(&queue_submit);
retro_perf_start(&swapbuffers); performance_counter_start(&swapbuffers);
video_context_driver_swap_buffers(); video_context_driver_swap_buffers();
performance_counter_stop(&swapbuffers); performance_counter_stop(&swapbuffers);
@ -2077,7 +2077,7 @@ static bool vulkan_read_viewport(void *data, uint8_t *buffer)
return false; return false;
rarch_perf_init(&stream_readback, "stream_readback"); rarch_perf_init(&stream_readback, "stream_readback");
retro_perf_start(&stream_readback); performance_counter_start(&stream_readback);
buffer += 3 * (vk->vp.height - 1) * vk->vp.width; buffer += 3 * (vk->vp.height - 1) * vk->vp.width;
VKFUNC(vkMapMemory)(vk->context->device, staging->memory, VKFUNC(vkMapMemory)(vk->context->device, staging->memory,

View File

@ -1069,7 +1069,7 @@ static bool video_driver_frame_filter(const void *data,
*output_pitch = (*output_width) * video_driver_state.filter.out_bpp; *output_pitch = (*output_width) * video_driver_state.filter.out_bpp;
retro_perf_start(&softfilter_process); performance_counter_start(&softfilter_process);
rarch_softfilter_process(video_driver_state.filter.filter, rarch_softfilter_process(video_driver_state.filter.filter,
video_driver_state.filter.buffer, *output_pitch, video_driver_state.filter.buffer, *output_pitch,
data, width, height, pitch); data, width, height, pitch);
@ -2060,7 +2060,7 @@ static bool video_pixel_frame_scale(const void *data,
if (data == RETRO_HW_FRAME_BUFFER_VALID) if (data == RETRO_HW_FRAME_BUFFER_VALID)
return false; return false;
retro_perf_start(&video_frame_conv); performance_counter_start(&video_frame_conv);
video_driver_scaler_ptr->scaler->in_width = width; video_driver_scaler_ptr->scaler->in_width = width;
video_driver_scaler_ptr->scaler->in_height = height; video_driver_scaler_ptr->scaler->in_height = height;

View File

@ -671,7 +671,7 @@ static bool video_thread_frame(void *data, const void *frame_,
} }
rarch_perf_init(&thr_frame, "thr_frame"); rarch_perf_init(&thr_frame, "thr_frame");
retro_perf_start(&thr_frame); performance_counter_start(&thr_frame);
copy_stride = width * (thr->info.rgb32 copy_stride = width * (thr->info.rgb32
? sizeof(uint32_t) : sizeof(uint16_t)); ? sizeof(uint32_t) : sizeof(uint16_t));

View File

@ -573,11 +573,11 @@ recheckcapacity:;
} }
rarch_perf_init(&gen_deltas, "gen_deltas"); rarch_perf_init(&gen_deltas, "gen_deltas");
retro_perf_start(&gen_deltas); performance_counter_start(&gen_deltas);
oldb = state->thisblock; oldb = state->thisblock;
newb = state->nextblock; newb = state->nextblock;
compressed = state->head + sizeof(size_t); compressed = state->head + sizeof(size_t);
compressed += state_manager_raw_compress(oldb, newb, compressed += state_manager_raw_compress(oldb, newb,
state->blocksize, compressed); state->blocksize, compressed);
@ -761,7 +761,7 @@ void state_manager_check_rewind(bool pressed)
state_manager_push_where(rewind_state.state, &state); state_manager_push_where(rewind_state.state, &state);
rarch_perf_init(&rewind_serialize, "rewind_serialize"); rarch_perf_init(&rewind_serialize, "rewind_serialize");
retro_perf_start(&rewind_serialize); performance_counter_start(&rewind_serialize);
serial_info.data = state; serial_info.data = state;
serial_info.size = rewind_state.size; serial_info.size = rewind_state.size;

View File

@ -131,7 +131,7 @@ int rarch_perf_init(struct retro_perf_counter *perf, const char *name)
return 0; return 0;
} }
void retro_perf_start(struct retro_perf_counter *perf) void performance_counter_start(struct retro_perf_counter *perf)
{ {
if (!runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL) || !perf) if (!runloop_ctl(RUNLOOP_CTL_IS_PERFCNT_ENABLE, NULL) || !perf)
return; return;

View File

@ -60,12 +60,12 @@ void rarch_perf_log(void);
int rarch_perf_init(struct retro_perf_counter *perf, const char *name); int rarch_perf_init(struct retro_perf_counter *perf, const char *name);
/** /**
* retro_perf_start: * performance_counter_start:
* @perf : pointer to performance counter * @perf : pointer to performance counter
* *
* Start performance counter. * Start performance counter.
**/ **/
void retro_perf_start(struct retro_perf_counter *perf); void performance_counter_start(struct retro_perf_counter *perf);
/** /**
* performance_counter_stop: * performance_counter_stop: