OSDN Git Service

Don't decr profiling count without incr
authorAndy McFadden <fadden@android.com>
Fri, 4 Nov 2011 22:58:37 +0000 (15:58 -0700)
committerAndy McFadden <fadden@android.com>
Fri, 4 Nov 2011 22:59:43 +0000 (15:59 -0700)
The failure cleanup code in dvmMethodTraceStart() was assuming
that profiling had already been started, which was true until my
previous change.  The code in the interpreter isn't too picky, but
updateActiveProfilers() is trying to keep an accurate acount, and
gets upset.  If you pass in a bad filename, we disable something that
was never enabled, and the VM gets confused and aborts out of spite.

Related to bug 5564440

Change-Id: I17fd8bf4654c29f49efb10142d222a91c190b6ed

vm/Profile.cpp

index c21d1b8..e1dfc43 100644 (file)
@@ -459,7 +459,6 @@ void dvmMethodTraceStart(const char* traceFileName, int traceFd, int bufferSize,
     return;
 
 fail:
-    updateActiveProfilers(kSubModeMethodTrace, false);
     if (state->traceFile != NULL) {
         fclose(state->traceFile);
         state->traceFile = NULL;