diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2011-09-08 01:34:02 +0200 |
---|---|---|
committer | Marcin Slusarz <marcin.slusarz@gmail.com> | 2011-09-17 22:57:52 +0200 |
commit | 573335b86e57efa3fc34f989f51952dcbda0be4b (patch) | |
tree | f09564b832daa54dc151116ba94b73d72ce92b01 | |
parent | 6f05aba48d3ab8742d9fd23a04bfdb82b8452051 (diff) |
mmt: fix nvidia post_mmap hook
Fix bug introduced by "mmt: move nvidia ioctl tracing to separate file".
(double registration of the same mmap region).
-rw-r--r-- | mmt/mmt_nv_ioctl.c | 5 | ||||
-rw-r--r-- | mmt/mmt_nv_ioctl.h | 2 | ||||
-rw-r--r-- | mmt/mmt_trace.c | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/mmt/mmt_nv_ioctl.c b/mmt/mmt_nv_ioctl.c index 19287b1e..bc1a161e 100644 --- a/mmt/mmt_nv_ioctl.c +++ b/mmt/mmt_nv_ioctl.c @@ -169,7 +169,7 @@ void mmt_nv_ioctl_post_close(UWord *args) } } -void mmt_nv_ioctl_post_mmap(UWord *args, SysRes res, int offset_unit) +int mmt_nv_ioctl_post_mmap(UWord *args, SysRes res, int offset_unit) { void *start = (void *)args[0]; unsigned long len = args[1]; @@ -198,10 +198,11 @@ void mmt_nv_ioctl_post_mmap(UWord *args, SysRes res, int offset_unit) "got new mmap for 0x%08lx:0x%08lx at %p, len: 0x%08lx, offset: 0x%llx, serial: %d\n", region->data1, region->data2, (void *)region->start, len, region->offset, region->id); - return; + return 1; } } } + return 0; } static struct object_type { diff --git a/mmt/mmt_nv_ioctl.h b/mmt/mmt_nv_ioctl.h index 5311406f..92f76ab0 100644 --- a/mmt/mmt_nv_ioctl.h +++ b/mmt/mmt_nv_ioctl.h @@ -12,7 +12,7 @@ void mmt_nv_ioctl_post_clo_init(void); void mmt_nv_ioctl_post_open(UWord *args, SysRes res); void mmt_nv_ioctl_post_close(UWord *args); -void mmt_nv_ioctl_post_mmap(UWord *args, SysRes res, int offset_unit); +int mmt_nv_ioctl_post_mmap(UWord *args, SysRes res, int offset_unit); void mmt_nv_ioctl_pre(UWord *args); void mmt_nv_ioctl_post(UWord *args); diff --git a/mmt/mmt_trace.c b/mmt/mmt_trace.c index 2cfd9a1c..817ac391 100644 --- a/mmt/mmt_trace.c +++ b/mmt/mmt_trace.c @@ -344,7 +344,8 @@ static void post_mmap(ThreadId tid, UWord *args, UInt nArgs, SysRes res, int off } } - mmt_nv_ioctl_post_mmap(args, res, offset_unit); + if (mmt_nv_ioctl_post_mmap(args, res, offset_unit)) + return; if (mmt_last_region + 1 >= MMT_MAX_REGIONS) { |