コード例 #1
0
int COHScriptObject::EditorGroupingCategory() {
  // Category 0: autoplayer / OpenPPL
  if (p_function_collection->IsOpenPPLProfile()  && IsMainOpenPPLFunction()) return 0;
  if (!p_function_collection->IsOpenPPLProfile() && IsAutoplayerFunction())  return 0;
  // Category 1: Secondary (f$chat,..) DLL, notes)
  if (IsSecondaryFunction()) return 1;
  if (IsNotesOrDLL()) return 1;
  // Category 2: Hopper funvtions (f$sitin, f$close, ...)
  if (IsHopperFunction()) return 2;
  // Category 3: Ini-fucntions
  if (IsIniFunction()) return 3;
  // Category 4: PrWin functions
  if (IsPrWinFunction()) return 4;
  // Category 5: ICM-functions
  if (IsICMConfigurationFunction()) return 5;
  // Category 6: debug-functions
  if (IsDebugFunction()) return 6;
  // Category 7: hand-lists
  if (IsList()) return 7;
  // Category 8: other user defined functions
  if (IsUserDefinedFunction()) return 8;
  // Treat undefined as user-defined;
  return 7;
}
コード例 #2
0
ファイル: StackInfo.cpp プロジェクト: krishnais/ProfileSharp
UINT64 StackInfo::PopFunction(UINT64 llCycleCount )
{
	UINT64 llElapsed=0;
	if(CAN_PROFILE_FOR_FUNCTIONS && IS_PROFILEDPROCESSFORFUNCTIONS)  
			{				
				try
				{
					if ( _sFunctionStack.size() > 0 )
					{
						llElapsed = llCycleCount - _sFunctionStack.top().llCycleStart;
						FunctionInfo* pFunctionInfo = _sFunctionStack.top().pFunctionInfo;
						FunctionID fidCallee = pFunctionInfo->fid;

						pFunctionInfo->nRecursiveCount--;
						if ( pFunctionInfo->nRecursiveCount == 0 )
							pFunctionInfo->llCycleCount += llElapsed;
						else
							pFunctionInfo->llRecursiveCycleCount += llElapsed; 
						
						_sFunctionStack.pop();

							FunctionInfo* _parentFunctionInfo=NULL;	//V. Imp

							if(_sFunctionStack.size() > 0)
									{
										_parentFunctionInfo=_sFunctionStack.top().pFunctionInfo;									
										_parentFunctionInfo->childCycleCount+=llElapsed; 										
									}

							if(WANT_FUNCTION_CODE_VIEW)
								{
									if(_parentFunctionInfo)
										{
											if(!IsDebugFunction(_parentFunctionInfo->fid))
												goto A;
											if(!RetryGetInfo(_parentFunctionInfo,llElapsed))
											{
												RetryGetInfo(_parentFunctionInfo,llElapsed);
											}
										}
								}

A:
							if(WANT_NO_FUNCTION_CALLEE_INFORMATION  || ! WANT_FUNCTION_CALLEE_ID )
								{
									goto B;
								}
								if(_parentFunctionInfo)
									{
										CalleeFunctionInfo* pCalleeFunctionInfo = _parentFunctionInfo->GetCalleeFunctionInfo( fidCallee );
											pCalleeFunctionInfo->nRecursiveCount--;
										if ( pCalleeFunctionInfo->nRecursiveCount == 0 )
											pCalleeFunctionInfo->llCycleCount += llElapsed;
										else
											pCalleeFunctionInfo->llRecursiveCycleCount += llElapsed;
									}
						}

					B:	

						return llElapsed;
					}
					catch(...)
					{					
					}
				}		

	else if(IS_PROFILEDPROCESSFOROBJECTS )
			{
				if(WANT_OBJECT_ALLOCATION_DATA)
					{
						try
						{
							if(_sFunctionStack.size()>0)
							{
								FunctionInfo* pFunctionInfo = _sFunctionStack.top().pFunctionInfo;						
								pFunctionInfo->nRecursiveCount--;
								if(pFunctionInfo->nRecursiveCount==0)
								{
									_sFunctionStack.pop();							
								}
							}
						}
						catch(...)
						{					
						}
					}
			}

	return llElapsed;
}