aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace/xentrace.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-19 17:25:04 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-19 17:25:04 +0000
commitd9eb7e09d74084a71386496614a189870e84c89f (patch)
tree7f4ef95a01201529a93f14afdf2c52d5eabb03d5 /tools/xentrace/xentrace.c
parent40326f9fc30fb0fa94f7367e7e41c2e7a6b1efa1 (diff)
downloadxen-d9eb7e09d74084a71386496614a189870e84c89f.tar.gz
xen-d9eb7e09d74084a71386496614a189870e84c89f.tar.bz2
xen-d9eb7e09d74084a71386496614a189870e84c89f.zip
Get rid of memory_t. Almost all uses should be unsigned long.
The few uses for a physical/machine address have been mostly changed to u64. Grant table code probably needs auditing for PAE correctness, but at least the interface is now sound. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xentrace/xentrace.c')
-rw-r--r--tools/xentrace/xentrace.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 2d59ac2a79..4eef5a3e63 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -95,13 +95,13 @@ void write_rec(unsigned int cpu, struct t_rec *rec, FILE *out)
/**
* get_tbufs - get pointer to and size of the trace buffers
- * @mach_addr: location to store machine address if the trace buffers to
- * @size: location to store the size of a trace buffer to
+ * @mfn: location to store mfn of the trace buffers to
+ * @size: location to store the size of a trace buffer to
*
* Gets the machine address of the trace pointer area and the size of the
* per CPU buffers.
*/
-void get_tbufs(unsigned long *mach_addr, unsigned long *size)
+void get_tbufs(unsigned long *mfn, unsigned long *size)
{
int ret;
dom0_op_t op; /* dom0 op we'll build */
@@ -121,19 +121,19 @@ void get_tbufs(unsigned long *mach_addr, unsigned long *size)
exit(EXIT_FAILURE);
}
- *mach_addr = op.u.tbufcontrol.mach_addr;
- *size = op.u.tbufcontrol.size;
+ *mfn = op.u.tbufcontrol.buffer_mfn;
+ *size = op.u.tbufcontrol.size;
}
/**
* map_tbufs - memory map Xen trace buffers into user space
- * @tbufs: machine address of the trace buffers
+ * @tbufs_mfn: mfn of the trace buffers
* @num: number of trace buffers to map
* @size: size of each trace buffer
*
* Maps the Xen trace buffers them into process address space.
*/
-struct t_buf *map_tbufs(unsigned long tbufs_mach, unsigned int num,
+struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
unsigned long size)
{
int xc_handle; /* file descriptor for /proc/xen/privcmd */
@@ -149,7 +149,7 @@ struct t_buf *map_tbufs(unsigned long tbufs_mach, unsigned int num,
tbufs_mapped = xc_map_foreign_range(xc_handle, 0 /* Dom 0 ID */,
size * num, PROT_READ,
- tbufs_mach >> PAGE_SHIFT);
+ tbufs_mfn);
xc_interface_close(xc_handle);
@@ -231,7 +231,7 @@ struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
/**
* init_rec_ptrs - initialises data area pointers to locations in user space
- * @tbufs_mach: machine base address of the trace buffer area
+ * @tbufs_mfn: base mfn of the trace buffer area
* @tbufs_mapped: user virtual address of base of trace buffer area
* @meta: array of user-space pointers to struct t_buf's of metadata
* @num: number of trace buffers
@@ -240,7 +240,7 @@ struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
* mapped in user space. Note that the trace buffer metadata contains machine
* pointers - the array returned allows more convenient access to them.
*/
-struct t_rec **init_rec_ptrs(unsigned long tbufs_mach,
+struct t_rec **init_rec_ptrs(unsigned long tbufs_mfn,
struct t_buf *tbufs_mapped,
struct t_buf **meta,
unsigned int num)
@@ -256,7 +256,7 @@ struct t_rec **init_rec_ptrs(unsigned long tbufs_mach,
}
for ( i = 0; i < num; i++ )
- data[i] = (struct t_rec *)(meta[i]->rec_addr - tbufs_mach
+ data[i] = (struct t_rec *)(meta[i]->rec_addr - (tbufs_mfn<<XC_PAGE_SHIFT) /* XXX */
+ (unsigned long)tbufs_mapped);
return data;
@@ -330,7 +330,7 @@ int monitor_tbufs(FILE *logfile)
struct t_rec **data; /* pointers to the trace buffer data areas
* where they are mapped into user space. */
unsigned long *cons; /* store tail indexes for the trace buffers */
- unsigned long tbufs_mach; /* machine address of the tbufs */
+ unsigned long tbufs_mfn; /* mfn of the tbufs */
unsigned int num; /* number of trace buffers / logical CPUS */
unsigned long size; /* size of a single trace buffer */
@@ -340,14 +340,14 @@ int monitor_tbufs(FILE *logfile)
num = get_num_cpus();
/* setup access to trace buffers */
- get_tbufs(&tbufs_mach, &size);
- tbufs_mapped = map_tbufs(tbufs_mach, num, size);
+ get_tbufs(&tbufs_mfn, &size);
+ tbufs_mapped = map_tbufs(tbufs_mfn, num, size);
size_in_recs = (size - sizeof(struct t_buf)) / sizeof(struct t_rec);
/* build arrays of convenience ptrs */
meta = init_bufs_ptrs (tbufs_mapped, num, size);
- data = init_rec_ptrs (tbufs_mach, tbufs_mapped, meta, num);
+ data = init_rec_ptrs (tbufs_mfn, tbufs_mapped, meta, num);
cons = init_tail_idxs (meta, num);
/* now, scan buffers for events */