diff options
author | Christoph Hellwig <hch@lst.de> | 2007-06-29 10:58:07 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-07-03 15:24:46 +1000 |
commit | fe2f896d67b89a409c366c9a69e30291ab124467 (patch) | |
tree | df0cc1fa1923f03b90920dd399640e7b462a8171 /arch/powerpc/platforms/cell/spufs/spufs.h | |
parent | 27449971e6907ff38bde7bbc4647e55bd7309fc3 (diff) | |
download | linux-fe2f896d67b89a409c366c9a69e30291ab124467.tar.gz linux-fe2f896d67b89a409c366c9a69e30291ab124467.tar.bz2 linux-fe2f896d67b89a409c366c9a69e30291ab124467.zip |
[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 cd2b54f6e378..08b3530288ac 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 |