xref: /linux/arch/powerpc/include/asm/dtl.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1 #ifndef _ASM_POWERPC_DTL_H
2 #define _ASM_POWERPC_DTL_H
3 
4 #include <linux/rwsem.h>
5 #include <asm/lppaca.h>
6 
7 /*
8  * Layout of entries in the hypervisor's dispatch trace log buffer.
9  */
10 struct dtl_entry {
11 	u8	dispatch_reason;
12 	u8	preempt_reason;
13 	__be16	processor_id;
14 	__be32	enqueue_to_dispatch_time;
15 	__be32	ready_to_enqueue_time;
16 	__be32	waiting_to_ready_time;
17 	__be64	timebase;
18 	__be64	fault_addr;
19 	__be64	srr0;
20 	__be64	srr1;
21 };
22 
23 #define DISPATCH_LOG_BYTES	4096	/* bytes per cpu */
24 #define N_DISPATCH_LOG		(DISPATCH_LOG_BYTES / sizeof(struct dtl_entry))
25 
26 /*
27  * Dispatch trace log event enable mask:
28  *   0x1: voluntary virtual processor waits
29  *   0x2: time-slice preempts
30  *   0x4: virtual partition memory page faults
31  */
32 #define DTL_LOG_CEDE		0x1
33 #define DTL_LOG_PREEMPT		0x2
34 #define DTL_LOG_FAULT		0x4
35 #define DTL_LOG_ALL		(DTL_LOG_CEDE | DTL_LOG_PREEMPT | DTL_LOG_FAULT)
36 
37 extern struct kmem_cache *dtl_cache;
38 extern struct rw_semaphore dtl_access_lock;
39 
40 extern void register_dtl_buffer(int cpu);
41 extern void alloc_dtl_buffers(unsigned long *time_limit);
42 
43 #endif /* _ASM_POWERPC_DTL_H */
44