Changeset 7014 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Feb 19, 2008 12:33:26 PM (17 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r6790 r7014 39 39 #include <iprt/process.h> 40 40 #include <iprt/log.h> 41 42 /* 43 * Logging assignments: 44 * Log - useful stuff, like failures. 45 * LogFlow - program flow, except the really noisy bits. 46 * Log2 - Cleanup and IDTE 47 * Log3 - Loader flow noise. 48 * Log4 - Call VMMR0 flow noise. 49 * Log5 - Native yet-to-be-defined noise. 50 * Log6 - Native ioctl flow noise. 51 * 52 * Logging requires BUILD_TYPE=debug and possibly changes to the logger 53 * instanciation in log-vbox.c(pp). 54 */ 41 55 42 56 … … 461 475 RTSpinlockRelease(pDevExt->Spinlock, &SpinlockTmp); 462 476 477 Log(("supdrvCleanupSession: destroying %p/%d (%p/%p) cpid=%RTproc pid=%RTproc dtor=%p\n", 478 pObj, pObj->enmType, pObj->pvUser1, pObj->pvUser2, pObj->CreatorProcess, RTProcSelf(), pObj->pfnDestructor)); 463 479 if (pObj->pfnDestructor) 464 480 pObj->pfnDestructor(pObj, pObj->pvUser1, pObj->pvUser2); … … 951 967 /* validate */ 952 968 PSUPCALLVMMR0 pReq = (PSUPCALLVMMR0)pReqHdr; 969 Log4(("SUP_IOCTL_CALL_VMMR0: op=%u in=%u arg=%RX64 p/t=%RTproc/%RTthrd\n", 970 pReq->u.In.uOperation, pReq->Hdr.cbIn, pReq->u.In.u64Arg, RTProcSelf(), RTThreadNativeSelf())); 971 953 972 if (pReq->Hdr.cbIn == SUP_IOCTL_CALL_VMMR0_SIZE(0)) 954 973 { … … 975 994 pReq->Hdr.rc = VERR_WRONG_ORDER; 976 995 } 996 997 if ( RT_FAILURE(pReq->Hdr.rc) 998 && pReq->Hdr.rc != VERR_INTERRUPTED 999 && pReq->Hdr.rc != VERR_TIMEOUT) 1000 Log(("SUP_IOCTL_CALL_VMMR0: rc=%Rrc op=%u out=%u arg=%RX64 p/t=%RTproc/%RTthrd\n", 1001 pReq->Hdr.rc, pReq->u.In.uOperation, pReq->Hdr.cbOut, pReq->u.In.u64Arg, RTProcSelf(), RTThreadNativeSelf())); 1002 else 1003 Log4(("SUP_IOCTL_CALL_VMMR0: rc=%Rrc op=%u out=%u arg=%RX64 p/t=%RTproc/%RTthrd\n", 1004 pReq->Hdr.rc, pReq->u.In.uOperation, pReq->Hdr.cbOut, pReq->u.In.u64Arg, RTProcSelf(), RTThreadNativeSelf())); 977 1005 return 0; 978 1006 } … … 1320 1348 * Object is to be destroyed, unlink it. 1321 1349 */ 1350 pObj->u32Magic = SUPDRVOBJ_MAGIC + 1; 1322 1351 fDestroy = true; 1323 1352 if (pDevExt->pObjs == pObj) … … 1347 1376 if (fDestroy) 1348 1377 { 1349 pObj->u32Magic++; 1378 Log(("SUPR0ObjRelease: destroying %p/%d (%p/%p) cpid=%RTproc pid=%RTproc dtor=%p\n", 1379 pObj, pObj->enmType, pObj->pvUser1, pObj->pvUser2, pObj->CreatorProcess, RTProcSelf(), pObj->pfnDestructor)); 1350 1380 if (pObj->pfnDestructor) 1351 1381 pObj->pfnDestructor(pObj, pObj->pvUser1, pObj->pvUser2); … … 3244 3274 pImage->cUsage--; 3245 3275 } 3276 else 3277 Log(("supdrvIOCtl_LdrFree: Dangling objects in %p/%s!\n", pImage->pvImage, pImage->szName)); 3246 3278 } 3247 3279 else -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r6845 r7014 40 40 #include <iprt/err.h> 41 41 #include <iprt/mem.h> 42 #include <iprt/log.h> 42 43 43 44 #include <linux/sched.h> … … 687 688 ".\n", 688 689 g_DevExt.pGip->u32Mode == SUPGIPMODE_SYNC_TSC ? "'synchronous'" : "'asynchronous'"); 689 dprintf(("VBoxDrv::ModuleInit returning %#x\n", rc));690 LogFlow(("VBoxDrv::ModuleInit returning %#x\n", rc)); 690 691 printk(KERN_DEBUG DEVICE_NAME ": Successfully loaded version " 691 692 VBOX_VERSION_STRING " (interface " xstr(SUPDRVIOC_VERSION) ").\n"); … … 739 740 } 740 741 #else /* !CONFIG_VBOXDRV_AS_MISC */ 741 # ifdef CONFIG_DEVFS_FS742 # ifdef CONFIG_DEVFS_FS 742 743 /* 743 744 * Unregister a device entry 744 745 */ 745 746 VBOX_UNREGISTER_DEVFS(g_hDevFsVBoxDrv); 746 # endif // devfs747 # endif /* devfs */ 747 748 rc = VBOX_UNREGISTER_DEVICE(g_iModuleMajor, DEVICE_NAME); 748 749 if (rc < 0) 749 750 { 750 dprintf((" unregister_chrdevfailed with rc=%#x (major:%d)\n", rc, g_iModuleMajor));751 dprintf(("VBOX_UNREGISTER_DEVICE failed with rc=%#x (major:%d)\n", rc, g_iModuleMajor)); 751 752 } 752 753 #endif /* !CONFIG_VBOXDRV_AS_MISC */ … … 771 772 int rc; 772 773 PSUPDRVSESSION pSession; 773 dprintf(("VBoxDrvLinuxCreate: pFilp=%p\n", pFilp));774 Log(("VBoxDrvLinuxCreate: pFilp=%p pid=%d/%d %s\n", pFilp, RTProcSelf(), current->pid, current->comm)); 774 775 775 776 /* … … 785 786 } 786 787 787 dprintf(("VBoxDrvLinuxCreate: g_DevExt=%p pSession=%p rc=%d\n", &g_DevExt, pSession, rc));788 788 pFilp->private_data = pSession; 789 789 790 Log(("VBoxDrvLinuxCreate: g_DevExt=%p pSession=%p rc=%d/%d (pid=%d/%d %s)\n", 791 &g_DevExt, pSession, rc, VBoxDrvLinuxErr2LinuxErr(rc), 792 RTProcSelf(), current->pid, current->comm)); 790 793 return VBoxDrvLinuxErr2LinuxErr(rc); 791 794 } … … 800 803 static int VBoxDrvLinuxClose(struct inode *pInode, struct file *pFilp) 801 804 { 802 dprintf(("VBoxDrvLinuxClose: pFilp=%p private_data=%p\n", pFilp, pFilp->private_data)); 805 Log(("VBoxDrvLinuxClose: pFilp=%p pSession=%p pid=%d/%d %s\n", 806 pFilp, pFilp->private_data, RTProcSelf(), current->pid, current->comm)); 803 807 supdrvCloseSession(&g_DevExt, (PSUPDRVSESSION)pFilp->private_data); 804 808 pFilp->private_data = NULL; … … 861 865 uint32_t cbBuf; 862 866 863 dprintf2(("VBoxDrvLinuxIOCtl: pFilp=%p uCmd=%#x ulArg=%p\n", pFilp, uCmd, (void *)ulArg));867 Log6(("VBoxDrvLinuxIOCtl: pFilp=%p uCmd=%#x ulArg=%p pid=%d/%d\n", pFilp, uCmd, (void *)ulArg, RTProcSelf(), current->pid)); 864 868 865 869 /* … … 868 872 if (RT_UNLIKELY(copy_from_user(&Hdr, (void *)ulArg, sizeof(Hdr)))) 869 873 { 870 dprintf(("VBoxDrvLinuxIOCtl: copy_from_user(,%#lx,) failed; uCmd=%#x.\n", ulArg, uCmd));874 Log(("VBoxDrvLinuxIOCtl: copy_from_user(,%#lx,) failed; uCmd=%#x.\n", ulArg, uCmd)); 871 875 return -EFAULT; 872 876 } 873 877 if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) 874 878 { 875 dprintf(("VBoxDrvLinuxIOCtl: bad header magic %#x; uCmd=%#x\n", Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK, uCmd));879 Log(("VBoxDrvLinuxIOCtl: bad header magic %#x; uCmd=%#x\n", Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK, uCmd)); 876 880 return -EINVAL; 877 881 } … … 883 887 if (RT_UNLIKELY(cbBuf > _1M*16)) 884 888 { 885 dprintf(("VBoxDrvLinuxIOCtl: too big cbBuf=%#x; uCmd=%#x\n", cbBuf, uCmd));889 Log(("VBoxDrvLinuxIOCtl: too big cbBuf=%#x; uCmd=%#x\n", cbBuf, uCmd)); 886 890 return -E2BIG; 887 891 } 888 892 if (RT_UNLIKELY(cbBuf != _IOC_SIZE(uCmd) && _IOC_SIZE(uCmd))) 889 893 { 890 dprintf(("VBoxDrvLinuxIOCtl: bad ioctl cbBuf=%#x _IOC_SIZE=%#x; uCmd=%#x.\n", cbBuf, _IOC_SIZE(uCmd), uCmd));894 Log(("VBoxDrvLinuxIOCtl: bad ioctl cbBuf=%#x _IOC_SIZE=%#x; uCmd=%#x.\n", cbBuf, _IOC_SIZE(uCmd), uCmd)); 891 895 return -EINVAL; 892 896 } … … 899 903 if (RT_UNLIKELY(copy_from_user(pHdr, (void *)ulArg, Hdr.cbIn))) 900 904 { 901 dprintf(("VBoxDrvLinuxIOCtl: copy_from_user(,%#lx, %#x) failed; uCmd=%#x.\n", ulArg, Hdr.cbIn, uCmd));905 Log(("VBoxDrvLinuxIOCtl: copy_from_user(,%#lx, %#x) failed; uCmd=%#x.\n", ulArg, Hdr.cbIn, uCmd)); 902 906 RTMemFree(pHdr); 903 907 return -EFAULT; … … 929 933 else 930 934 { 931 dprintf(("VBoxDrvLinuxIOCtl: pFilp=%p uCmd=%#x ulArg=%p failed, rc=%d\n", pFilp, uCmd, (void *)ulArg, rc));935 Log(("VBoxDrvLinuxIOCtl: pFilp=%p uCmd=%#x ulArg=%p failed, rc=%d\n", pFilp, uCmd, (void *)ulArg, rc)); 932 936 rc = -EINVAL; 933 937 } 934 938 RTMemFree(pHdr); 935 939 936 dprintf2(("VBoxDrvLinuxIOCtl: returns %d\n", rc));940 Log6(("VBoxDrvLinuxIOCtl: returns %d (pid=%d/%d)\n", rc, RTProcSelf(), current->pid)); 937 941 return rc; 938 942 } … … 984 988 unsigned i; 985 989 #endif 986 dprintf(("VBoxDrvLinuxInitGip:\n"));990 LogFlow(("VBoxDrvLinuxInitGip:\n")); 987 991 988 992 /* … … 992 996 if (!pPage) 993 997 { 994 dprintf(("VBoxDrvLinuxInitGip: failed to allocate the GIP page\n"));998 Log(("VBoxDrvLinuxInitGip: failed to allocate the GIP page\n")); 995 999 return -ENOMEM; 996 1000 } … … 1009 1013 pDevExt->ulLastJiffies = jiffies; 1010 1014 pDevExt->u64LastMonotime = (uint64_t)pDevExt->ulLastJiffies * TICK_NSEC; 1011 dprintf(("VBoxDrvInitGIP: TICK_NSEC=%ld HZ=%d jiffies=%ld now=%lld\n",1012 1015 Log(("VBoxDrvInitGIP: TICK_NSEC=%ld HZ=%d jiffies=%ld now=%lld\n", 1016 TICK_NSEC, HZ, pDevExt->ulLastJiffies, pDevExt->u64LastMonotime)); 1013 1017 supdrvGipInit(pDevExt, pGip, HCPhys, pDevExt->u64LastMonotime, 1014 1018 HZ <= 1000 ? HZ : 1000); … … 1045 1049 unsigned i; 1046 1050 #endif 1047 dprintf(("VBoxDrvLinuxTermGip:\n"));1051 LogFlow(("VBoxDrvLinuxTermGip:\n")); 1048 1052 1049 1053 /* … … 1232 1236 pgprot_t pgFlags; 1233 1237 pgprot_val(pgFlags) = _PAGE_PRESENT | _PAGE_USER; 1234 dprintf2(("supdrvOSGipMap: ppGip=%p\n", ppGip));1238 LogFlow(("supdrvOSGipMap: ppGip=%p\n", ppGip)); 1235 1239 1236 1240 /* … … 1255 1259 { 1256 1260 rc = SUPDRV_ERR_NO_MEMORY; 1257 dprintf(("supdrvOSGipMap: no vma found for ulAddr=%#lx!\n", ulAddr));1261 Log(("supdrvOSGipMap: no vma found for ulAddr=%#lx!\n", ulAddr)); 1258 1262 } 1259 1263 #endif … … 1261 1265 { 1262 1266 rc = SUPDRV_ERR_NO_MEMORY; 1263 dprintf(("supdrvOSGipMap: remap_page_range failed rc2=%d\n", rc2));1267 Log(("supdrvOSGipMap: remap_page_range failed rc2=%d\n", rc2)); 1264 1268 } 1265 1269 } 1266 1270 else 1267 1271 { 1268 dprintf(("supdrvOSGipMap: do_mmap failed ulAddr=%#lx\n", ulAddr));1272 Log(("supdrvOSGipMap: do_mmap failed ulAddr=%#lx\n", ulAddr)); 1269 1273 rc = SUPDRV_ERR_NO_MEMORY; 1270 1274 } … … 1277 1281 { 1278 1282 *ppGip = (PSUPGLOBALINFOPAGE)ulAddr; 1279 dprintf2(("supdrvOSGipMap: ppGip=%p\n", *ppGip));1283 LogFlow(("supdrvOSGipMap: ppGip=%p\n", *ppGip)); 1280 1284 return 0; 1281 1285 } … … 1291 1295 } 1292 1296 1293 dprintf2(("supdrvOSGipMap: returns %d\n", rc));1297 LogFlow(("supdrvOSGipMap: returns %d\n", rc)); 1294 1298 return rc; 1295 1299 } … … 1304 1308 int VBOXCALL supdrvOSGipUnmap(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip) 1305 1309 { 1306 dprintf2(("supdrvOSGipUnmap: pGip=%p\n", pGip));1310 LogFlow(("supdrvOSGipUnmap: pGip=%p\n", pGip)); 1307 1311 if (current->mm) 1308 1312 { … … 1311 1315 up_write(¤t->mm->mmap_sem); 1312 1316 } 1313 dprintf2(("supdrvOSGipUnmap: returns 0\n"));1317 LogFlow(("supdrvOSGipUnmap: returns 0\n")); 1314 1318 return 0; 1315 1319 } … … 1323 1327 void VBOXCALL supdrvOSGipResume(PSUPDRVDEVEXT pDevExt) 1324 1328 { 1325 dprintf2(("supdrvOSGipResume:\n"));1329 LogFlow(("supdrvOSGipResume:\n")); 1326 1330 ASMAtomicXchgU8(&pDevExt->fGIPSuspended, false); 1327 1331 #ifdef CONFIG_SMP … … 1377 1381 unsigned i; 1378 1382 #endif 1379 dprintf2(("supdrvOSGipSuspend:\n"));1383 LogFlow(("supdrvOSGipSuspend:\n")); 1380 1384 ASMAtomicXchgU8(&pDevExt->fGIPSuspended, true); 1381 1385
Note:
See TracChangeset
for help on using the changeset viewer.