Index: runtime/vm/profiler_test.cc |
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc |
index 56c9e0310ca16e604d161b481915aaa50c8c17a1..c431944674fd809961d0a55100ba1c41ebf4f5c8 100644 |
--- a/runtime/vm/profiler_test.cc |
+++ b/runtime/vm/profiler_test.cc |
@@ -189,15 +189,7 @@ class AllocationFilter : public SampleFilter { |
bool enable_vm_ticks_; |
}; |
-static void EnableProfiler() { |
- if (!FLAG_profiler) { |
- FLAG_profiler = true; |
- Profiler::InitOnce(); |
- } |
-} |
- |
TEST_CASE(Profiler_TrivialRecordAllocation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = |
"class A {\n" |
@@ -322,8 +314,6 @@ DART_NOINLINE static void NativeAllocationSampleHelper(char** result) { |
} |
ISOLATE_UNIT_TEST_CASE(Profiler_NativeAllocation) { |
- EnableProfiler(); |
- |
bool enable_malloc_hooks_saved = FLAG_profiler_native_memory; |
FLAG_profiler_native_memory = true; |
@@ -526,8 +516,6 @@ ISOLATE_UNIT_TEST_CASE(Profiler_NativeAllocation) { |
// !defined(TARGET_ARCH_DBC) && !defined(HOST_OS_FUCHSIA) |
TEST_CASE(Profiler_ToggleRecordAllocation) { |
- EnableProfiler(); |
- |
DisableNativeProfileScope dnps; |
const char* kScript = |
"class A {\n" |
@@ -657,7 +645,6 @@ TEST_CASE(Profiler_ToggleRecordAllocation) { |
} |
TEST_CASE(Profiler_CodeTicks) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = |
"class A {\n" |
@@ -760,7 +747,6 @@ TEST_CASE(Profiler_CodeTicks) { |
} |
TEST_CASE(Profiler_FunctionTicks) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = |
"class A {\n" |
@@ -863,7 +849,6 @@ TEST_CASE(Profiler_FunctionTicks) { |
} |
TEST_CASE(Profiler_IntrinsicAllocation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = "double foo(double a, double b) => a + b;"; |
Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL); |
@@ -935,7 +920,6 @@ TEST_CASE(Profiler_IntrinsicAllocation) { |
} |
TEST_CASE(Profiler_ArrayAllocation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = |
"List foo() => new List(4);\n" |
@@ -1032,7 +1016,6 @@ TEST_CASE(Profiler_ArrayAllocation) { |
} |
TEST_CASE(Profiler_ContextAllocation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = |
"var msg1 = 'a';\n" |
@@ -1102,7 +1085,6 @@ TEST_CASE(Profiler_ContextAllocation) { |
} |
TEST_CASE(Profiler_ClosureAllocation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = |
"var msg1 = 'a';\n" |
@@ -1174,7 +1156,6 @@ TEST_CASE(Profiler_ClosureAllocation) { |
} |
TEST_CASE(Profiler_TypedArrayAllocation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = |
"import 'dart:typed_data';\n" |
@@ -1259,7 +1240,6 @@ TEST_CASE(Profiler_TypedArrayAllocation) { |
} |
TEST_CASE(Profiler_StringAllocation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
const char* kScript = "String foo(String a, String b) => a + b;"; |
Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL); |
@@ -1345,7 +1325,6 @@ TEST_CASE(Profiler_StringAllocation) { |
} |
TEST_CASE(Profiler_StringInterpolation) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
const char* kScript = "String foo(String a, String b) => '$a | $b';"; |
@@ -1434,7 +1413,6 @@ TEST_CASE(Profiler_StringInterpolation) { |
} |
TEST_CASE(Profiler_FunctionInline) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
@@ -1724,7 +1702,6 @@ TEST_CASE(Profiler_InliningIntervalBoundry) { |
// This test checks the profiler service takes this into account; see |
// ProfileBuilder::ProcessFrame. |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
const char* kScript = |
@@ -1856,7 +1833,6 @@ TEST_CASE(Profiler_InliningIntervalBoundry) { |
} |
TEST_CASE(Profiler_ChainedSamples) { |
- EnableProfiler(); |
MaxProfileDepthScope mpds(32); |
DisableNativeProfileScope dnps; |
@@ -1969,7 +1945,6 @@ TEST_CASE(Profiler_ChainedSamples) { |
} |
TEST_CASE(Profiler_BasicSourcePosition) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
const char* kScript = |
@@ -2044,7 +2019,6 @@ TEST_CASE(Profiler_BasicSourcePosition) { |
} |
TEST_CASE(Profiler_BasicSourcePositionOptimized) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
// We use the AlwaysInline and NeverInline annotations in this test. |
@@ -2138,7 +2112,6 @@ TEST_CASE(Profiler_BasicSourcePositionOptimized) { |
} |
TEST_CASE(Profiler_SourcePosition) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
const char* kScript = |
@@ -2243,7 +2216,6 @@ TEST_CASE(Profiler_SourcePosition) { |
} |
TEST_CASE(Profiler_SourcePositionOptimized) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
// We use the AlwaysInline and NeverInline annotations in this test. |
@@ -2368,7 +2340,6 @@ TEST_CASE(Profiler_SourcePositionOptimized) { |
} |
TEST_CASE(Profiler_BinaryOperatorSourcePosition) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
const char* kScript = |
@@ -2482,7 +2453,6 @@ TEST_CASE(Profiler_BinaryOperatorSourcePosition) { |
} |
TEST_CASE(Profiler_BinaryOperatorSourcePositionOptimized) { |
- EnableProfiler(); |
DisableNativeProfileScope dnps; |
DisableBackgroundCompilationScope dbcs; |
// We use the AlwaysInline and NeverInline annotations in this test. |
@@ -2655,7 +2625,6 @@ static uword FindPCForTokenPosition(const Code& code, TokenPosition tp) { |
} |
TEST_CASE(Profiler_GetSourceReport) { |
- EnableProfiler(); |
const char* kScript = |
"doWork(i) => i * i;\n" |
"main() {\n" |