# HG changeset patch # User e065746@localhost.localdomain # Date 1243752900 -32400 # Node ID 8382f0f8c0b41a188eed9d2cf75f8d2e182c708d # Parent 3fd1731d6151f8719459323bd04950dec6086bc9 dma_wait diff -r 3fd1731d6151 -r 8382f0f8c0b4 TaskManager/Cell/spe/CellDmaManager.cc --- a/TaskManager/Cell/spe/CellDmaManager.cc Sat May 30 16:21:42 2009 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Sun May 31 15:55:00 2009 +0900 @@ -37,13 +37,34 @@ * * @param[in] mask Tag for Wait DMA process */ +void +CellDmaManager::start_dmawait_profile() +{ + wait_time = spu_readch(SPU_RdDec); + global_busy_time += busy_time - wait_time; + spu_writech(SPU_WrDec, 0xffffffff); +} + +void +CellDmaManager::end_dmawait_profile() +{ + wait_time = spu_readch(SPU_RdDec); + global_wait_time += 0xffffffff - wait_time; + busy_time = wait_time; +} void CellDmaManager::dma_wait(uint32 mask) { +#ifdef SPU_PROFILE + start_dmawait_profile(); +#endif mfc_write_tag_mask(1 << mask); mfc_write_tag_update_all(); mfc_read_tag_status(); +#ifdef SPU_PROFILE + end_dmawait_profile(); +#endif } void diff -r 3fd1731d6151 -r 8382f0f8c0b4 TaskManager/Cell/spe/main.cc --- a/TaskManager/Cell/spe/main.cc Sat May 30 16:21:42 2009 +0900 +++ b/TaskManager/Cell/spe/main.cc Sun May 31 15:55:00 2009 +0900 @@ -11,9 +11,9 @@ { CellScheduler *manager; - const unsigned ls_size = (unsigned)&argc; - unsigned code_size = (unsigned)&_end; - unsigned heap_size = ls_size - code_size; + //const unsigned ls_size = (unsigned)&argc; + //unsigned code_size = (unsigned)&_end; + //unsigned heap_size = ls_size - code_size; __debug(" ls_size:%10d bytes\n", ls_size); __debug("code_size:%10d bytes\n", code_size); diff -r 3fd1731d6151 -r 8382f0f8c0b4 TaskManager/kernel/main.cc --- a/TaskManager/kernel/main.cc Sat May 30 16:21:42 2009 +0900 +++ b/TaskManager/kernel/main.cc Sun May 31 15:55:00 2009 +0900 @@ -11,7 +11,7 @@ defaultTMend(void) {} TaskManager *manager; -static char *help_str = "\n\ +static char help_str[] = "\n\ * Cerium program option *\n\ -chelp Print this message \n\ -cpu Number of CPU (default 1) \n"; diff -r 3fd1731d6151 -r 8382f0f8c0b4 include/TaskManager/CellDmaManager.h --- a/include/TaskManager/CellDmaManager.h Sat May 30 16:21:42 2009 +0900 +++ b/include/TaskManager/CellDmaManager.h Sun May 31 15:55:00 2009 +0900 @@ -11,6 +11,8 @@ #include +#define SPU_PROFILE 1 + class CellDmaManager : public DmaManager { public: BASE_NEW_DELETE(CellDmaManager); @@ -21,11 +23,15 @@ } DmaList, *DmaListPtr; /* variables */ + unsigned int wait_time, busy_time; + unsigned long long global_busy_time, global_wait_time; /* functions */ void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask); void dma_store(void *buf, uint32 addr, uint32 size, uint32 mask); void dma_wait(uint32 mask) ; + void start_dmawait_profile(); + void end_dmawait_profile(); void mail_write(uint32 data); uint32 mail_read(void);