Changeset 38749 in vbox for trunk/src/VBox
- Timestamp:
- Sep 14, 2011 12:19:14 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDM.cpp
r37466 r38749 278 278 #define PDM_SAVED_STATE_VERSION 4 279 279 #define PDM_SAVED_STATE_VERSION_PRE_NMI_FF 3 280 281 /** The number of nanoseconds a suspend callback needs to take before 282 * PDMR3Suspend warns about it taking too long. */ 283 #define PDMSUSPEND_WARN_AT_NS UINT64_C(1200000000) 284 285 /** The number of nanoseconds a suspend callback needs to take before 286 * PDMR3PowerOff warns about it taking too long. */ 287 #define PDMPOWEROFF_WARN_AT_NS UINT64_C( 900000000) 280 288 281 289 … … 1481 1489 if (pDrvIns->pReg->pfnSuspend) 1482 1490 { 1491 uint64_t cNsElapsed = RTTimeNanoTS(); 1492 1483 1493 if (!pDrvIns->Internal.s.pfnAsyncNotify) 1484 1494 { … … 1496 1506 pDrvIns->pReg->szName, pDrvIns->iInstance, iLun, pszDevName, iDevInstance)); 1497 1507 } 1508 1509 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1510 if (cNsElapsed >= PDMSUSPEND_WARN_AT_NS) 1511 LogRel(("PDMR3Suspend: Driver '%s'/%d on LUN#%d of device '%s'/%d took %'llu ns to suspend\n", 1512 pDrvIns->pReg->szName, pDrvIns->iInstance, iLun, pszDevName, iDevInstance, cNsElapsed)); 1513 1498 1514 if (pDrvIns->Internal.s.pfnAsyncNotify) 1499 1515 { … … 1522 1538 if (pUsbIns->pReg->pfnVMSuspend) 1523 1539 { 1540 uint64_t cNsElapsed = RTTimeNanoTS(); 1541 1524 1542 if (!pUsbIns->Internal.s.pfnAsyncNotify) 1525 1543 { 1526 LogFlow(("PDMR3Suspend: Notifying - device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance));1544 LogFlow(("PDMR3Suspend: Notifying - USB device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance)); 1527 1545 pUsbIns->pReg->pfnVMSuspend(pUsbIns); 1528 1546 if (pUsbIns->Internal.s.pfnAsyncNotify) 1529 LogFlow(("PDMR3Suspend: Async notification started - device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance));1547 LogFlow(("PDMR3Suspend: Async notification started - USB device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance)); 1530 1548 } 1531 1549 else if (pUsbIns->Internal.s.pfnAsyncNotify(pUsbIns)) 1532 1550 { 1533 LogFlow(("PDMR3Suspend: Async notification completed - device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance));1551 LogFlow(("PDMR3Suspend: Async notification completed - USB device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance)); 1534 1552 pUsbIns->Internal.s.pfnAsyncNotify = NULL; 1535 1553 } … … 1539 1557 pdmR3NotifyAsyncAdd(pAsync, pUsbIns->Internal.s.pUsbDev->pReg->szName, pUsbIns->iInstance); 1540 1558 } 1559 1560 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1561 if (cNsElapsed >= PDMSUSPEND_WARN_AT_NS) 1562 LogRel(("PDMR3Suspend: USB device '%s'/%d took %'llu ns to suspend\n", 1563 pUsbIns->pReg->szName, pUsbIns->iInstance, cNsElapsed)); 1541 1564 } 1542 1565 } … … 1558 1581 if (pDevIns->pReg->pfnSuspend) 1559 1582 { 1583 uint64_t cNsElapsed = RTTimeNanoTS(); 1584 1560 1585 if (!pDevIns->Internal.s.pfnAsyncNotify) 1561 1586 { … … 1575 1600 pdmR3NotifyAsyncAdd(pAsync, pDevIns->Internal.s.pDevR3->pReg->szName, pDevIns->iInstance); 1576 1601 } 1602 1603 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1604 if (cNsElapsed >= PDMSUSPEND_WARN_AT_NS) 1605 LogRel(("PDMR3Suspend: device '%s'/%d took %'llu ns to suspend\n", 1606 pDevIns->pReg->szName, pDevIns->iInstance, cNsElapsed)); 1577 1607 } 1578 1608 } … … 1591 1621 LogFlow(("PDMR3Suspend:\n")); 1592 1622 VM_ASSERT_EMT0(pVM); 1623 uint64_t cNsElapsed = RTTimeNanoTS(); 1593 1624 1594 1625 /* … … 1658 1689 pdmR3ThreadSuspendAll(pVM); 1659 1690 1660 LogFlow(("PDMR3Suspend: returns void\n")); 1691 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1692 LogRel(("PDMR3Suspend: %'llu ns run time\n", cNsElapsed)); 1661 1693 } 1662 1694 … … 1814 1846 if (pDrvIns->pReg->pfnPowerOff) 1815 1847 { 1848 uint64_t cNsElapsed = RTTimeNanoTS(); 1849 1816 1850 if (!pDrvIns->Internal.s.pfnAsyncNotify) 1817 1851 { … … 1829 1863 pDrvIns->pReg->szName, pDrvIns->iInstance, iLun, pszDevName, iDevInstance)); 1830 1864 } 1865 1866 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1867 if (cNsElapsed >= PDMPOWEROFF_WARN_AT_NS) 1868 LogRel(("PDMR3PowerOff: Driver '%s'/%d on LUN#%d of device '%s'/%d took %'llu ns to power off\n", 1869 pDrvIns->pReg->szName, pDrvIns->iInstance, iLun, pszDevName, iDevInstance, cNsElapsed)); 1870 1831 1871 if (pDrvIns->Internal.s.pfnAsyncNotify) 1832 1872 { … … 1856 1896 if (pUsbIns->pReg->pfnVMPowerOff) 1857 1897 { 1898 uint64_t cNsElapsed = RTTimeNanoTS(); 1899 1858 1900 if (!pUsbIns->Internal.s.pfnAsyncNotify) 1859 1901 { 1860 LogFlow(("PDMR3PowerOff: Notifying - device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance));1902 LogFlow(("PDMR3PowerOff: Notifying - USB device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance)); 1861 1903 pUsbIns->pReg->pfnVMPowerOff(pUsbIns); 1862 1904 if (pUsbIns->Internal.s.pfnAsyncNotify) 1863 LogFlow(("PDMR3PowerOff: Async notification started - device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance));1905 LogFlow(("PDMR3PowerOff: Async notification started - USB device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance)); 1864 1906 } 1865 1907 else if (pUsbIns->Internal.s.pfnAsyncNotify(pUsbIns)) 1866 1908 { 1867 LogFlow(("PDMR3PowerOff: Async notification completed - device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance));1909 LogFlow(("PDMR3PowerOff: Async notification completed - USB device '%s'/%d\n", pUsbIns->pReg->szName, pUsbIns->iInstance)); 1868 1910 pUsbIns->Internal.s.pfnAsyncNotify = NULL; 1869 1911 } … … 1873 1915 pdmR3NotifyAsyncAdd(pAsync, pUsbIns->Internal.s.pUsbDev->pReg->szName, pUsbIns->iInstance); 1874 1916 } 1917 1918 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1919 if (cNsElapsed >= PDMPOWEROFF_WARN_AT_NS) 1920 LogRel(("PDMR3PowerOff: USB device '%s'/%d took %'llu ns to power off\n", 1921 pUsbIns->pReg->szName, pUsbIns->iInstance, cNsElapsed)); 1922 1875 1923 } 1876 1924 } … … 1892 1940 if (pDevIns->pReg->pfnPowerOff) 1893 1941 { 1942 uint64_t cNsElapsed = RTTimeNanoTS(); 1943 1894 1944 if (!pDevIns->Internal.s.pfnAsyncNotify) 1895 1945 { … … 1909 1959 pdmR3NotifyAsyncAdd(pAsync, pDevIns->Internal.s.pDevR3->pReg->szName, pDevIns->iInstance); 1910 1960 } 1961 1962 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1963 if (cNsElapsed >= PDMPOWEROFF_WARN_AT_NS) 1964 LogFlow(("PDMR3PowerOff: Device '%s'/%d took %'llu ns to power off\n", 1965 pDevIns->pReg->szName, pDevIns->iInstance, cNsElapsed)); 1911 1966 } 1912 1967 } … … 1923 1978 { 1924 1979 LogFlow(("PDMR3PowerOff:\n")); 1980 uint64_t cNsElapsed = RTTimeNanoTS(); 1925 1981 1926 1982 /* … … 1985 2041 pdmR3ThreadSuspendAll(pVM); 1986 2042 1987 LogFlow(("PDMR3PowerOff: returns void\n")); 2043 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 2044 LogRel(("PDMR3PowerOff: %'llu ns run time\n", cNsElapsed)); 1988 2045 } 1989 2046
Note:
See TracChangeset
for help on using the changeset viewer.