Changeset 40605 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Mar 24, 2012 9:05:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r40602 r40605 33 33 34 34 #include <VBox/err.h> 35 #include <VBox/log.h> 35 36 #include <VBox/VBoxTpG.h> 36 37 … … 659 660 660 661 661 662 663 664 662 /** 665 663 * @callback_method_impl{dtrace_pops_t,dtps_provide} … … 679 677 /* Need a buffer for extracting the function names and mangling them in 680 678 case of collision. */ 681 pszFnNmBuf = (char *)RTMemAlloc( _4K + _1K);679 pszFnNmBuf = (char *)RTMemAlloc(cbFnNmBuf); 682 680 if (!pszFnNmBuf) 683 681 return; … … 698 696 brave/stupid enough to use function pointer returns without 699 697 typedef'ing properly them. */ 700 const char *psz Name = supdrvVtgGetString(pProv->pHdr, pProbeDesc->offName);701 const char *pszFunc = pProbeLoc->pszFunction;702 const char *psz = strchr(pProbeLoc->pszFunction, '(');698 const char *pszPrbName = supdrvVtgGetString(pProv->pHdr, pProbeDesc->offName); 699 const char *pszFunc = pProbeLoc->pszFunction; 700 const char *psz = strchr(pProbeLoc->pszFunction, '('); 703 701 size_t cch; 704 702 if (psz) 705 703 { 706 pszFunc = psz - 1; /* ASSUMES not space... FIXME */ 704 /* skip blanks preceeding the parameter parenthesis. */ 705 while ( (uintptr_t)psz > (uintptr_t)pProbeLoc->pszFunction 706 && RT_C_IS_BLANK(psz[-1])) 707 psz--; 708 709 /* Find the start of the function name. */ 710 pszFunc = psz - 1; 707 711 while ((uintptr_t)pszFunc > (uintptr_t)pProbeLoc->pszFunction) 708 712 { … … 721 725 the function name a little to avoid having to deal with having 722 726 multiple location entries with the same probe ID. (lazy bird) */ 723 724 //dtrace_probe_lookup()725 //dtrace_probe_create()726 727 727 Assert(pProbeLoc->idProbe == UINT32_MAX); 728 if (dtrace_probe_lookup(pProv->idDtProv, pProv->pszModName, pszFnNmBuf, pszPrbName) != DTRACE_IDNONE) 729 { 730 RTStrPrintf(pszFnNmBuf+cch, cbFnNmBuf - cch, "-%u", pProbeLoc->uLine); 731 if (dtrace_probe_lookup(pProv->idDtProv, pProv->pszModName, pszFnNmBuf, pszPrbName) != DTRACE_IDNONE) 732 { 733 unsigned iOrd = 2; 734 while (iOrd < 128) 735 { 736 RTStrPrintf(pszFnNmBuf+cch, cbFnNmBuf - cch, "-%u-%u", pProbeLoc->uLine, iOrd); 737 if (dtrace_probe_lookup(pProv->idDtProv, pProv->pszModName, pszFnNmBuf, pszPrbName) == DTRACE_IDNONE) 738 break; 739 iOrd++; 740 } 741 if (iOrd >= 128) 742 { 743 LogRel(("VBoxDrv: More than 128 duplicate probe location instances in file %s at line %u, function %s [%s], probe %s\n", 744 pProbeLoc->pszFile, pProbeLoc->uLine, pProbeLoc->pszFunction, pszFnNmBuf, pszPrbName)); 745 continue; 746 } 747 } 748 } 749 750 /* Create the probe. */ 751 AssertCompile(sizeof(pProbeLoc->idProbe) == sizeof(dtrace_id_t)); 752 pProbeLoc->idProbe = dtrace_probe_create(pProv->idDtProv, pProv->pszModName, pszFnNmBuf, pszPrbName, 753 0 /*aframes*/, pProbeLoc); 728 754 } 729 755
Note:
See TracChangeset
for help on using the changeset viewer.