Changeset 24278 in vbox for trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp
- Timestamp:
- Nov 2, 2009 8:26:07 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp
r24059 r24278 42 42 #include <iprt/string.h> 43 43 #include <iprt/thread.h> 44 #include <iprt/path.h> 44 45 45 46 #include "PDMAsyncCompletionFileInternal.h" … … 693 694 } 694 695 696 #ifdef VBOX_WITH_STATISTICS 697 if (RT_SUCCESS(rc)) 698 { 699 STAMR3RegisterF(pEpClassFile->Core.pVM, &pEpFile->StatRead, 700 STAMTYPE_PROFILE_ADV, STAMVISIBILITY_ALWAYS, 701 STAMUNIT_TICKS_PER_CALL, "Time taken to read from the endpoint", 702 "/PDM/AsyncCompletion/File/%s/Read", RTPathFilename(pEpFile->Core.pszUri)); 703 704 STAMR3RegisterF(pEpClassFile->Core.pVM, &pEpFile->StatWrite, 705 STAMTYPE_PROFILE_ADV, STAMVISIBILITY_ALWAYS, 706 STAMUNIT_TICKS_PER_CALL, "Time taken to write to the endpoint", 707 "/PDM/AsyncCompletion/File/%s/Write", RTPathFilename(pEpFile->Core.pszUri)); 708 } 709 #endif 710 695 711 return rc; 696 712 } … … 728 744 RTFileClose(pEpFile->File); 729 745 746 #ifdef VBOX_WITH_STATISTICS 747 STAMR3Deregister(pEpClassFile->Core.pVM, &pEpFile->StatRead); 748 STAMR3Deregister(pEpClassFile->Core.pVM, &pEpFile->StatWrite); 749 #endif 750 730 751 return VINF_SUCCESS; 731 752 } … … 736 757 size_t cbRead) 737 758 { 759 int rc = VINF_SUCCESS; 738 760 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint; 739 761 762 STAM_PROFILE_ADV_START(&pEpFile->StatRead, Read); 763 740 764 if (pEpFile->fCaching) 741 r eturnpdmacFileEpCacheRead(pEpFile, (PPDMASYNCCOMPLETIONTASKFILE)pTask,742 765 rc = pdmacFileEpCacheRead(pEpFile, (PPDMASYNCCOMPLETIONTASKFILE)pTask, 766 off, paSegments, cSegments, cbRead); 743 767 else 744 return pdmacFileEpTaskInitiate(pTask, pEndpoint, off, paSegments, cSegments, cbRead, 745 PDMACTASKFILETRANSFER_READ); 768 rc = pdmacFileEpTaskInitiate(pTask, pEndpoint, off, paSegments, cSegments, cbRead, 769 PDMACTASKFILETRANSFER_READ); 770 771 STAM_PROFILE_ADV_STOP(&pEpFile->StatRead, Read); 772 773 return rc; 746 774 } 747 775 … … 751 779 size_t cbWrite) 752 780 { 781 int rc = VINF_SUCCESS; 753 782 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint; 754 783 … … 756 785 return VERR_NOT_SUPPORTED; 757 786 787 STAM_PROFILE_ADV_START(&pEpFile->StatWrite, Write); 788 758 789 if (pEpFile->fCaching) 759 r eturnpdmacFileEpCacheWrite(pEpFile, (PPDMASYNCCOMPLETIONTASKFILE)pTask,760 790 rc = pdmacFileEpCacheWrite(pEpFile, (PPDMASYNCCOMPLETIONTASKFILE)pTask, 791 off, paSegments, cSegments, cbWrite); 761 792 else 762 return pdmacFileEpTaskInitiate(pTask, pEndpoint, off, paSegments, cSegments, cbWrite, 763 PDMACTASKFILETRANSFER_WRITE); 793 rc = pdmacFileEpTaskInitiate(pTask, pEndpoint, off, paSegments, cSegments, cbWrite, 794 PDMACTASKFILETRANSFER_WRITE); 795 796 STAM_PROFILE_ADV_STOP(&pEpFile->StatWrite, Write); 797 798 return rc; 764 799 } 765 800
Note:
See TracChangeset
for help on using the changeset viewer.