HPROF is here to stay, make WITH_HPROF the default.

Change-Id: Ic9947461daa21641fd9d34d52b6c7998716d8ab2
diff --git a/vm/Dvm.mk b/vm/Dvm.mk
index 18a8cff..081c44f 100644
--- a/vm/Dvm.mk
+++ b/vm/Dvm.mk
@@ -142,6 +142,11 @@
 	analysis/Optimize.c \
 	analysis/RegisterMap.c \
 	analysis/VerifySubs.c \
+	hprof/Hprof.c \
+	hprof/HprofClass.c \
+	hprof/HprofHeap.c \
+	hprof/HprofOutput.c \
+	hprof/HprofString.c \
 	interp/Interp.c.arm \
 	interp/Stack.c \
 	jdwp/ExpandBuf.c \
@@ -222,26 +227,12 @@
 	interp/Jit.c
 endif
 
-WITH_HPROF := $(strip $(WITH_HPROF))
-ifeq ($(WITH_HPROF),)
-  WITH_HPROF := true
-endif
-ifeq ($(WITH_HPROF),true)
+ifeq ($(strip $(WITH_HPROF_STACK)),true)
   LOCAL_SRC_FILES += \
-	hprof/Hprof.c \
-	hprof/HprofClass.c \
-	hprof/HprofHeap.c \
-	hprof/HprofOutput.c \
-	hprof/HprofString.c
-  LOCAL_CFLAGS += -DWITH_HPROF=1
-
-  ifeq ($(strip $(WITH_HPROF_STACK)),true)
-    LOCAL_SRC_FILES += \
 	hprof/HprofStack.c \
 	hprof/HprofStackFrame.c
-    LOCAL_CFLAGS += -DWITH_HPROF_STACK=1
-  endif # WITH_HPROF_STACK
-endif   # WITH_HPROF
+  LOCAL_CFLAGS += -DWITH_HPROF_STACK=1
+endif # WITH_HPROF_STACK
 
 LOCAL_C_INCLUDES += \
 	$(JNI_H_INCLUDE) \
diff --git a/vm/Init.c b/vm/Init.c
index 07b3ad8..77c1490 100644
--- a/vm/Init.c
+++ b/vm/Init.c
@@ -145,9 +145,7 @@
 #ifdef WITH_DEADLOCK_PREDICTION
         " deadlock_prediction"
 #endif
-#ifdef WITH_HPROF
         " hprof"
-#endif
 #ifdef WITH_HPROF_STACK
         " hprof_stack"
 #endif
diff --git a/vm/alloc/Alloc.c b/vm/alloc/Alloc.c
index a897c67..943f115 100644
--- a/vm/alloc/Alloc.c
+++ b/vm/alloc/Alloc.c
@@ -21,7 +21,7 @@
 #include "alloc/HeapInternal.h"
 #include "alloc/HeapSource.h"
 
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
 #include "hprof/Hprof.h"
 #endif
 
@@ -184,7 +184,7 @@
     newObj = dvmMalloc(clazz->objectSize, flags);
     if (newObj != NULL) {
         DVM_OBJECT_INIT(newObj, clazz);
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
         hprofFillInStackTrace(newObj);
 #endif
         dvmTrackAllocation(clazz, clazz->objectSize);
@@ -227,7 +227,7 @@
     copy = dvmMalloc(size, flags);
     if (copy == NULL)
         return NULL;
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
     hprofFillInStackTrace(copy);
     dvmTrackAllocation(obj->clazz, size);
 #endif
diff --git a/vm/native/dalvik_system_VMDebug.c b/vm/native/dalvik_system_VMDebug.c
index 80e97e0..cc0ac01 100644
--- a/vm/native/dalvik_system_VMDebug.c
+++ b/vm/native/dalvik_system_VMDebug.c
@@ -122,11 +122,9 @@
     /* VM responds to DDMS method profiling requests */
     features[idx++] = "method-trace-profiling";
     features[idx++] = "method-trace-profiling-streaming";
-#ifdef WITH_HPROF
     /* VM responds to DDMS heap dump requests */
     features[idx++] = "hprof-heap-dump";
     features[idx++] = "hprof-heap-dump-streaming";
-#endif
 
     assert(idx <= MAX_FEATURE_COUNT);
 
@@ -646,7 +644,6 @@
 static void Dalvik_dalvik_system_VMDebug_dumpHprofData(const u4* args,
     JValue* pResult)
 {
-#ifdef WITH_HPROF
     StringObject* fileNameStr = (StringObject*) args[0];
     Object* fileDescriptor = (Object*) args[1];
     char* fileName;
@@ -687,9 +684,6 @@
             "Failure during heap dump -- check log output for details");
         RETURN_VOID();
     }
-#else
-    dvmThrowException("Ljava/lang/UnsupportedOperationException;", NULL);
-#endif
 
     RETURN_VOID();
 }
@@ -702,7 +696,6 @@
 static void Dalvik_dalvik_system_VMDebug_dumpHprofDataDdms(const u4* args,
     JValue* pResult)
 {
-#ifdef WITH_HPROF
     int result;
 
     result = hprofDumpHeap("[DDMS]", -1, true);
@@ -713,9 +706,6 @@
             "Failure during heap dump -- check log output for details");
         RETURN_VOID();
     }
-#else
-    dvmThrowException("Ljava/lang/UnsupportedOperationException;", NULL);
-#endif
 
     RETURN_VOID();
 }
diff --git a/vm/oo/Array.c b/vm/oo/Array.c
index f026161..c7c862c 100644
--- a/vm/oo/Array.c
+++ b/vm/oo/Array.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <stddef.h>
 
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
 #include "hprof/Hprof.h"
 #endif
 
@@ -65,7 +65,7 @@
         newArray->length = length;
         LOGVV("AllocArray: %s [%d] (%d)\n",
             arrayClass->descriptor, (int) length, (int) size);
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
         hprofFillInStackTrace(&newArray->obj);
 #endif
         dvmTrackAllocation(arrayClass, size);
@@ -437,7 +437,7 @@
                       (Object *)elementClass->classLoader);
     newClass->arrayDim = arrayDim;
     newClass->status = CLASS_INITIALIZED;
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
     hprofFillInStackTrace(newClass);
 #endif
 
@@ -644,7 +644,7 @@
     newClass->descriptor = kClassDescriptors[idx];
     //newClass->super = gDvm.classJavaLangObject;
     newClass->status = CLASS_INITIALIZED;
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
     hprofFillInStackTrace(newClass);
 #endif
 
diff --git a/vm/reflect/Proxy.c b/vm/reflect/Proxy.c
index d768777..7d0aad5 100644
--- a/vm/reflect/Proxy.c
+++ b/vm/reflect/Proxy.c
@@ -195,7 +195,7 @@
     dvmSetFieldObject((Object *)newClass,
                       offsetof(ClassObject, classLoader),
                       (Object *)loader);
-#if WITH_HPROF && WITH_HPROF_STACK
+#if WITH_HPROF_STACK
     hprofFillInStackTrace(newClass);
 #endif