Changeset 40763 in vbox
- Timestamp:
- Apr 4, 2012 2:40:09 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77258
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r40761 r40763 1295 1295 /** Provider ID. */ 1296 1296 uintptr_t idProvider; 1297 /** The number of trace points. */ 1298 uint32_t volatile cTracepoints; 1297 /** The number of trace points provided. */ 1298 uint32_t volatile cProvidedProbes; 1299 /** Whether we've invalidated this bugger. */ 1300 bool fZombie; 1299 1301 } DTrace; 1300 1302 } SUPDRVTRACERDATA; … … 1315 1317 /** Pointer to the provider name (a copy that's always available). */ 1316 1318 const char *pszName; 1319 /** Pointer to the module name. */ 1320 const char *pszModName; 1317 1321 } SUPDRVVDTPROVIDERCORE; 1318 1322 /** Pointer to a tracepoint provider core structure. */ … … 1325 1329 typedef struct SUPDRVTRACERUSRCTX 1326 1330 { 1331 /** The probe ID from the VTG location record. */ 1332 uint32_t idProbe; 1333 /** 32 if X86, 64 if AMD64. */ 1334 uint8_t cBits; 1335 /** Reserved padding. */ 1336 uint8_t abReserved[3]; 1337 /** Data which format is dictated by the cBits member. */ 1327 1338 union 1328 1339 { … … 1374 1385 } Amd64; 1375 1386 } u; 1376 /** 32 if X86, 64 if AMD64. */1377 uint8_t cBits;1378 /** Reserved padding. */1379 uint8_t abReserved[3];1380 /** The probe ID from the VTG location record. */1381 uint32_t idProbe;1382 1387 } SUPDRVTRACERUSRCTX; 1383 1388 /** Pointer to the usermode probe context information. */ … … 1407 1412 * @param uArg4 The fifth raw probe argument. 1408 1413 * 1409 * @remarks SUPR0 VtgFireProbe will do a tail jump thru this member, so no extra1410 * stack frames will be added.1414 * @remarks SUPR0TracerFireProbe will do a tail jump thru this member, so 1415 * no extra stack frames will be added. 1411 1416 * @remarks This does not take a 'this' pointer argument because it doesn't map 1412 1417 * well onto VTG or DTrace. 1413 1418 * 1414 1419 */ 1415 DECLR0CALLBACKMEMBER(void, pfn FireKernelProbe, (struct VTGPROBELOC *pVtgProbeLoc, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2,1420 DECLR0CALLBACKMEMBER(void, pfnProbeFireKernel, (struct VTGPROBELOC *pVtgProbeLoc, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2, 1416 1421 uintptr_t uArg3, uintptr_t uArg4)); 1417 1422 … … 1422 1427 * 1423 1428 * @param pVtgProbeLoc The probe location record. 1429 * @param pSession The user session. 1424 1430 * @param pCtx The usermode context info. 1425 1431 */ 1426 DECLR0CALLBACKMEMBER(void, pfn FireUserProbe, (PCSUPDRVTRACERREG pThis, PCSUPDRVTRACERUSRCTX pCtx));1432 DECLR0CALLBACKMEMBER(void, pfnProbeFireUser, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, PCSUPDRVTRACERUSRCTX pCtx)); 1427 1433 1428 1434 /** … … 1438 1444 * set to a non-zero value on success. 1439 1445 */ 1440 DECLR0CALLBACKMEMBER(int, pfn OpenTracer, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uint32_t uCookie, uintptr_t uArg,1446 DECLR0CALLBACKMEMBER(int, pfnTracerOpen, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uint32_t uCookie, uintptr_t uArg, 1441 1447 uintptr_t *puSessionData)); 1442 1448 … … 1453 1459 * @param piRetVal The tracer specific return value. 1454 1460 */ 1455 DECLR0CALLBACKMEMBER(int, pfn Ioctl, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData,1456 uintptr_t uCmd, uintptr_t uArg, int32_t *piRetVal));1461 DECLR0CALLBACKMEMBER(int, pfnTracerIoCtl, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData, 1462 uintptr_t uCmd, uintptr_t uArg, int32_t *piRetVal)); 1457 1463 1458 1464 /** … … 1463 1469 * @param uSessionData The data assoicated with the session. 1464 1470 */ 1465 DECLR0CALLBACKMEMBER(void, pfn CloseTrace, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData));1471 DECLR0CALLBACKMEMBER(void, pfnTracerClose, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData)); 1466 1472 1467 1473 /** … … 1471 1477 * @param pThis Pointer to the registration record. 1472 1478 * @param pCore The provider core data. 1479 * 1480 * @todo Kernel vs. Userland providers. 1473 1481 */ 1474 DECLR0CALLBACKMEMBER(int, pfn RegisterProvider, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore));1482 DECLR0CALLBACKMEMBER(int, pfnProviderRegister, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore)); 1475 1483 1476 1484 /** … … 1484 1492 * @param pCore The provider core data. 1485 1493 */ 1486 DECLR0CALLBACKMEMBER(int, pfn DeregisterProvider, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore));1494 DECLR0CALLBACKMEMBER(int, pfnProviderDeregister, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore)); 1487 1495 1488 1496 /** … … 1493 1501 * @param pCore The provider core data. 1494 1502 */ 1495 DECLR0CALLBACKMEMBER(int, pfn DeregisterZombieProvider, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore));1503 DECLR0CALLBACKMEMBER(int, pfnProviderDeregisterZombie, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore)); 1496 1504 1497 1505 /** End marker (SUPDRVTRACERREG_MAGIC). */ … … 1522 1530 #define SUPDRVTRACERHLP_VERSION RT_MAKE_U32(0, 1) 1523 1531 1524 SUPR0DECL(int) SUPR0VtgRegisterDrv(PSUPDRVSESSION pSession, struct VTGOBJHDR *pVtgHdr, const char *pszName); 1525 SUPR0DECL(void) SUPR0VtgDeregisterDrv(PSUPDRVSESSION pSession); 1526 SUPR0DECL(void) SUPR0VtgFireProbe(uint32_t idProbe, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2, 1527 uintptr_t uArg3, uintptr_t uArg4); 1528 SUPR0DECL(int) SUPR0VtgRegisterModule(void *hMod, struct VTGOBJHDR *pVtgHdr); 1532 SUPR0DECL(int) SUPR0TracerRegisterImpl(void *hMod, PSUPDRVSESSION pSession, PCSUPDRVTRACERREG pReg, PCSUPDRVTRACERHLP *ppHlp); 1533 SUPR0DECL(int) SUPR0TracerDeregisterImpl(PSUPDRVSESSION pSession); 1534 SUPR0DECL(int) SUPR0TracerRegisterDrv(PSUPDRVSESSION pSession, struct VTGOBJHDR *pVtgHdr, const char *pszName); 1535 SUPR0DECL(void) SUPR0TracerDeregisterDrv(PSUPDRVSESSION pSession); 1536 SUPR0DECL(int) SUPR0TracerRegisterModule(void *hMod, struct VTGOBJHDR *pVtgHdr); 1537 SUPR0DECL(void) SUPR0TracerFireProbe(uint32_t idProbe, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2, 1538 uintptr_t uArg3, uintptr_t uArg4); 1529 1539 /** @} */ 1530 1540 -
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r40756 r40763 25 25 */ 26 26 27 /** @todo Convert this to a generic tracer implementation. */ 27 28 28 29 /******************************************************************************* … … 596 597 * @param pszName The driver name. 597 598 */ 598 SUPR0DECL(int) SUPR0 VtgRegisterDrv(PSUPDRVSESSION pSession, PVTGOBJHDR pVtgHdr, const char *pszName)599 SUPR0DECL(int) SUPR0TracerRegisterDrv(PSUPDRVSESSION pSession, PVTGOBJHDR pVtgHdr, const char *pszName) 599 600 { 600 601 int rc; … … 622 623 * @param pVtgHdr The VTG header. 623 624 */ 624 SUPR0DECL(void) SUPR0 VtgDeregisterDrv(PSUPDRVSESSION pSession)625 SUPR0DECL(void) SUPR0TracerDeregisterDrv(PSUPDRVSESSION pSession) 625 626 { 626 627 PSUPDRVDTPROVIDER pProv, pProvNext; … … 662 663 * @param pVtgHdr The VTG header. 663 664 */ 664 SUPR0DECL(int) SUPR0 VtgRegisterModule(void *hMod, PVTGOBJHDR pVtgHdr)665 SUPR0DECL(int) SUPR0TracerRegisterModule(void *hMod, PVTGOBJHDR pVtgHdr) 665 666 { 666 667 PSUPDRVLDRIMAGE pImage = (PSUPDRVLDRIMAGE)hMod; … … 736 737 * @returns VBox status code. 737 738 * @param pDevExt The device extension structure. 738 * @param p VtgFireProbe Pointer to the SUPR0VtgFireProbe entry.739 */ 740 int VBOXCALL supdrvVtgInit(PSUPDRVDEVEXT pDevExt, PSUPFUNC p VtgFireProbe)741 { 742 Assert(!strcmp(p VtgFireProbe->szName, "SUPR0VtgFireProbe"));739 * @param pFireProbeEntry Pointer to the SUPR0TracerFireProbe entry. 740 */ 741 int VBOXCALL supdrvVtgInit(PSUPDRVDEVEXT pDevExt, PSUPFUNC pFireProbeEntry) 742 { 743 Assert(!strcmp(pFireProbeEntry->szName, "SUPR0TracerFireProbe")); 743 744 744 745 /* … … 749 750 { 750 751 #ifdef RT_OS_SOLARIS 751 p VtgFireProbe->pfn = (void *)(uintptr_t)dtrace_probe;752 pFireProbeEntry->pfn = (void *)(uintptr_t)dtrace_probe; 752 753 #endif 753 754 RTListInit(&pDevExt->DtProviderList); -
trunk/src/VBox/HostDrivers/Support/SUPDrv-tracer.cpp
r40759 r40763 65 65 * SUPR0VtgRegisterDrv. NULL if pImage is set. */ 66 66 PSUPDRVSESSION pSession; 67 /** The module name. */68 const char *pszModName;69 67 70 68 /** Set when the module is unloaded or the driver deregisters its probes. */ … … 95 93 96 94 95 96 /** 97 * Validates a VTG string against length and characterset limitations. 98 * 99 * @returns VINF_SUCCESS, VERR_SUPDRV_VTG_BAD_STRING or 100 * VERR_SUPDRV_VTG_STRING_TOO_LONG. 101 * @param psz The string. 102 */ 97 103 static int supdrvVtgValidateString(const char *psz) 98 104 { … … 120 126 return VERR_SUPDRV_VTG_STRING_TOO_LONG; 121 127 } 128 122 129 123 130 /** … … 533 540 pProv->Core.pHdr = pVtgHdr; 534 541 pProv->Core.pszName = &pProv->szName[0]; 542 pProv->Core.pszModName = pszModName; 535 543 pProv->pImage = pImage; 536 544 pProv->pSession = pSession; 537 pProv->pszModName = pszModName;538 545 pProv->fZombie = false; 539 546 pProv->fRegistered = true; … … 598 605 * @param pszName The driver name. 599 606 */ 600 SUPR0DECL(int) SUPR0 VtgRegisterDrv(PSUPDRVSESSION pSession, PVTGOBJHDR pVtgHdr, const char *pszName)607 SUPR0DECL(int) SUPR0TracerRegisterDrv(PSUPDRVSESSION pSession, PVTGOBJHDR pVtgHdr, const char *pszName) 601 608 { 602 609 int rc; … … 624 631 * @param pVtgHdr The VTG header. 625 632 */ 626 SUPR0DECL(void) SUPR0 VtgDeregisterDrv(PSUPDRVSESSION pSession)633 SUPR0DECL(void) SUPR0TracerDeregisterDrv(PSUPDRVSESSION pSession) 627 634 { 628 635 PSUPDRVTPPROVIDER pProv, pProvNext; … … 664 671 * @param pVtgHdr The VTG header. 665 672 */ 666 SUPR0DECL(int) SUPR0 VtgRegisterModule(void *hMod, PVTGOBJHDR pVtgHdr)673 SUPR0DECL(int) SUPR0TracerRegisterModule(void *hMod, PVTGOBJHDR pVtgHdr) 667 674 { 668 675 PSUPDRVLDRIMAGE pImage = (PSUPDRVLDRIMAGE)hMod; … … 704 711 705 712 /** 706 * Registers the tracer .713 * Registers the tracer implementation. 707 714 * 708 715 * This should be called from the ModuleInit code or from a ring-0 session. … … 714 721 * @param ppHlp Where to return the tracer helper method table. 715 722 */ 716 SUPR0DECL(int) SUPR0TracerRegister (void *hMod, PSUPDRVSESSION pSession, PCSUPDRVTRACERREG pReg, PCSUPDRVTRACERHLP *ppHlp)723 SUPR0DECL(int) SUPR0TracerRegisterImpl(void *hMod, PSUPDRVSESSION pSession, PCSUPDRVTRACERREG pReg, PCSUPDRVTRACERHLP *ppHlp) 717 724 { 718 725 PSUPDRVLDRIMAGE pImage = (PSUPDRVLDRIMAGE)hMod; … … 774 781 775 782 /** 776 * Deregister a tracer associated with a ring-0 session.783 * Deregister a tracer implementation associated with a ring-0 session. 777 784 * 778 785 * @returns VBox status code. 779 786 * @param pSession Ring-0 session handle. 780 787 */ 781 SUPR0DECL(int) SUPR0TracerDeregister (PSUPDRVSESSION pSession)788 SUPR0DECL(int) SUPR0TracerDeregisterImpl(PSUPDRVSESSION pSession) 782 789 { 783 790 PSUPDRVDEVEXT pDevExt; -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r40756 r40763 163 163 { "SUPR0AbsKernelFS", (void *)0 }, 164 164 { "SUPR0AbsKernelGS", (void *)0 }, 165 { "SUPR0 VtgFireProbe", (void *)SUPR0VtgFireProbe },165 { "SUPR0TracerFireProbe", (void *)SUPR0TracerFireProbe }, 166 166 /* Normal function pointers: */ 167 167 { "SUPR0ComponentRegisterFactory", (void *)SUPR0ComponentRegisterFactory }, … … 204 204 { "SUPR0GetPagingMode", (void *)SUPR0GetPagingMode }, 205 205 { "SUPR0EnableVTx", (void *)SUPR0EnableVTx }, 206 { "SUPR0 VtgRegisterModule", (void *)SUPR0VtgRegisterModule },206 { "SUPR0TracerRegisterModule", (void *)SUPR0TracerRegisterModule }, 207 207 { "SUPGetGIP", (void *)SUPGetGIP }, 208 208 { "g_pSUPGlobalInfoPage", (void *)&g_pSUPGlobalInfoPage }, … … 3685 3685 * Stub function. 3686 3686 */ 3687 SUPR0DECL(void) SUPR0 VtgFireProbe(uint32_t idProbe, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2,3688 uintptr_t uArg3, uintptr_t uArg4)3687 SUPR0DECL(void) SUPR0TracerFireProbe(uint32_t idProbe, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2, 3688 uintptr_t uArg3, uintptr_t uArg4) 3689 3689 { 3690 3690 NOREF(idProbe); NOREF(uArg0); NOREF(uArg1); NOREF(uArg2); NOREF(uArg3); NOREF(uArg4); … … 3696 3696 * Stub function. 3697 3697 */ 3698 SUPR0DECL(int) SUPR0 VtgRegisterModule(void *hMod, struct VTGOBJHDR *pVtgHdr)3698 SUPR0DECL(int) SUPR0TracerRegisterModule(void *hMod, struct VTGOBJHDR *pVtgHdr) 3699 3699 { 3700 3700 NOREF(hMod); NOREF(pVtgHdr); -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r40636 r40763 193 193 * - None. 194 194 */ 195 #define SUPDRV_IOC_VERSION 0x0019000 1195 #define SUPDRV_IOC_VERSION 0x00190002 196 196 197 197 /** SUP_IOCTL_COOKIE. */ … … 325 325 * 326 326 * @returns 0 on success. 327 * @returns Appropriate error code on failure. 327 * @returns Appropriate error code on failure. 328 328 * @param hMod Image handle for use in APIs. 329 329 */ … … 334 334 /** 335 335 * Module termination callback function. 336 * This is called once right before the module is being unloaded. 337 * 336 * This is called once right before the module is being unloaded. 337 * 338 338 * @param hMod Image handle for use in APIs. 339 339 */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r40636 r40763 268 268 CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; 269 269 const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00190000 270 ? 0x0019000 1270 ? 0x00190002 271 271 : SUPDRV_IOC_VERSION & 0xffff0000; 272 272 CookieReq.u.In.u32MinVersion = uMinVersion; -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r40644 r40763 107 107 #ifdef VBOX_WITH_DTRACE_R0 108 108 /* 109 * The first thing to do is register the static tracepoints. 110 * (Deregistration is automatic.) 111 */ 112 int rc2 = SUPR0 VtgRegisterModule(hMod, &g_VTGObjHeader);109 * The first thing to do is register the static tracepoints. 110 * (Deregistration is automatic.) 111 */ 112 int rc2 = SUPR0TracerRegisterModule(hMod, &g_VTGObjHeader); 113 113 if (RT_FAILURE(rc2)) 114 114 return rc2; … … 194 194 /** 195 195 * Terminate the module. 196 * This is called when we're finally unloaded. 197 * 196 * This is called when we're finally unloaded. 197 * 198 198 * @param hMod Image handle for use in APIs. 199 199 */ -
trunk/src/bldprogs/VBoxTpG.cpp
r40641 r40763 160 160 static unsigned g_cAssemblerOptions = 0; 161 161 static const char *g_apszAssemblerOptions[32]; 162 static const char *g_pszProbeFnName = "SUPR0 VtgFireProbe";162 static const char *g_pszProbeFnName = "SUPR0TracerFireProbe"; 163 163 static bool g_fProbeFnImported = true; 164 164 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.