예제 #1
0
        internal bool TryGetOrResolveCreatePProfLocationInfo(
            LocationDescriptor locationDescriptor,
            PProfBuildSession pprofBuildSession,
            TryResolveLocationSymbolsDelegate tryResolveLocationSymbolsDelegate,
            out PProfInfo.Location locationInfo)
        {
            if (_cache.TryGetLocationInfo(locationDescriptor, out locationInfo))
            {
                return(true);
            }

            if (
                tryResolveLocationSymbolsDelegate == null ||
                !tryResolveLocationSymbolsDelegate(
                    pprofBuildSession,
                    locationDescriptor,
                    out string functionName,
                    out string classTypeName,
                    out string binaryContainerName,
                    out string binaryContainerVersion))
            {
                locationInfo = null;
                return(false);
            }

            BuildMonikers(
                ref functionName,
                ref classTypeName,
                ref binaryContainerName,
                ref binaryContainerVersion,
                out string functionMoniker,
                out string binaryContainerMoniker);

            // system name is not used so pass null (i.e. empty string)
            PProfInfo.Function functionInfo = _cache.GetOrCreateFunctionInfo(functionMoniker, functionMoniker, null);
            PProfInfo.Mapping  mappingInfo  = _cache.GetOrCreateMappingInfo(binaryContainerMoniker, binaryContainerName, binaryContainerVersion);
            locationInfo = _cache.GetOrCreateLocationInfo(locationDescriptor, mappingInfo, functionInfo);

            return(true);
        }