aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace
diff options
context:
space:
mode:
authormwilli2@equilibrium.research.intel-research.net <mwilli2@equilibrium.research.intel-research.net>2004-03-05 17:30:22 +0000
committermwilli2@equilibrium.research.intel-research.net <mwilli2@equilibrium.research.intel-research.net>2004-03-05 17:30:22 +0000
commitae39e978fc161afd726cbbcb9e1853958b86a548 (patch)
tree5253802c4afd4585bb3aa5a9a5f1571258d8a7f5 /tools/xentrace
parente0cea07f10301cc2a89dd80bd8fdacd9846a45d2 (diff)
downloadxen-ae39e978fc161afd726cbbcb9e1853958b86a548.tar.gz
xen-ae39e978fc161afd726cbbcb9e1853958b86a548.tar.bz2
xen-ae39e978fc161afd726cbbcb9e1853958b86a548.zip
bitkeeper revision 1.765 (4048b92eZ-VqpZdWj-oHI1tRK9Ft1A)
Update to trace code for new memory protection model.
Diffstat (limited to 'tools/xentrace')
-rw-r--r--tools/xentrace/xentrace.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 4fa6c696e1..73846f39d1 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -131,19 +131,16 @@ struct t_buf *map_tbufs(unsigned long tbufs_phys, unsigned int num,
{
int dm_fd; /* file descriptor for /dev/mem */
struct t_buf *tbufs_mapped;
- unsigned int page_size = getpagesize();
- unsigned int off_in_pg = (tbufs_phys % page_size);
-
- tbufs_phys -= off_in_pg; /* correct tbufs_phys if not page-aligned */
dm_fd = open("/dev/mem", O_RDONLY);
+
if ( dm_fd < 0 )
{
PERROR("Open /dev/mem when mapping trace buffers\n");
exit(EXIT_FAILURE);
}
- tbufs_mapped = (struct t_buf *)mmap(NULL, size * num + off_in_pg,
+ tbufs_mapped = (struct t_buf *)mmap(NULL, size * num,
PROT_READ, MAP_SHARED,
dm_fd, (off_t)tbufs_phys);
@@ -155,8 +152,7 @@ struct t_buf *map_tbufs(unsigned long tbufs_phys, unsigned int num,
exit(EXIT_FAILURE);
}
- /* add offset to get buffers in case original address wasn't pg aligned */
- return (struct t_buf *)((unsigned long)tbufs_mapped + off_in_pg);
+ return (struct t_buf *)tbufs_mapped;
}