ia64/xen-unstable

view xen/include/public/trace.h @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children 277025502616
line source
1 /******************************************************************************
2 * include/public/trace.h
3 *
4 * Mark Williamson, (C) 2004 Intel Research Cambridge
5 * Copyright (C) 2005 Bin Ren
6 */
8 #ifndef __XEN_PUBLIC_TRACE_H__
9 #define __XEN_PUBLIC_TRACE_H__
11 /* Trace classes */
12 #define TRC_CLS_SHIFT 16
13 #define TRC_GEN 0x0001f000 /* General trace */
14 #define TRC_SCHED 0x0002f000 /* Xen Scheduler trace */
15 #define TRC_DOM0OP 0x0004f000 /* Xen DOM0 operation trace */
16 #define TRC_VMX 0x0008f000 /* Xen VMX trace */
17 #define TRC_ALL 0xfffff000
19 /* Trace subclasses */
20 #define TRC_SUBCLS_SHIFT 12
21 /* trace subclasses for VMX */
22 #define TRC_VMXEXIT 0x00081000 /* VMX exit trace */
23 #define TRC_VMXTIMER 0x00082000 /* VMX timer trace */
24 #define TRC_VMXINT 0x00084000 /* VMX interrupt trace */
25 #define TRC_VMXIO 0x00088000 /* VMX io emulation trace */
28 /* Trace events per class */
30 #define TRC_SCHED_DOM_ADD (TRC_SCHED + 1)
31 #define TRC_SCHED_DOM_REM (TRC_SCHED + 2)
32 #define TRC_SCHED_SLEEP (TRC_SCHED + 3)
33 #define TRC_SCHED_WAKE (TRC_SCHED + 4)
34 #define TRC_SCHED_YIELD (TRC_SCHED + 5)
35 #define TRC_SCHED_BLOCK (TRC_SCHED + 6)
36 #define TRC_SCHED_SHUTDOWN (TRC_SCHED + 7)
37 #define TRC_SCHED_CTL (TRC_SCHED + 8)
38 #define TRC_SCHED_ADJDOM (TRC_SCHED + 9)
39 #define TRC_SCHED_SWITCH (TRC_SCHED + 10)
40 #define TRC_SCHED_S_TIMER_FN (TRC_SCHED + 11)
41 #define TRC_SCHED_T_TIMER_FN (TRC_SCHED + 12)
42 #define TRC_SCHED_DOM_TIMER_FN (TRC_SCHED + 13)
44 /* trace events per subclass */
45 #define TRC_VMX_VMEXIT (TRC_VMXEXIT + 1)
46 #define TRC_VMX_VECTOR (TRC_VMXEXIT + 2)
48 #define TRC_VMX_TIMER_INTR (TRC_VMXTIMER + 1)
50 #define TRC_VMX_INT (TRC_VMXINT + 1)
52 /* This structure represents a single trace buffer record. */
53 struct t_rec {
54 u64 cycles; /* cycle counter timestamp */
55 u32 event; /* event ID */
56 unsigned long data[5]; /* event data items */
57 };
59 /*
60 * This structure contains the metadata for a single trace buffer. The head
61 * field, indexes into an array of struct t_rec's.
62 */
63 struct t_buf {
64 /* Used by both Xen and user space. */
65 atomic_t rec_idx; /* the next record to save to */
66 unsigned int rec_num; /* number of records in this trace buffer */
67 /* Used by Xen only. */
68 struct t_rec *rec; /* start of records */
69 /* Used by user space only. */
70 unsigned long rec_addr; /* machine address of the start of records */
71 };
73 #endif /* __XEN_PUBLIC_TRACE_H__ */