aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/fault.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-06-28 20:58:07 -0400
committerPaul Mackerras <paulus@samba.org>2007-07-03 01:24:46 -0400
commitfe2f896d67b89a409c366c9a69e30291ab124467 (patch)
treedf0cc1fa1923f03b90920dd399640e7b462a8171 /arch/powerpc/platforms/cell/spufs/fault.c
parent27449971e6907ff38bde7bbc4647e55bd7309fc3 (diff)
[POWERPC] spufs: Add spu stats in sysfs
Export spu statistics in sysfs. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/fault.c')
-rw-r--r--arch/powerpc/platforms/cell/spufs/fault.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/fault.c b/arch/powerpc/platforms/cell/spufs/fault.c
index 3a9e49a24ec0..e064d0c0d80e 100644
--- a/arch/powerpc/platforms/cell/spufs/fault.c
+++ b/arch/powerpc/platforms/cell/spufs/fault.c
@@ -187,6 +187,10 @@ int spufs_handle_class1(struct spu_context *ctx)
187 dsisr, ctx->state); 187 dsisr, ctx->state);
188 188
189 ctx->stats.hash_flt++; 189 ctx->stats.hash_flt++;
190 if (ctx->state == SPU_STATE_RUNNABLE) {
191 ctx->spu->stats.hash_flt++;
192 spu_switch_state(ctx->spu, SPU_UTIL_IOWAIT);
193 }
190 194
191 /* we must not hold the lock when entering spu_handle_mm_fault */ 195 /* we must not hold the lock when entering spu_handle_mm_fault */
192 spu_release(ctx); 196 spu_release(ctx);
@@ -212,6 +216,12 @@ int spufs_handle_class1(struct spu_context *ctx)
212 ctx->stats.min_flt++; 216 ctx->stats.min_flt++;
213 else 217 else
214 ctx->stats.maj_flt++; 218 ctx->stats.maj_flt++;
219 if (ctx->state == SPU_STATE_RUNNABLE) {
220 if (flt == VM_FAULT_MINOR)
221 ctx->spu->stats.min_flt++;
222 else
223 ctx->spu->stats.maj_flt++;
224 }
215 225
216 if (ctx->spu) 226 if (ctx->spu)
217 ctx->ops->restart_dma(ctx); 227 ctx->ops->restart_dma(ctx);