@@ -767,13 +767,13 @@ trace::WSTRING* NamingHelper::Lookup(const FunctionIdentifier& function_identifi
767767
768768FunctionIdentifier NamingHelper::Lookup (const FunctionID functionId, const COR_PRF_FRAME_INFO frameInfo)
769769{
770- const FunctionIdentifierResolveArgs cacheKey = {functionId, frameInfo };
770+ const FunctionIdentifierResolveArgs cacheKey = {functionId};
771771 const auto cachedIdentifier = function_identifier_cache_.Get (cacheKey);
772772 if (cachedIdentifier.is_valid )
773773 {
774774 return cachedIdentifier;
775775 }
776- const auto resolvedIdentifier = this ->GetFunctionIdentifier (cacheKey.function_id , cacheKey. frame_info );
776+ const auto resolvedIdentifier = this ->GetFunctionIdentifier (cacheKey.function_id , frameInfo );
777777 function_identifier_cache_.Put (cacheKey, resolvedIdentifier);
778778 return resolvedIdentifier;
779779}
@@ -799,7 +799,15 @@ static HRESULT __stdcall FrameCallback(_In_ FunctionID func_id,
799799 const auto params = static_cast <DoStackSnapshotParams*>(client_data);
800800 params->prof ->stats_ .total_frames ++;
801801
802- const auto identifier = params->prof ->helper .Lookup (func_id, frame_info);
802+ // Use '0' as a frame_info value.
803+ // It is documented to be equivalent to using value provided in frame_info parameter.
804+ // See
805+ // https://github.com/dotnet/runtime/blob/988296b080776c885ee0725b481db4ae4d4360ed/src/coreclr/inc/corprof.idl#L3167-L3172
806+ // and
807+ // https://github.com/dotnet/runtime/blob/bda571bfc728369cc2bbd33f2c161ea73c762b8d/docs/design/coreclr/profiling/davbr-blog-archive/Generics%20and%20Your%20Profiler.md?plain=1#L82-L101
808+ // for details.
809+
810+ const auto identifier = params->prof ->helper .Lookup (func_id, 0 );
803811 params->buffer ->push_back (identifier);
804812
805813 return S_OK;
0 commit comments