diff options
author | Phil Nguyen <philnguyen@google.com> | 2022-03-21 22:59:51 +0000 |
---|---|---|
committer | Phil Nguyen <philnguyen@google.com> | 2022-03-29 13:42:03 -0700 |
commit | 99b69c55c359ecc5855ae7333bb85e05a16cfc99 (patch) | |
tree | 749c507659a68d0573c75e7ed6700c98b48292e1 | |
parent | af82981ea1bc147ce2de0caf374667b3830e6f0f (diff) | |
download | idea-99b69c55c359ecc5855ae7333bb85e05a16cfc99.tar.gz |
Remove "Cpu startup" feature flag
Fixes: 162493986
Test: existing
Change-Id: I832ef01e659d79b900c93bc2644e795981178799
8 files changed, 1 insertions, 33 deletions
diff --git a/android-common/src/com/android/tools/idea/flags/StudioFlags.java b/android-common/src/com/android/tools/idea/flags/StudioFlags.java index 60d6ea0781a..ee4c2af4e41 100644 --- a/android-common/src/com/android/tools/idea/flags/StudioFlags.java +++ b/android-common/src/com/android/tools/idea/flags/StudioFlags.java @@ -107,11 +107,6 @@ public final class StudioFlags { PROFILER, "energy", "Enable Energy profiling", "Enable the new energy profiler. It monitors battery usage of the selected app.", true); - public static final Flag<Boolean> PROFILER_STARTUP_CPU_PROFILING = Flag.create( - PROFILER, "startup.cpu.profiling", "Enable startup CPU Profiling", - "Record a method trace on startup by enabling it in the Profiler tab of Run/Debug configuration.", - true); - public static final Flag<Boolean> PROFILER_MEMORY_CSV_EXPORT = Flag.create( PROFILER, "memory.csv", "Allow exporting entries in memory profiler", "Allow exporting entries in the views for heap dump and native/JVM recordings in CSV format.", diff --git a/android/src/com/android/tools/idea/run/editor/AndroidProfilersPanel.java b/android/src/com/android/tools/idea/run/editor/AndroidProfilersPanel.java index 0e2c571d497..30f6ba28997 100644 --- a/android/src/com/android/tools/idea/run/editor/AndroidProfilersPanel.java +++ b/android/src/com/android/tools/idea/run/editor/AndroidProfilersPanel.java @@ -141,7 +141,7 @@ public class AndroidProfilersPanel { public void applyTo(ProfilerState state) { state.ADVANCED_PROFILING_ENABLED = myAdvancedProfilingCheckBox.isSelected(); - state.STARTUP_CPU_PROFILING_ENABLED = StudioFlags.PROFILER_STARTUP_CPU_PROFILING.get() && myCpuRecordingRadio.isSelected(); + state.STARTUP_CPU_PROFILING_ENABLED = myCpuRecordingRadio.isSelected(); assert myStartupCpuConfigsComboBox.getSelectedItem() instanceof CpuProfilerConfig; state.STARTUP_CPU_PROFILING_CONFIGURATION_NAME = ((CpuProfilerConfig)myStartupCpuConfigsComboBox.getSelectedItem()).getName(); state.STARTUP_NATIVE_MEMORY_PROFILING_ENABLED = myMemoryRecordingRadio.isSelected(); diff --git a/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java b/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java index 50f493843d2..2b080875ed0 100644 --- a/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java +++ b/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java @@ -409,11 +409,6 @@ public class IntellijProfilerServices implements IdeProfilerServices, Disposable } @Override - public boolean isStartupCpuProfilingEnabled() { - return StudioFlags.PROFILER_STARTUP_CPU_PROFILING.get(); - } - - @Override public boolean isUnifiedPipelineEnabled() { return StudioFlags.PROFILER_UNIFIED_PIPELINE.get(); } diff --git a/profilers-android/testSrc/com/android/tools/idea/profilers/ProdAndTestFlagsVerifier.kt b/profilers-android/testSrc/com/android/tools/idea/profilers/ProdAndTestFlagsVerifier.kt index 92c0e7e5c08..27e3252016f 100644 --- a/profilers-android/testSrc/com/android/tools/idea/profilers/ProdAndTestFlagsVerifier.kt +++ b/profilers-android/testSrc/com/android/tools/idea/profilers/ProdAndTestFlagsVerifier.kt @@ -38,7 +38,6 @@ class ProdAndTestFlagsVerifier(val method: Method, val name: String) { val KNOWN_DIVERGENCES = mapOf( "isEnergyProfilerEnabled" to "b/162495674", - "isStartupCpuProfilingEnabled" to "b/162493986", "isUnifiedPipelineEnabled" to "b/162494995") } diff --git a/profilers/src/com/android/tools/profilers/FeatureConfig.java b/profilers/src/com/android/tools/profilers/FeatureConfig.java index 997ce12a3da..f88a664e1df 100644 --- a/profilers/src/com/android/tools/profilers/FeatureConfig.java +++ b/profilers/src/com/android/tools/profilers/FeatureConfig.java @@ -30,7 +30,6 @@ public interface FeatureConfig { boolean isProfileableBuildsEnabled(); - boolean isStartupCpuProfilingEnabled(); boolean isUnifiedPipelineEnabled(); // Add new features alphabetically instead of at the end of the list // This reduces the chance of having to deal with an annoying merge conflict. diff --git a/profilers/src/com/android/tools/profilers/StudioProfilers.java b/profilers/src/com/android/tools/profilers/StudioProfilers.java index 056ec2b861f..0a8a8cc4ccf 100644 --- a/profilers/src/com/android/tools/profilers/StudioProfilers.java +++ b/profilers/src/com/android/tools/profilers/StudioProfilers.java @@ -725,10 +725,6 @@ public class StudioProfilers extends AspectModel<ProfilerAspect> implements Upda * Checks whether startup CPU Profiling started for the selected session by making RPC call to perfd. */ private boolean startupCpuProfilingStarted() { - if (!getIdeServices().getFeatureConfig().isStartupCpuProfilingEnabled()) { - return false; - } - List<Cpu.CpuTraceInfo> traceInfoList = CpuProfiler.getTraceInfoFromSession(myClient, mySelectedSession, myIdeServices.getFeatureConfig().isUnifiedPipelineEnabled()); if (!traceInfoList.isEmpty()) { diff --git a/profilers/testSrc/com/android/tools/profilers/FakeIdeProfilerServices.java b/profilers/testSrc/com/android/tools/profilers/FakeIdeProfilerServices.java index d3ec5ca36c9..2561730ad36 100644 --- a/profilers/testSrc/com/android/tools/profilers/FakeIdeProfilerServices.java +++ b/profilers/testSrc/com/android/tools/profilers/FakeIdeProfilerServices.java @@ -110,11 +110,6 @@ public final class FakeIdeProfilerServices implements IdeProfilerServices { private boolean myShouldProceedYesNoDialog = false; /** - * Can toggle for tests via {@link #enableStartupCpuProfiling(boolean)}, but each test starts with this defaulted to false. - */ - private boolean myStartupCpuProfilingEnabled = false; - - /** * Whether the new pipeline is used or the old one for devices / processes / sessions. */ private boolean myEventsPipelineEnabled = false; @@ -273,11 +268,6 @@ public final class FakeIdeProfilerServices implements IdeProfilerServices { } @Override - public boolean isStartupCpuProfilingEnabled() { - return myStartupCpuProfilingEnabled; - } - - @Override public boolean isUnifiedPipelineEnabled() { return myEventsPipelineEnabled; } @@ -445,10 +435,6 @@ public final class FakeIdeProfilerServices implements IdeProfilerServices { myIsJankDetectionUiEnabled = enabled; } - public void enableStartupCpuProfiling(boolean enabled) { - myStartupCpuProfilingEnabled = enabled; - } - public void enableEventsPipeline(boolean enabled) { myEventsPipelineEnabled = enabled; } diff --git a/profilers/testSrc/com/android/tools/profilers/StudioProfilersTest.java b/profilers/testSrc/com/android/tools/profilers/StudioProfilersTest.java index 86bbfefe26a..a174865a9a2 100644 --- a/profilers/testSrc/com/android/tools/profilers/StudioProfilersTest.java +++ b/profilers/testSrc/com/android/tools/profilers/StudioProfilersTest.java @@ -646,8 +646,6 @@ public final class StudioProfilersTest { @Test public void shouldOpenCpuProfileStageIfStartupProfilingStarted() { - myIdeProfilerServices.enableStartupCpuProfiling(true); - Common.Device device = createDevice(AndroidVersion.VersionCodes.BASE, "FakeDevice", Common.Device.State.ONLINE); Common.Process process = createProcess(device.getDeviceId(), 20, "FakeProcess", Common.Process.State.ALIVE); |