summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-04-01 11:05:32 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-04-01 11:05:32 -0600
commitf8c09464f801e97b24ccdb1ba70444c60d4235bd (patch)
tree8d52683b333960d76fa168a357200072554371af
parentf3a62372bf155d14876f98b1a085841607bb344c (diff)
cell: enable #define CACHE_STATS to print a cache report upon exit
-rw-r--r--src/gallium/drivers/cell/spu/spu_dcache.c18
-rw-r--r--src/gallium/drivers/cell/spu/spu_dcache.h3
-rw-r--r--src/gallium/drivers/cell/spu/spu_main.c2
3 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_dcache.c b/src/gallium/drivers/cell/spu/spu_dcache.c
index a1701d80d1..167404cdc5 100644
--- a/src/gallium/drivers/cell/spu/spu_dcache.c
+++ b/src/gallium/drivers/cell/spu/spu_dcache.c
@@ -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
+}
+
+
diff --git a/src/gallium/drivers/cell/spu/spu_dcache.h b/src/gallium/drivers/cell/spu/spu_dcache.h
index 7a06b8c25a..39a19eb31b 100644
--- a/src/gallium/drivers/cell/spu/spu_dcache.h
+++ b/src/gallium/drivers/cell/spu/spu_dcache.h
@@ -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 */
diff --git a/src/gallium/drivers/cell/spu/spu_main.c b/src/gallium/drivers/cell/spu/spu_main.c
index 7f0473d198..5b5a570a3c 100644
--- a/src/gallium/drivers/cell/spu/spu_main.c
+++ b/src/gallium/drivers/cell/spu/spu_main.c
@@ -629,6 +629,8 @@ main_loop(void)
if (Debug)
printf("SPU %u: Exit main loop\n", spu.init.id);
+
+ spu_dcache_report();
}