diff options
author | Christoph Hellwig <hch@lst.de> | 2007-06-29 00:58:07 (GMT) |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-07-03 05:24:46 (GMT) |
commit | fe2f896d67b89a409c366c9a69e30291ab124467 (patch) | |
tree | df0cc1fa1923f03b90920dd399640e7b462a8171 /arch/powerpc/platforms/cell/spufs/spufs.h | |
parent | 27449971e6907ff38bde7bbc4647e55bd7309fc3 (diff) | |
download | linux-fsl-qoriq-fe2f896d67b89a409c366c9a69e30291ab124467.tar.xz |
[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/spufs.h')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/spufs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index cd2b54f..08b3530 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h @@ -307,4 +307,17 @@ static inline void spuctx_switch_state(struct spu_context *ctx, } } +static inline void spu_switch_state(struct spu *spu, + enum spuctx_execution_state new_state) +{ + if (spu->stats.utilization_state != new_state) { + unsigned long curtime = jiffies; + + spu->stats.times[spu->stats.utilization_state] += + curtime - spu->stats.tstamp; + spu->stats.tstamp = curtime; + spu->stats.utilization_state = new_state; + } +} + #endif |