From c42ce973ebfd490fb687604a7e6e099adfd41666 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 29 Mar 2022 17:25:16 -0400 Subject: [PATCH] profile: Track unknown image hits in Inclusive mode. Solves a TODO. --- src/bin/debug/profile/BasicProfileResult.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bin/debug/profile/BasicProfileResult.cpp b/src/bin/debug/profile/BasicProfileResult.cpp index 775b101175..21eb0e42dd 100644 --- a/src/bin/debug/profile/BasicProfileResult.cpp +++ b/src/bin/debug/profile/BasicProfileResult.cpp @@ -286,10 +286,12 @@ InclusiveProfileResult::AddSamples(ImageProfileResultContainer* container, int32 symbol = -1; if (image != NULL) { symbol = image->GetImage()->FindSymbol(address - loadDelta); - if (symbol < 0) { - // TODO: Count unknown image hits? - } else if (image != previousImage || symbol != previousSymbol) - image->AddSymbolHit(symbol); + if (image != previousImage || symbol != previousSymbol) { + if (symbol < 0) + image->AddUnknownHit(); + else + image->AddSymbolHit(symbol); + } if (image != previousImage) image->AddImageHit();