Changeset 40975 in vbox
- Timestamp:
- Apr 18, 2012 2:49:24 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77533
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r40957 r40975 620 620 VBOX_WITH_DTRACE_R0DRV = 1 621 621 endif 622 # Set this to enable all kernel driver dtrace probes.623 if1of ($(KBUILD_TARGET), darwin solaris)624 VBOX_WITH_NATIVE_DTRACE_R0DRV = 1625 endif626 622 # Set this to enable dtrace probes in platform agnostic kernel code. 627 623 ifn1of ($(KBUILD_TARGET), os2) … … 632 628 # Set this to enable support for dtrace probes in guest code. 633 629 #VBOX_WITH_DTRACE_GST = 1 630 # Set this to indicate that the host shipts with DTrace. 631 if1of ($(KBUILD_TARGET), darwin solaris freebsd) 632 VBOX_WITH_NATIVE_DTRACE = 1 633 endif 634 634 ## @} 635 635 … … 2944 2944 TEMPLATE_VBOXR0DRV_DTRACETOOL = VBoxTpG 2945 2945 TEMPLATE_VBOXR0DRV_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R0DRV 2946 ifdef VBOX_WITH_NATIVE_DTRACE _R0DRV2947 TEMPLATE_VBOXR0DRV_DEFS += VBOX_WITH_NATIVE_DTRACE _R0DRV2946 ifdef VBOX_WITH_NATIVE_DTRACE 2947 TEMPLATE_VBOXR0DRV_DEFS += VBOX_WITH_NATIVE_DTRACE 2948 2948 endif 2949 2949 else … … 3201 3201 TEMPLATE_VBOXR3EXE_ASFLAGS.x86 = $(VBOX_ASFLAGS32) 3202 3202 TEMPLATE_VBOXR3EXE_ASFLAGS.amd64 = $(VBOX_ASFLAGS64) 3203 TEMPLATE_VBOXR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS) 3203 3204 TEMPLATE_VBOXR3EXE_USES = dtrace 3204 3205 ifdef VBOX_WITH_DTRACE_R3 3205 TEMPLATE_VBOXR3EXE_DTRACETOOL = StandardDTrace 3206 TEMPLATE_VBOXR3EXE_DTRACE_OBJ_FLAGS = -C 3207 TEMPLATE_VBOXR3EXE_DTRACE_HDR_FLAGS = -C 3206 ifdef VBOX_WITH_NATIVE_DTRACE 3207 TEMPLATE_VBOXR3EXE_DTRACETOOL = StandardDTrace 3208 TEMPLATE_VBOXR3EXE_DTRACE_OBJ_FLAGS = -C 3209 TEMPLATE_VBOXR3EXE_DTRACE_HDR_FLAGS = -C 3210 TEMPLATE_VBOXR3EXE_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R3 VBOX_WITH_NATIVE_DTRACE 3211 else 3212 TEMPLATE_VBOXR3EXE_DTRACETOOL = VBoxTpG 3213 TEMPLATE_VBOXR3EXE_DTRACE_OBJ_FLAGS = --pic --probe-fn-imported --probe-fn-name "SUPTracerFireProbe" 3214 TEMPLATE_VBOXR3EXE_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R3 3215 endif 3208 3216 else 3209 3217 TEMPLATE_VBOXR3EXE_DTRACETOOL = VBoxTpG-Disabled 3210 3218 endif 3211 TEMPLATE_VBOXR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS)3212 3219 TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE) 3213 3220 ifeq ($(KBUILD_TARGET),win) … … 3309 3316 -Wl,--rpath-link,$(L4_LIBDIR) 3310 3317 TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack $(VBOX_LD_as_needed) 3318 ifdef VBOX_WITH_DTRACE_R3 3319 TEMPLATE_VBOXR3EXE_LDFLAGS.linux += -Wl,--verbose 3320 endif 3321 3311 3322 ifeq ($(KBUILD_TARGET),linux) 3312 3323 TEMPLATE_VBOXR3EXE_LIBS = pthread m rt dl -
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r40861 r40975 313 313 SUPDrvTracer.cpp \ 314 314 SUPDrv.d 315 ifdef VBOX_WITH_NATIVE_DTRACE _R0DRV315 ifdef VBOX_WITH_NATIVE_DTRACE 316 316 VBoxDrv_SOURCES += \ 317 317 SUPDrv-dtrace.cpp -
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r40898 r40975 218 218 dtrace_provider_id_t idProvider = pProv->TracerData.DTrace.idProvider; 219 219 AssertPtrReturnVoid(idProvider); 220 220 221 221 AssertPtrReturnVoid(pProv->pHdr); 222 222 PVTGPROBELOC pProbeLoc = pProv->pHdr->paProbLocs; … … 837 837 } 838 838 839 #ifndef VBOX_WITH_NATIVE_DTRACE _R0DRV840 # error "VBOX_WITH_NATIVE_DTRACE _R0DRVis not defined as it should"839 #ifndef VBOX_WITH_NATIVE_DTRACE 840 # error "VBOX_WITH_NATIVE_DTRACE is not defined as it should" 841 841 #endif 842 842 -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r40851 r40975 661 661 DECLASM(void) supdrvTracerProbeFireStub(void); 662 662 663 #ifdef VBOX_WITH_NATIVE_DTRACE _R0DRV663 #ifdef VBOX_WITH_NATIVE_DTRACE 664 664 const SUPDRVTRACERREG * VBOXCALL supdrvDTraceInit(void); 665 665 #endif -
trunk/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
r40892 r40975 1424 1424 RTListInit(&pDevExt->TracerProviderZombieList); 1425 1425 1426 #ifdef VBOX_WITH_NATIVE_DTRACE _R0DRV1426 #ifdef VBOX_WITH_NATIVE_DTRACE 1427 1427 pDevExt->pTracerOps = supdrvDTraceInit(); 1428 1428 if (pDevExt->pTracerOps) -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r40820 r40975 2387 2387 } 2388 2388 2389 extern "C" 2390 { 2391 SUPDECL(void) SUPTracerFireProbe(uint32_t idProbe, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2, 2392 uintptr_t uArg3, uintptr_t uArg4); 2393 } 2394 2395 SUPDECL(void) SUPTracerFireProbe(uint32_t idProbe, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2, 2396 uintptr_t uArg3, uintptr_t uArg4) 2397 { 2398 /* C and stubbed for now. */ 2399 } 2400 -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r40274 r40975 72 72 73 73 #include <VBox/sup.h> 74 #if defined(VBOX_WITH_DTRACE_R3) && !defined(VBOX_WITH_NATIVE_DTRACE) 75 # include <VBox/VBoxTpG.h> 76 #endif 74 77 #include <VBox/dbg.h> 75 78 #include <VBox/err.h> … … 156 159 return VINF_SUCCESS; 157 160 161 #if defined(VBOX_WITH_DTRACE_R3) && !defined(VBOX_WITH_NATIVE_DTRACE) 162 //SUPR3TracerRegisterModule(&g_VTGObjHeader, "VBoxVMM"); 163 #endif 164 158 165 /* 159 166 * We're done. … … 162 169 return VINF_SUCCESS; 163 170 } 164 165 171 166 172 -
trunk/src/bldprogs/VBoxTpG.cpp
r40892 r40975 183 183 static const char *g_pszProbeFnName = "SUPR0TracerFireProbe"; 184 184 static bool g_fProbeFnImported = true; 185 static bool g_fPic = false; 185 186 /** @} */ 186 187 … … 750 751 g_fProbeFnImported ? "IMP" : "", 751 752 g_pszProbeFnName); 752 if (fMachO64 && g_fProbeFnImported )753 if (fMachO64 && g_fProbeFnImported && !g_fPic) 753 754 ScmStreamPrintf(pStrm, 754 755 "g_pfnVtgProbeFn:\n" … … 792 793 */ 793 794 if (g_cBits == 32) 794 ScmStreamPrintf(pStrm, g_fProbeFnImported ? 795 ScmStreamPrintf(pStrm, g_fPic ? 796 " call .mov_ecx_eip_plus_5\n" 797 ".got_eip:\n" 798 " add ecx, _GLOBAL_OFFSET_TABLE + ($$ - .got_eip) wrt ..gotpc\n" 799 " mov ecx, [%s@GOT + ecx]\n" 800 " jmp ecx\n" 801 ".mov_ecx_eip_plus_5:\n" 802 " pop ecx\n" 803 " jmp ecx\n" 804 : g_fProbeFnImported ? 795 805 " mov ecx, IMP2(%s)\n" 796 806 " jmp ecx\n" … … 809 819 " jmp [g_pfnVtgProbeFn wrt rip]\n"); 810 820 else 811 ScmStreamPrintf(pStrm, g_fProbeFnImported ? 812 " lea rax, [IMP2(%s)]\n" //??? macho64? 821 ScmStreamPrintf(pStrm, g_fPic ? 822 " jmp [rel %s wrt ..got]\n" 823 : g_fProbeFnImported ? 824 " lea rax, [IMP2(%s)]\n" 813 825 " jmp rax\n" 814 826 : … … 2043 2055 kVBoxTpGOpt_AssemblerOutputOpt, 2044 2056 kVBoxTpGOpt_AssemblerOption, 2057 kVBoxTpGOpt_Pic, 2045 2058 kVBoxTpGOpt_ProbeFnName, 2046 2059 kVBoxTpGOpt_ProbeFnImported, 2060 kVBoxTpGOpt_ProbeFnNotImported, 2047 2061 kVBoxTpGOpt_End 2048 2062 }; … … 2065 2079 { "--assembler-output-opt", kVBoxTpGOpt_AssemblerOutputOpt, RTGETOPT_REQ_STRING }, 2066 2080 { "--assembler-option", kVBoxTpGOpt_AssemblerOption, RTGETOPT_REQ_STRING }, 2081 { "--pic", kVBoxTpGOpt_Pic, RTGETOPT_REQ_NOTHING }, 2067 2082 { "--probe-fn-name", kVBoxTpGOpt_ProbeFnName, RTGETOPT_REQ_STRING }, 2068 { "--probe-fn-imported", kVBoxTpGOpt_ProbeFnImported, RTGETOPT_REQ_BOOL }, 2083 { "--probe-fn-imported", kVBoxTpGOpt_ProbeFnImported, RTGETOPT_REQ_NOTHING }, 2084 { "--probe-fn-not-imported", kVBoxTpGOpt_ProbeFnNotImported, RTGETOPT_REQ_NOTHING }, 2069 2085 /** @todo We're missing a bunch of assembler options! */ 2070 2086 }; … … 2189 2205 break; 2190 2206 2207 case kVBoxTpGOpt_Pic: 2208 g_fPic = true; 2209 break; 2210 2191 2211 case kVBoxTpGOpt_ProbeFnName: 2192 2212 g_pszProbeFnName = ValueUnion.psz; … … 2194 2214 2195 2215 case kVBoxTpGOpt_ProbeFnImported: 2196 g_pszProbeFnName = ValueUnion.psz; 2216 g_fProbeFnImported = true; 2217 break; 2218 2219 case kVBoxTpGOpt_ProbeFnNotImported: 2220 g_fProbeFnImported = false; 2197 2221 break; 2198 2222
Note:
See TracChangeset
for help on using the changeset viewer.