aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2010-08-30 21:59:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-09-02 00:07:32 -0400
commit872e439a45ed4a4bd499bc55cb0dffa74027f749 (patch)
tree2f07a64553b25fb0a457832722b46ee9549b74cb /arch/powerpc/include
parentcf9efce0ce3136fa076f53e53154e98455229514 (diff)
powerpc/pseries: Re-enable dispatch trace log userspace interface
Since the cpu accounting code uses the hypervisor dispatch trace log now when CONFIG_VIRT_CPU_ACCOUNTING = y, the previous commit disabled access to it via files in the /sys/kernel/debug/powerpc/dtl/ directory in that case. This restores those files. To do this, we now have a hook that the cpu accounting code will call as it processes each entry from the hypervisor dispatch trace log. The code in dtl.c now uses that to fill up its ring buffer, rather than having the hypervisor fill the ring buffer directly. This also fixes dtl_file_read() to handle overflow conditions a bit better and adds a spinlock to ensure that race conditions (multiple processes opening or reading the file concurrently) are handled correctly. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/lppaca.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index cfb85ec85750..7f5e0fefebb0 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -191,6 +191,14 @@ struct dtl_entry {
191#define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */ 191#define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */
192#define N_DISPATCH_LOG (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry)) 192#define N_DISPATCH_LOG (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry))
193 193
194/*
195 * When CONFIG_VIRT_CPU_ACCOUNTING = y, the cpu accounting code controls
196 * reading from the dispatch trace log. If other code wants to consume
197 * DTL entries, it can set this pointer to a function that will get
198 * called once for each DTL entry that gets processed.
199 */
200extern void (*dtl_consumer)(struct dtl_entry *entry, u64 index);
201
194#endif /* CONFIG_PPC_BOOK3S */ 202#endif /* CONFIG_PPC_BOOK3S */
195#endif /* __KERNEL__ */ 203#endif /* __KERNEL__ */
196#endif /* _ASM_POWERPC_LPPACA_H */ 204#endif /* _ASM_POWERPC_LPPACA_H */