From 859ad9551c1b79b9cecafedb3b1d29741b15253d Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 13 May 2004 18:59:37 +0000 Subject: [PATCH] Skip over __restore_rt frames when generating profile analysis results. Bug 243483, r=shaver, sr=dbaron git-svn-id: svn://10.0.0.236/trunk@156367 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/tools/jprof/leaky.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mozilla/tools/jprof/leaky.cpp b/mozilla/tools/jprof/leaky.cpp index b91dbf17557..420d253cb5c 100644 --- a/mozilla/tools/jprof/leaky.cpp +++ b/mozilla/tools/jprof/leaky.cpp @@ -495,8 +495,19 @@ void leaky::analyze() int idx=-1, parrentIdx=-1; // Init idx incase n==0 for(int i=n-1; i>=0; --i, --pcp, parrentIdx=idx) { idx = findSymbolIndex(reinterpret_cast(*pcp)); - if(idx>=0) { + if(idx>=0) { + // Skip over bogus __restore_rt frames that realtime profiling + // can introduce. + if (i > 0 && !strcmp(externalSymbols[idx].name, "__restore_rt")) { + --pcp; + --i; + idx = findSymbolIndex(reinterpret_cast(*pcp)); + if (idx < 0) { + continue; + } + } + // If we have not seen this symbol before count it and mark it as seen if(flagArray[idx]!=stacks && ((flagArray[idx]=stacks) || true)) { ++countArray[idx];