Changeset 49395 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Nov 5, 2013 6:38:08 PM (11 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r48952 r49395 47 47 # include VBOX_PATH_MACOSX_DTRACE_H 48 48 #elif defined(RT_OS_LINUX) 49 /* DTrace experiments with the Unbreakable Enterprise Kernel (UEK) 49 /* Avoid type and define conflicts. */ 50 # undef UINT8_MAX 51 # undef UINT16_MAX 52 # undef UINT32_MAX 53 # undef UINT64_MAX 54 # undef INT64_MAX 55 # undef INT64_MIN 56 # define intptr_t dtrace_intptr_t 57 58 # if 0 59 /* DTrace experiments with the Unbreakable Enterprise Kernel (UEK2) 50 60 (Oracle Linux). 51 61 1. The dtrace.h here is from the dtrace module source, not … … 58 68 -e 's/$/\tdrivers\/dtrace\/dtrace\tEXPORT_SYMBOL/' \ 59 69 >> Module.symvers 70 Update: Althernative workaround (active), resolve symbols dynamically. 60 71 3. No tracepoints in vboxdrv, vboxnet* or vboxpci yet. This requires yasm 61 72 and VBoxTpG and build time. */ 62 # undef UINT8_MAX 63 # undef UINT16_MAX 64 # undef UINT32_MAX 65 # undef UINT64_MAX 66 # undef INT64_MAX 67 # undef INT64_MIN 68 # define intptr_t dtrace_intptr_t 69 # include "dtrace.h" 73 # include "dtrace.h" 74 # else 75 /* DTrace experiments with the Unbreakable Enterprise Kernel (UEKR3) 76 (Oracle Linux). 77 1. To generate the missing entries for the dtrace module in Module.symvers 78 of UEK: 79 nm /lib/modules/....../kernel/drivers/dtrace/dtrace.ko \ 80 | grep _crc_ \ 81 | sed -e 's/^......../0x/' -e 's/ A __crc_/\t/' \ 82 -e 's/$/\tdrivers\/dtrace\/dtrace\tEXPORT_SYMBOL/' \ 83 >> Module.symvers 84 Update: Althernative workaround (active), resolve symbols dynamically. 85 2. No tracepoints in vboxdrv, vboxnet* or vboxpci yet. This requires yasm 86 and VBoxTpG and build time. */ 87 # include <dtrace/provider.h> 88 # include <dtrace/enabling.h> /* Missing from provider.h. */ 89 # include <dtrace/arg.h> /* Missing from provider.h. */ 90 # endif 91 # include <linux/kallsyms.h> 92 /** Status code fixer (UEK uses linux convension unlike the others). */ 70 93 # define FIX_UEK_RC(a_rc) (-(a_rc)) 71 94 #else … … 192 215 * Global Variables * 193 216 *******************************************************************************/ 194 #if def RT_OS_DARWIN195 /** @name DTrace kernel interface used on Darwin 217 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) 218 /** @name DTrace kernel interface used on Darwin and Linux. 196 219 * @{ */ 197 220 static void (* g_pfnDTraceProbeFire)(dtrace_id_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); … … 1028 1051 const SUPDRVTRACERREG * VBOXCALL supdrvDTraceInit(void) 1029 1052 { 1030 #if def RT_OS_DARWIN1053 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) 1031 1054 /* 1032 1055 * Resolve the kernel symbols we need. 1033 1056 */ 1057 # ifndef RT_OS_LINUX 1034 1058 RTDBGKRNLINFO hKrnlInfo; 1035 1059 int rc = RTR0DbgKrnlInfoOpen(&hKrnlInfo, 0); … … 1039 1063 return NULL; 1040 1064 } 1065 # endif 1041 1066 1042 1067 static const struct … … 1053 1078 { "dtrace_unregister", (PFNRT*)&dtrace_unregister }, 1054 1079 }; 1055 for (unsigned i = 0; i < RT_ELEMENTS(s_aDTraceFunctions); i++) 1056 { 1080 unsigned i; 1081 for (i = 0; i < RT_ELEMENTS(s_aDTraceFunctions); i++) 1082 { 1083 # ifndef RT_OS_LINUX 1057 1084 rc = RTR0DbgKrnlInfoQuerySymbol(hKrnlInfo, NULL, s_aDTraceFunctions[i].pszName, 1058 1085 (void **)s_aDTraceFunctions[i].ppfn); … … 1062 1089 break; 1063 1090 } 1064 } 1065 1091 # else 1092 unsigned long ulAddr = kallsyms_lookup_name(s_aDTraceFunctions[i].pszName); 1093 if (!ulAddr) 1094 { 1095 SUPR0Printf("supdrvDTraceInit: Failed to resolved '%s' (i=%u).\n", s_aDTraceFunctions[i].pszName, i); 1096 break; 1097 } 1098 SUPR0Printf("supdrvDTraceInit: '%s' -> %lx.\n", s_aDTraceFunctions[i].pszName, ulAddr); 1099 *s_aDTraceFunctions[i].ppfn = (PFNRT)ulAddr; 1100 # endif 1101 } 1102 1103 # ifndef RT_OS_LINUX 1066 1104 RTR0DbgKrnlInfoRelease(hKrnlInfo); 1067 1105 if (RT_FAILURE(rc)) 1068 1106 return NULL; 1107 # endif 1069 1108 #endif 1070 1109 -
trunk/src/VBox/HostDrivers/Support/linux/Makefile
r48901 r49395 156 156 math/gcc/qdivrem.o \ 157 157 math/gcc/udivdi3.o \ 158 158 math/gcc/divdi3.o \ 159 159 math/gcc/umoddi3.o 160 160 endif … … 242 242 INCL += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux) 243 243 INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxdrv,/ /include /r0drv/linux) 244 ifdef VBOX_WITH_NATIVE_DTRACE 245 INCL += -I/usr/include/linux -I/usr/include 246 endif 244 247 export INCL 245 248 endif
Note:
See TracChangeset
for help on using the changeset viewer.