MCPcopy Create free account
hub / github.com/beefytech/Beef / HandlePendingEntries

Method HandlePendingEntries

IDEHelper/Profiler.cpp:671–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671void DbgProfiler::HandlePendingEntries()
672{
673 bool reverse = false;
674 const int maxStackTrace = 1024;
675 ProfileProcId* procStackTrace[maxStackTrace];
676
677 while (mProfileAddrToProcMap.size() < mProfileAddrEntrySet.size() + 1)
678 mProfileAddrToProcMap.push_back(-1);
679
680 for (int addrEntryIdx = 0; addrEntryIdx < (int)mPendingProfileEntries.size(); addrEntryIdx++)
681 {
682 const ProfileAddrEntry* addrEntry = &mPendingProfileEntries[addrEntryIdx];
683
684 ProfileProcId** procStackTraceHead = reverse ? (procStackTrace + maxStackTrace) : procStackTrace;
685 int stackTraceProcIdx = 0;
686 for (int addrIdx = 0; addrIdx < addrEntry->mSize; addrIdx++)
687 {
688 addr_target addr = addrEntry->mData[addrIdx];
689 if (addrIdx > 0)
690 {
691 // To reference from SourcePC (calling address, not return address)
692 addr--;
693 }
694 ProfileProcId* procId = NULL;
695
696 auto subProgram = mDebugger->mDebugTarget->FindSubProgram(addr, DbgOnDemandKind_LocalOnly);
697 while (stackTraceProcIdx < maxStackTrace)
698 {
699 if (subProgram != NULL)
700 {
701 ProfileProcId** procIdPtr;
702 if (mProcMap.TryAdd(subProgram, NULL, &procIdPtr))
703 {
704 String procName = subProgram->ToString();
705 procId = Get(procName);
706 *procIdPtr = procId;
707 }
708 else
709 procId = *procIdPtr;
710 }
711 else
712 {
713 String symbolName;
714 addr_target symbolOffset = 0;
715 if ((!mDebugger->mDebugTarget->FindSymbolAt(addr, &symbolName, &symbolOffset, NULL, false)) || (symbolOffset > 64 * 1024))
716 {
717 auto dbgModule = mDebugger->mDebugTarget->FindDbgModuleForAddress(addr);
718 if (dbgModule != NULL)
719 symbolName += dbgModule->mDisplayName + "!";
720 symbolName += StrFormat("0x%@", addr);
721 }
722
723 bool isNew = false;
724 procId = Get(symbolName, &isNew);
725 if (isNew)
726 procId->mIsIdle = mIdleSymbolNames.Contains(symbolName);
727 }
728

Callers

nothing calls this directly

Calls 10

GetFunction · 0.85
FindSubProgramMethod · 0.80
FindSymbolAtMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
TryAddMethod · 0.45
ToStringMethod · 0.45
ContainsMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected