Changeset 40617 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Mar 25, 2012 7:36:15 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77032
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r40612 r40617 78 78 /** The ID of this provider. */ 79 79 dtrace_provider_id_t idDtProv; 80 /** The number of probes we've provided to DTrace. */ 81 uint32_t cProvidedProbes; 80 82 } SUPDRVDTPROVIDER; 81 83 /** Pointer to the data for a provider. */ … … 454 456 if (pProv) 455 457 { 456 pProv->pDesc = pDesc; 457 pProv->pHdr = pVtgHdr; 458 pProv->pImage = pImage; 459 pProv->pSession = pSession; 460 pProv->pszModName = pszModName; 461 pProv->idDtProv = 0; 458 pProv->pDesc = pDesc; 459 pProv->pHdr = pVtgHdr; 460 pProv->pImage = pImage; 461 pProv->pSession = pSession; 462 pProv->pszModName = pszModName; 463 pProv->idDtProv = 0; 464 pProv->cProvidedProbes = 0; 462 465 supdrvVtgConvAttr(&pProv->DtAttrs.dtpa_provider, &pDesc->AttrSelf); 463 466 supdrvVtgConvAttr(&pProv->DtAttrs.dtpa_mod, &pDesc->AttrModules); … … 674 677 return; /* We don't generate probes, so never mind these requests. */ 675 678 679 if (pProv->cProvidedProbes >= pProv->pDesc->cProbes) 680 return; 681 676 682 /* Need a buffer for extracting the function names and mangling them in 677 683 case of collision. */ … … 689 695 { 690 696 PVTGDESCPROBE pProbeDesc = (PVTGDESCPROBE)pProbeLoc->pbProbe; 691 if (pProbeDesc->idxProvider == idxProv) 697 if ( pProbeDesc->idxProvider == idxProv 698 && pProbeLoc->idProbe == UINT32_MAX) 692 699 { 693 700 /* The function name normally needs to be stripped since we're … … 751 758 pProbeLoc->idProbe = dtrace_probe_create(pProv->idDtProv, pProv->pszModName, pszFnNmBuf, pszPrbName, 752 759 0 /*aframes*/, pProbeLoc); 760 pProv->cProvidedProbes++; 753 761 } 754 762 … … 765 773 static int supdrvDTracePOps_Enable(void *pvProv, dtrace_id_t idProbe, void *pvProbe) 766 774 { 767 PVTGPROBELOC pProbeLoc = (PVTGPROBELOC)pvProbe; 768 PVTGDESCPROBE pProbeDesc = (PVTGDESCPROBE)pProbeLoc->pbProbe; 775 PSUPDRVDTPROVIDER pProv = (PSUPDRVDTPROVIDER)pvProv; 776 PVTGPROBELOC pProbeLoc = (PVTGPROBELOC)pvProbe; 777 PVTGDESCPROBE pProbeDesc = (PVTGDESCPROBE)pProbeLoc->pbProbe; 769 778 770 779 if (!pProbeLoc->fEnabled) … … 772 781 pProbeLoc->fEnabled = 1; 773 782 if (ASMAtomicIncU32(&pProbeDesc->u32User) == 1) 774 pPro beLoc->fEnabled= 1;783 pProv->pHdr->pafProbeEnabled[pProbeDesc->idxEnabled] = 1; 775 784 } 776 785 … … 785 794 static void supdrvDTracePOps_Disable(void *pvProv, dtrace_id_t idProbe, void *pvProbe) 786 795 { 787 PVTGPROBELOC pProbeLoc = (PVTGPROBELOC)pvProbe; 788 PVTGDESCPROBE pProbeDesc = (PVTGDESCPROBE)pProbeLoc->pbProbe; 796 PSUPDRVDTPROVIDER pProv = (PSUPDRVDTPROVIDER)pvProv; 797 PVTGPROBELOC pProbeLoc = (PVTGPROBELOC)pvProbe; 798 PVTGDESCPROBE pProbeDesc = (PVTGDESCPROBE)pProbeLoc->pbProbe; 789 799 790 800 if (pProbeLoc->fEnabled) … … 792 802 pProbeLoc->fEnabled = 0; 793 803 if (ASMAtomicDecU32(&pProbeDesc->u32User) == 0) 794 pPro beLoc->fEnabled = 0;804 pProv->pHdr->pafProbeEnabled[pProbeDesc->idxEnabled] = 1; 795 805 } 796 806 … … 816 826 size_t cchType = strlen(pszType); 817 827 if (cchType < sizeof(pArgDesc->dtargd_native)) 828 { 818 829 memcpy(pArgDesc->dtargd_native, pszType, cchType + 1); 830 /** @todo mapping */ 831 } 819 832 else 820 833 pArgDesc->dtargd_ndx = DTRACE_ARGNONE; … … 842 855 static void supdrvDTracePOps_Destroy(void *pvProv, dtrace_id_t idProbe, void *pvProbe) 843 856 { 857 PSUPDRVDTPROVIDER pProv = (PSUPDRVDTPROVIDER)pvProv; 844 858 PVTGPROBELOC pProbeLoc = (PVTGPROBELOC)pvProbe; 845 859 … … 847 861 Assert(pProbeLoc->idProbe == idProbe); NOREF(idProbe); 848 862 pProbeLoc->idProbe = UINT32_MAX; 849 850 NOREF(pvProv); 851 } 852 863 pProv->cProvidedProbes--; 864 } 865
Note:
See TracChangeset
for help on using the changeset viewer.