Mercurial > hg > Members > kono > Cerium
changeset 925:9da903858400
add profile in Redering Engine
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 30 Jul 2010 16:57:17 +0900 |
parents | ad6903dd6419 |
children | 104fcf4c6af5 |
files | Renderer/Engine/main.cc Renderer/Engine/viewer.cc Renderer/Engine/viewer.h TaskManager/Cell/spe/CellDmaManager.cc |
diffstat | 4 files changed, 22 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/main.cc Fri Jul 30 16:40:30 2010 +0900 +++ b/Renderer/Engine/main.cc Fri Jul 30 16:57:17 2010 +0900 @@ -33,6 +33,7 @@ video_type vtype = VTYPE_SDL; int mem_flag = 0; + int profile = 0; for(int i = 1; argv[i]; ++i) { @@ -48,6 +49,9 @@ if (strcmp(argv[i], "-cpu") == 0) { spenum = atoi(argv[++i]); } + if (strcmp(argv[i], "-p") == 0) { + profile = 1; + } if (strcmp(argv[i], "-video") == 0) { if (strcmp(argv[i+1], "sdl") == 0) { vtype = VTYPE_SDL; @@ -78,6 +82,7 @@ } screen->mem_flag = mem_flag; + screen->profile = 1; screen->run_init(manager, application()); return 0;
--- a/Renderer/Engine/viewer.cc Fri Jul 30 16:40:30 2010 +0900 +++ b/Renderer/Engine/viewer.cc Fri Jul 30 16:57:17 2010 +0900 @@ -940,6 +940,11 @@ } data_update_wait->spawn(); + if (profile) { + if (frames % 1000) { + manager->show_profile(); + } + } } @@ -950,6 +955,9 @@ if (this_time != start_time) { printf("%f FPS\n", (((float)frames)/(this_time-start_time))*1000.0); } + if (profile) { + manager->show_profile(); + } delete sgroot; // delete sgroot_2;
--- a/Renderer/Engine/viewer.h Fri Jul 30 16:40:30 2010 +0900 +++ b/Renderer/Engine/viewer.h Fri Jul 30 16:57:17 2010 +0900 @@ -19,7 +19,7 @@ class Viewer : public MainLoop { public: - Viewer(){}; + Viewer(){ profile = 0;}; Viewer(TaskManager *manager, ViewerDevice *dev, int bpp, int width, int height, int spenum); virtual ~Viewer() {} @@ -51,6 +51,7 @@ Uint32 *pixels; int mem_flag; + int profile; SceneGraphRoot *sgroot;
--- a/TaskManager/Cell/spe/CellDmaManager.cc Fri Jul 30 16:40:30 2010 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Fri Jul 30 16:57:17 2010 +0900 @@ -89,6 +89,9 @@ void CellDmaManager::start_profile() { + global_busy_time = 0; + global_mail_time = 0; + global_wait_time = 0; start_dmawait_profile = &CellDmaManager::do_start_dmawait_profile; end_dmawait_profile = &CellDmaManager::do_end_dmawait_profile; } @@ -145,6 +148,10 @@ " mail_time = %lld(%.3g%%), " " busy_ratio = %.3g%%\n", cpu, global_busy_time, global_wait_time, d, global_mail_time, m, r); + + global_busy_time = 0; + global_mail_time = 0; + global_wait_time = 0; }