From: buzbee Date: Fri, 18 Feb 2011 19:13:56 +0000 (-0800) Subject: [JIT] Fix profile trace dump X-Git-Tag: android-x86-4.0-r1~156^2~165^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=03af43a4851879e98de8ffc19c786c293f68f4e7;p=android-x86%2Fdalvik.git [JIT] Fix profile trace dump The debugging profile mode prints out a list of the top ten traces, followed by recompilations. In some cases, it is possible that a trace was requested, but did not finish compiling before the run ended. If so, that could cause the dump to fail. This CL adds a check for null codeAddress to detect those cases. Change-Id: I415fd94d8fa9e270f75d5114fa5cc5d993bd6997 --- diff --git a/vm/compiler/codegen/arm/Assemble.c b/vm/compiler/codegen/arm/Assemble.c index f5fecbc47..34793ee9f 100644 --- a/vm/compiler/codegen/arm/Assemble.c +++ b/vm/compiler/codegen/arm/Assemble.c @@ -1991,7 +1991,8 @@ JitTraceDescription *dvmCopyTraceDescriptor(const u2 *pc, { const JitEntry *jitEntry = knownEntry ? knownEntry : dvmJitFindEntry(pc, false); - if (jitEntry == NULL) return NULL; + if ((jitEntry == NULL) || (jitEntry->codeAddress == 0)) + return NULL; /* Find out the startint point */ char *traceBase = getTraceBase(jitEntry); @@ -2078,8 +2079,10 @@ void dvmCompilerSortAndPrintTraceProfiles() } JitTraceDescription* desc = dvmCopyTraceDescriptor(NULL, &sortedEntries[i]); - dvmCompilerWorkEnqueue(sortedEntries[i].dPC, - kWorkOrderTraceDebug, desc); + if (desc) { + dvmCompilerWorkEnqueue(sortedEntries[i].dPC, + kWorkOrderTraceDebug, desc); + } } free(sortedEntries);