Changeset 53683 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace
- Timestamp:
- Jan 2, 2015 12:40:14 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_open.c
r53657 r53683 53 53 # include <io.h> 54 54 # endif 55 # include <VBox/sup.h> 56 # include <VBox/err.h> 57 # include <iprt/path.h> 58 # include <iprt/stream.h> 55 59 #endif /* VBOX */ 56 60 … … 839 843 #endif 840 844 845 #ifdef VBOX 846 char szModPath[RTPATH_MAX]; 847 void *pvImageBase; 848 int rc; 849 #endif 850 841 851 if (version <= 0) 842 852 return (set_open_errno(dtp, errp, EINVAL)); … … 936 946 (void) fcntl(dtfd, F_SETFD, FD_CLOEXEC); 937 947 (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC); 948 938 949 #else /* VBOX */ 939 /** @todo open ring-0 dtrace module. */ 950 951 rc = SUPR3Init(NULL); 952 if (RT_FAILURE(rc)) { 953 switch (rc) { 954 case VERR_VM_DRIVER_LOAD_ERROR: 955 case VERR_VM_DRIVER_OPEN_ERROR: 956 err = EDT_BUSY; 957 break; 958 case VERR_VM_DRIVER_NOT_INSTALLED: 959 err = EDT_NOENT; 960 break; 961 case VERR_VERSION_MISMATCH: 962 case VERR_VM_DRIVER_VERSION_MISMATCH: 963 err = EDT_VERSION; 964 break; 965 case VERR_VM_DRIVER_NOT_ACCESSIBLE: 966 default: 967 err = EDT_ACCESS; 968 break; 969 } 970 RTStrmPrintf(g_pStdErr, "SUPR3Init: -> %Rrc\n", rc); 971 return (set_open_errno(dtp, errp, err)); 972 } 973 974 /** @todo this needs to be changed if this becomes and extension pack. */ 975 rc = RTPathAppPrivateArch(szModPath, sizeof(szModPath)); 976 if (RT_SUCCESS(rc)) { 977 rc = RTPathAppend(szModPath, sizeof(szModPath), "VBoxDTraceR0.r0"); 978 if (RT_SUCCESS(rc)) 979 { 980 PRTERRINFO pErrInfo = RTErrInfoAlloc(1024); 981 rc = SUPR3LoadModule(szModPath, "VBoxDTraceR0.r0", &pvImageBase, pErrInfo); 982 if (RT_FAILURE(rc)) { 983 RTStrmPrintf(g_pStdErr, "SUPR3LoadModule: %s -> %Rrc; %s\n", szModPath, rc, pErrInfo->pszMsg); 984 RTErrInfoFree(pErrInfo); 985 return (set_open_errno(dtp, errp, EDT_NOTLOADED)); 986 } 987 RTErrInfoFree(pErrInfo); 988 } 989 } 990 if (RT_FAILURE(rc)) { 991 RTStrmPrintf(g_pStdErr, "SUPR3LoadModule: path buffer too small (%Rrc)\n", rc); 992 return (set_open_errno(dtp, errp, EDT_BUFTOOSMALL)); 993 } 994 995 rc = SUPR3TracerOpen(RT_MAKE_U32_FROM_U8('V', 'B', 'D', 'T'), 0); 996 if (RT_FAILURE(rc)) { 997 RTStrmPrintf(g_pStdErr, "SUPR3TracerOpen: %Rrc\n", rc); 998 return (set_open_errno(dtp, errp, EDT_ACCESS)); 999 } 940 1000 #endif /* VBOX */ 941 1001 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_subr.c
r53664 r53683 486 486 #ifdef VBOX 487 487 int rc; 488 int32_t iRetVal = 0; 488 489 #endif 489 490 … … 496 497 #else 497 498 # if 1 498 rc = SUPR3CallR0Service(RT_STR_TUPLE("VBoxDTrace"), val, (uintptr_t)arg, NULL); 499 if (RT_SUCCESS(rc)) { 500 501 } 499 rc = SUPR3TracerIoCtl(val, (uintptr_t)arg, &iRetVal); 500 if (RT_FAILURE(rc)) { 501 errno = RTErrConvertFromErrno(rc); 502 return (-1); 503 } 504 return iRetVal; 502 505 # else 503 506 /* Fake ioctl */
Note:
See TracChangeset
for help on using the changeset viewer.