cell: enable #define CACHE_STATS to print a cache report upon exit

This commit is contained in:
Brian 2008-04-01 11:05:32 -06:00
parent f3a62372bf
commit f8c09464f8
3 changed files with 23 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#define CACHE_SET_TAGID(set) (((set) & 0x03) + TAG_DCACHE0)
#define CACHE_LOG2NNWAY 2
#define CACHE_LOG2NSETS 6
/*#define CACHE_STATS 1*/
#include <cache-api.h>
/* Yes folks, this is ugly.
@ -123,3 +124,20 @@ spu_dcache_mark_dirty(unsigned ea, unsigned size)
? (entry & ~CACHELINE_VALID) : entry;
}
}
/**
* Print cache utilization report
*/
void
spu_dcache_report(void)
{
#ifdef CACHE_STATS
if (spu.init.id == 0) {
printf("SPU 0: Texture cache report:\n");
cache_pr_stats(data);
}
#endif
}

View File

@ -31,4 +31,7 @@ spu_dcache_fetch_unaligned(qword *dst, unsigned ea, unsigned size);
extern void
spu_dcache_mark_dirty(unsigned ea, unsigned size);
extern void
spu_dcache_report(void);
#endif /* SPU_DCACHE_H */

View File

@ -629,6 +629,8 @@ main_loop(void)
if (Debug)
printf("SPU %u: Exit main loop\n", spu.init.id);
spu_dcache_report();
}