aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authoriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>2004-05-19 21:46:26 +0000
committeriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>2004-05-19 21:46:26 +0000
commitba0805e639d30c031417ab91ccde71792e41be4b (patch)
tree686ffec484cb5bb9c9a2539ed2d362951a4fc25f /xen
parent2995b747c15256d51f805e1f45b924a192fd6bcd (diff)
downloadxen-ba0805e639d30c031417ab91ccde71792e41be4b.tar.gz
xen-ba0805e639d30c031417ab91ccde71792e41be4b.tar.bz2
xen-ba0805e639d30c031417ab91ccde71792e41be4b.zip
bitkeeper revision 1.911.1.1 (40abd5b2mqoey54uZKqDJrA-dD05Xw)
bandaid for xentrace. Really needs a Xen-visible trace buffer consumer index, and a way of kicking the trace deamon...
Diffstat (limited to 'xen')
-rw-r--r--xen/common/dom0_ops.c8
-rw-r--r--xen/common/trace.c2
-rw-r--r--xen/include/hypervisor-ifs/trace.h5
-rw-r--r--xen/include/xen/trace.h20
4 files changed, 14 insertions, 21 deletions
diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c
index 32fa532c9a..3b413a1faa 100644
--- a/xen/common/dom0_ops.c
+++ b/xen/common/dom0_ops.c
@@ -22,8 +22,8 @@
#include <hypervisor-ifs/sched_ctl.h>
-#define TRC_DOM0OP_START_BASE 0x00020000
-#define TRC_DOM0OP_FINISH_BASE 0x00030000
+#define TRC_DOM0OP_ENTER_BASE 0x00020000
+#define TRC_DOM0OP_LEAVE_BASE 0x00030000
extern unsigned int alloc_new_dom_mem(struct task_struct *, unsigned int);
@@ -64,7 +64,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
return -EACCES;
}
- TRACE_5D( TRC_DOM0OP_START_BASE + op->cmd,
+ TRACE_5D( TRC_DOM0OP_ENTER_BASE + op->cmd,
0, op->u.dummy[0], op->u.dummy[1], op->u.dummy[2], op->u.dummy[3] );
switch ( op->cmd )
@@ -668,7 +668,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
}
- TRACE_5D( TRC_DOM0OP_FINISH_BASE + op->cmd, ret,
+ TRACE_5D( TRC_DOM0OP_LEAVE_BASE + op->cmd, ret,
op->u.dummy[0], op->u.dummy[1], op->u.dummy[2], op->u.dummy[3] );
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 0140e7444a..e79c97ee54 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -27,7 +27,6 @@
#include <xen/sched.h>
#include <xen/slab.h>
#include <xen/smp.h>
-#include <xen/spinlock.h>
#include <xen/trace.h>
#include <xen/errno.h>
#include <asm/atomic.h>
@@ -86,7 +85,6 @@ void init_trace_bufs(void)
/* For use in Xen. */
buf->vdata = (struct t_rec *)(buf+1);
buf->head_ptr = buf->vdata;
- spin_lock_init(&buf->lock);
/* For use in user space. */
buf->data = (struct t_rec *)__pa(buf->vdata);
diff --git a/xen/include/hypervisor-ifs/trace.h b/xen/include/hypervisor-ifs/trace.h
index 4d267ba101..d201eceb88 100644
--- a/xen/include/hypervisor-ifs/trace.h
+++ b/xen/include/hypervisor-ifs/trace.h
@@ -20,13 +20,12 @@ struct t_buf {
struct t_rec *data; /* pointer to data area. physical address
* for convenience in user space code */
- unsigned int size; /* size of the data area, in t_recs */
- unsigned int head; /* array index of the most recent record */
+ unsigned long size; /* size of the data area, in t_recs */
+ unsigned long head; /* array index of the most recent record */
#ifdef __KERNEL__
struct t_rec *head_ptr; /* pointer to the head record */
struct t_rec *vdata; /* virtual address pointer to data */
- spinlock_t lock; /* ensure mutually exlusive access (for inserts) */
#endif
/* never add anything here - the kernel stuff must be the last elements */
diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h
index 00b18b0211..782023f76e 100644
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -61,10 +61,12 @@ static inline int trace(u32 event, u32 d1, u32 d2, u32 d3, u32 d4, u32 d5)
if ( !tb_init_done )
return -1;
+
buf = t_bufs[smp_processor_id()];
- rec = buf->head_ptr;
- spin_lock_irqsave(&buf->lock, flags);
+ local_irq_save(flags);
+
+ rec = buf->head_ptr;
rdtscll(rec->cycles);
rec->event = event;
@@ -76,18 +78,12 @@ static inline int trace(u32 event, u32 d1, u32 d2, u32 d3, u32 d4, u32 d5)
wmb(); /* above must be visible before reader sees index updated */
- if ( likely(buf->head_ptr < (buf->vdata + buf->size - 1)) )
- {
- buf->head_ptr++;
- buf->head++;
- }
- else
- {
- buf->head = 0;
+ buf->head_ptr++;
+ buf->head++;
+ if ( buf->head_ptr == (buf->vdata + (buf->size-1)) )
buf->head_ptr = buf->vdata;
- }
- spin_unlock_irqrestore(&buf->lock, flags);
+ local_irq_restore(flags);
return 0;
}