Vogar: Remove Android Sampling Profiler support am: c6428e1bcd
am: c08e669fe3

Change-Id: I6ef750da01a4b16796a7f05521fb8b7b37ec70d3
diff --git a/src/vogar/JavaVm.java b/src/vogar/JavaVm.java
index 7565e6c..b23adec 100644
--- a/src/vogar/JavaVm.java
+++ b/src/vogar/JavaVm.java
@@ -44,16 +44,6 @@
         List<String> vmCommand = new ArrayList<String>();
         Iterables.addAll(vmCommand, run.invokeWith());
         vmCommand.add(run.javaPath(run.vmCommand));
-        if (run.profile) {
-            vmCommand.add("-agentlib:hprof="
-                          + "cpu=samples,"
-                          + "format=" + (run.profileBinary ? 'b' : 'a') + ","
-                          + "file=" + run.profileFile + ","
-                          + "depth=" + run.profileDepth + ","
-                          + "interval=" + run.profileInterval + ","
-                          + "thread=y,"
-                          + "verbose=n");
-        }
         return new VmCommandBuilder(run.log)
                 .userDir(workingDirectory)
                 .vmCommand(vmCommand);
diff --git a/src/vogar/RetrievedFilesFilter.java b/src/vogar/RetrievedFilesFilter.java
index 705666f..69dde0d 100644
--- a/src/vogar/RetrievedFilesFilter.java
+++ b/src/vogar/RetrievedFilesFilter.java
@@ -23,22 +23,13 @@
  * Selects files to be kept from a test run.
  */
 public final class RetrievedFilesFilter implements FileFilter {
-    private final boolean profile;
-    private final File profileFile;
-
-    public RetrievedFilesFilter(boolean profile, File profileFile) {
-        this.profile = profile;
-        this.profileFile = profileFile;
-    }
-
     @Override public boolean accept(File file) {
         if (file.getName().equals("prefs.xml")) {
             return false;
         }
         if (file.getName().endsWith(".xml")
                 || file.getName().equals("caliper-results")
-                || file.getName().endsWith(".json")
-                || (profile && file.getName().equals(profileFile.getName()))) {
+                || file.getName().endsWith(".json")) {
             return true;
         }
         return false;
diff --git a/src/vogar/Run.java b/src/vogar/Run.java
index ef20a47..c816657 100644
--- a/src/vogar/Run.java
+++ b/src/vogar/Run.java
@@ -71,12 +71,6 @@
     public final Rm rm;
     public final int firstMonitorPort;
     public final int timeoutSeconds;
-    public final boolean profile;
-    public final boolean profileBinary;
-    public final int profileDepth;
-    public final int profileInterval;
-    public final boolean profileThreadGroup;
-    public final File profileFile;
     public final File javaHome;
     public final Integer debugPort;
     public final Language language;
@@ -156,12 +150,6 @@
         this.useBootClasspath = vogar.useBootClasspath;
         this.targetArgs = vogar.targetArgs;
         this.xmlReportsDirectory = vogar.xmlReportsDirectory;
-        this.profile = vogar.profile;
-        this.profileBinary = vogar.profileBinary;
-        this.profileFile = vogar.profileFile;
-        this.profileDepth = vogar.profileDepth;
-        this.profileInterval = vogar.profileInterval;
-        this.profileThreadGroup = vogar.profileThreadGroup;
         this.recordResults = vogar.recordResults;
         this.resultsDir = vogar.resultsDir == null
                 ? new File(vogar.vogarDir, "results")
@@ -191,7 +179,7 @@
             classFileIndex.createIndex();
         }
 
-        this.retrievedFiles = new RetrievedFilesFilter(profile, profileFile);
+        this.retrievedFiles = new RetrievedFilesFilter();
         this.reportPrinter = new XmlReportPrinter(xmlReportsDirectory, expectationStore, date);
         this.jarSuggestions = new JarSuggestions();
         this.outcomeStore = new OutcomeStore(log, mkdir, rm, resultsDir, recordResults,
diff --git a/src/vogar/TestProperties.java b/src/vogar/TestProperties.java
index 5fca1d9..00058aa 100644
--- a/src/vogar/TestProperties.java
+++ b/src/vogar/TestProperties.java
@@ -44,31 +44,6 @@
     public static final String TIMEOUT = "timeout";
 
     /**
-     * Profile enabled?
-     */
-    public static final String PROFILE = "profile";
-
-    /**
-     * Profile frame depth
-     */
-    public static final String PROFILE_DEPTH = "profileDepth";
-
-    /**
-     * Profile interval in milliseconds
-     */
-    public static final String PROFILE_INTERVAL = "profileInterval";
-
-    /**
-     * Profile output file
-     */
-    public static final String PROFILE_FILE = "profileFile";
-
-    /**
-     * Profile thread group instead of just single thread (where supported)
-     */
-    public static final String PROFILE_THREAD_GROUP = "profileThreadGroup";
-
-    /**
      * The type of runner to use.
      */
     public static final String RUNNER_TYPE = "runnerType";
diff --git a/src/vogar/Vogar.java b/src/vogar/Vogar.java
index eafce5b..b765a90 100644
--- a/src/vogar/Vogar.java
+++ b/src/vogar/Vogar.java
@@ -188,24 +188,6 @@
     @Option(names = { "--open-bugs-command" })
     String openBugsCommand;
 
-    @Option(names = { "--profile" })
-    boolean profile = false;
-
-    @Option(names = { "--profile-binary" })
-    boolean profileBinary = false;
-
-    @Option(names = { "--profile-file" })
-    File profileFile;
-
-    @Option(names = { "--profile-depth" })
-    int profileDepth = 4;
-
-    @Option(names = { "--profile-interval" })
-    int profileInterval = 10;
-
-    @Option(names = { "--profile-thread-group" })
-    boolean profileThreadGroup = false;
-
     @Option(names = { "--test-only" })
     boolean testOnly = false;
 
@@ -272,23 +254,6 @@
         System.out.println("      assumes --runner-type="
                 + RunnerType.CALIPER.name().toLowerCase());
         System.out.println();
-        System.out.println("  --profile: run with a profiler to produce an hprof file.");
-        System.out.println();
-        System.out.println("  --profile-binary: produce a binary hprof file instead of the default ASCII.");
-        System.out.println();
-        System.out.println("  --profile-file <filename>: filename for hprof profile data.");
-        System.out.println("      Default is java.hprof.txt in ASCII mode and java.hprof in binary mode.");
-        System.out.println();
-        System.out.println("  --profile-depth <count>: number of frames in profile stack traces.");
-        System.out.println("      Default is: " + profileDepth);
-        System.out.println();
-        System.out.println("  --profile-interval <milliseconds>: interval between profile samples.");
-        System.out.println("      Default is: " + profileInterval);
-        System.out.println();
-        System.out.println("  --profile-thread-group: profile thread group instead of single thread in dalvikvms");
-        System.out.println("      Note --mode jvm only supports full VM profiling.");
-        System.out.println("      Default is: " + profileThreadGroup);
-        System.out.println();
         System.out.println("  --invoke-with: provide a command to invoke the VM with. Examples:");
         System.out.println("      --mode host --invoke-with \"valgrind --leak-check=full\"");
         System.out.println("      --mode device --invoke-with \"strace -f -o/sdcard/strace.txt\"");
@@ -511,10 +476,6 @@
             firstMonitorPort = modeId.isLocal() ? 8788 : 8787;
         }
 
-        if (profileFile == null) {
-            profileFile = new File(profileBinary ? "java.hprof" : "java.hprof.txt");
-        }
-
         // separate the actions and the target args
         int index = 0;
         for (; index < actionsAndTargetArgs.size(); index++) {
diff --git a/src/vogar/android/AndroidProfiler.java b/src/vogar/android/AndroidProfiler.java
deleted file mode 100644
index 2269a1a..0000000
--- a/src/vogar/android/AndroidProfiler.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package vogar.android;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import vogar.target.Profiler;
-
-public class AndroidProfiler extends Profiler {
-    // SamplingProfiler methods
-    private final Method newArrayThreadSet;
-    private final Method newThreadGroupThreadSet;
-    private final Constructor newThreadSet;
-    private final Method start;
-    private final Method stop;
-    private final Method shutdown;
-    private final Method write;
-    private final Method getHprofData;
-
-    public AndroidProfiler() throws Exception {
-        String packageName = "dalvik.system.profiler";
-        Class<?> ThreadSet = Class.forName(packageName + ".SamplingProfiler$ThreadSet");
-        Class<?> SamplingProfiler = Class.forName(packageName + ".SamplingProfiler");
-        Class<?> HprofData = Class.forName(packageName + ".HprofData");
-        Class<?> Writer = Class.forName(packageName + ".AsciiHprofWriter");
-        newArrayThreadSet = SamplingProfiler.getMethod("newArrayThreadSet", Thread[].class);
-        newThreadGroupThreadSet = SamplingProfiler.getMethod("newThreadGroupThreadSet",
-                                                             ThreadGroup.class);
-        newThreadSet = SamplingProfiler.getConstructor(Integer.TYPE, ThreadSet);
-        start = SamplingProfiler.getMethod("start", Integer.TYPE);
-        stop = SamplingProfiler.getMethod("stop");
-        shutdown = SamplingProfiler.getMethod("shutdown");
-        getHprofData = SamplingProfiler.getMethod("getHprofData");
-        write = Writer.getMethod("write", HprofData, OutputStream.class);
-    }
-
-    private Thread[] thread = new Thread[1];
-    private Object profiler;
-    private int interval;
-
-    @Override public void setup(boolean profileThreadGroup, int depth, int interval) {
-        try {
-            Thread t = Thread.currentThread();
-            thread[0] = t;
-            Object threadSet;
-            if (profileThreadGroup) {
-                threadSet = newThreadGroupThreadSet.invoke(null, t.getThreadGroup());
-            } else {
-                threadSet = newArrayThreadSet.invoke(null, (Object)thread);
-            }
-            this.profiler = newThreadSet.newInstance(depth, threadSet);
-            this.interval = interval;
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-
-    }
-
-    @Override public void start() {
-        try {
-            // If using the array thread set, switch to the current
-            // thread.  Sometimes for timeout reasons Runners use
-            // separate threads for test execution.
-            this.thread[0] = Thread.currentThread();
-            start.invoke(profiler, interval);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    @Override public void stop() {
-        try {
-            stop.invoke(profiler);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    @Override public void shutdown(File file) {
-        try {
-            shutdown.invoke(profiler);
-
-            FileOutputStream out = new FileOutputStream(file);
-            write.invoke(null, getHprofData.invoke(profiler), out);
-            out.close();
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-}
diff --git a/src/vogar/target/CaliperRunnerFactory.java b/src/vogar/target/CaliperRunnerFactory.java
index 6f2f24c..f1dab97 100644
--- a/src/vogar/target/CaliperRunnerFactory.java
+++ b/src/vogar/target/CaliperRunnerFactory.java
@@ -51,10 +51,9 @@
     @Override @Nullable
     public TargetRunner newRunner(TargetMonitor monitor, String qualification,
             Class<?> klass, AtomicReference<String> skipPastReference,
-            TestEnvironment testEnvironment, int timeoutSeconds, boolean profile,
-            String[] args) {
+            TestEnvironment testEnvironment, int timeoutSeconds, String[] args) {
         if (benchmarkClassChecker != null && benchmarkClassChecker.isBenchmark(klass)) {
-            return new CaliperTargetRunner(monitor, profile, klass, args);
+            return new CaliperTargetRunner(monitor, klass, args);
         } else {
             return null;
         }
diff --git a/src/vogar/target/CaliperTargetRunner.java b/src/vogar/target/CaliperTargetRunner.java
index d031abc..676bf76 100644
--- a/src/vogar/target/CaliperTargetRunner.java
+++ b/src/vogar/target/CaliperTargetRunner.java
@@ -28,19 +28,16 @@
 public final class CaliperTargetRunner implements TargetRunner {
 
     private final TargetMonitor monitor;
-    private final boolean profile;
     private final Class<?> testClass;
     private final String[] args;
 
-    public CaliperTargetRunner(TargetMonitor monitor, boolean profile, Class<?> testClass,
-                               String[] args) {
+    public CaliperTargetRunner(TargetMonitor monitor, Class<?> testClass, String[] args) {
         this.monitor = monitor;
-        this.profile = profile;
         this.testClass = testClass;
         this.args = args;
     }
 
-    public boolean run(Profiler profiler) {
+    public boolean run() {
         monitor.outcomeStarted(testClass.getName());
         ImmutableList.Builder<String> builder = ImmutableList.<String>builder()
             .add(testClass.getName())
@@ -57,31 +54,16 @@
             builder.add("-Cvm.args=-Xmx256M -Xms256M");
         }
 
-        if (profile) {
-            // The --dry-run option causes Caliper to run the benchmark once, rather than hundreds
-            // if not thousands of times, and to run it in the main Caliper process rather than in
-            // a separate Worker process, one for each benchmark run. That is needed when profiling
-            // as otherwise the profiler just profiles the main Caliper process rather than the
-            // benchmark.
-            builder.add("--dry-run");
-        }
         ImmutableList<String> argList = builder.build();
         String[] arguments = argList.toArray(new String[argList.size()]);
         Result result = Result.EXEC_FAILED;
         try {
-            if (profiler != null) {
-                profiler.start();
-            }
             PrintWriter stdout = new PrintWriter(System.out);
             PrintWriter stderr = new PrintWriter(System.err);
             CaliperMain.exitlessMain(arguments, stdout, stderr);
             result = Result.SUCCESS;
         } catch (Exception ex) {
             ex.printStackTrace();
-        } finally {
-            if (profiler != null) {
-                profiler.stop();
-            }
         }
         monitor.outcomeFinished(result);
         return true;
diff --git a/src/vogar/target/MainRunnerFactory.java b/src/vogar/target/MainRunnerFactory.java
index 6412b26..cca463f 100644
--- a/src/vogar/target/MainRunnerFactory.java
+++ b/src/vogar/target/MainRunnerFactory.java
@@ -28,8 +28,7 @@
     @Override @Nullable
     public TargetRunner newRunner(TargetMonitor monitor, String qualification,
             Class<?> klass, AtomicReference<String> skipPastReference,
-            TestEnvironment testEnvironment, int timeoutSeconds, boolean profile,
-            String[] args) {
+            TestEnvironment testEnvironment, int timeoutSeconds, String[] args) {
         if (new ClassAnalyzer(klass).hasMethod(true, void.class, "main", String[].class)) {
             return new MainTargetRunner(monitor, klass, args);
         } else {
diff --git a/src/vogar/target/MainTargetRunner.java b/src/vogar/target/MainTargetRunner.java
index 8217abe..d7c6747 100644
--- a/src/vogar/target/MainTargetRunner.java
+++ b/src/vogar/target/MainTargetRunner.java
@@ -42,21 +42,15 @@
         }
     }
 
-    public boolean run(Profiler profiler) {
+    public boolean run() {
         monitor.outcomeStarted(mainClass.getName() + "#main");
         try {
-            if (profiler != null) {
-                profiler.start();
-            }
             main.invoke(null, new Object[] { args });
             monitor.outcomeFinished(Result.SUCCESS);
         } catch (Throwable ex) {
             ex.printStackTrace();
             monitor.outcomeFinished(Result.EXEC_FAILED);
         } finally {
-            if (profiler != null) {
-                profiler.stop();
-            }
         }
         return true;
     }
diff --git a/src/vogar/target/Profiler.java b/src/vogar/target/Profiler.java
deleted file mode 100644
index 401cf39..0000000
--- a/src/vogar/target/Profiler.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package vogar.target;
-
-import java.io.File;
-import vogar.android.AndroidProfiler;
-
-public abstract class Profiler {
-    public static Profiler getInstance() throws Exception {
-        return new AndroidProfiler();
-    }
-    public abstract void setup(boolean profileThreadGroup, int depth, int interval);
-    public abstract void start();
-    public abstract void stop();
-    public abstract void shutdown(File file);
-}
diff --git a/src/vogar/target/ProfilerRunListener.java b/src/vogar/target/ProfilerRunListener.java
deleted file mode 100644
index 902320f..0000000
--- a/src/vogar/target/ProfilerRunListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package vogar.target;
-
-import org.junit.runner.Description;
-import org.junit.runner.notification.RunListener;
-import vogar.target.Profiler;
-
-/**
- * A {@link RunListener} that will notify the {@link Profiler} before and after the start of every
- * test.
- */
-public class ProfilerRunListener extends RunListener {
-    private final Profiler profiler;
-
-    public ProfilerRunListener(Profiler profiler) {
-        this.profiler = profiler;
-    }
-
-    @Override
-    public void testStarted(Description description) throws Exception {
-        profiler.start();
-    }
-
-    @Override
-    public void testFinished(Description description) throws Exception {
-        profiler.stop();
-    }
-}
diff --git a/src/vogar/target/RunnerFactory.java b/src/vogar/target/RunnerFactory.java
index 86cbe34..993acd4 100644
--- a/src/vogar/target/RunnerFactory.java
+++ b/src/vogar/target/RunnerFactory.java
@@ -32,5 +32,5 @@
     @Nullable
     TargetRunner newRunner(TargetMonitor monitor, String qualification, Class<?> klass,
             AtomicReference<String> skipPastReference, TestEnvironment testEnvironment,
-            int timeoutSeconds, boolean profile, String[] args);
+            int timeoutSeconds, String[] args);
 }
diff --git a/src/vogar/target/TargetRunner.java b/src/vogar/target/TargetRunner.java
index e92211f..6d4285b 100644
--- a/src/vogar/target/TargetRunner.java
+++ b/src/vogar/target/TargetRunner.java
@@ -27,5 +27,5 @@
      *     process should kill this process and attempt to resume after the last
      *     known outcome.
      */
-    boolean run(Profiler profiler);
+    boolean run();
 }
diff --git a/src/vogar/target/TestRunner.java b/src/vogar/target/TestRunner.java
index d31f014..58137fd 100644
--- a/src/vogar/target/TestRunner.java
+++ b/src/vogar/target/TestRunner.java
@@ -51,11 +51,6 @@
     private final int timeoutSeconds;
 
     private final RunnerFactory runnerFactory;
-    private final boolean profile;
-    private final int profileDepth;
-    private final int profileInterval;
-    private final File profileFile;
-    private final boolean profileThreadGroup;
     private final String[] args;
     private boolean useSocketMonitor;
 
@@ -65,13 +60,6 @@
 
         int monitorPort = Integer.parseInt(properties.getProperty(TestProperties.MONITOR_PORT));
         String skipPast = null;
-        boolean profile = Boolean.parseBoolean(properties.getProperty(TestProperties.PROFILE));
-        int profileDepth = Integer.parseInt(properties.getProperty(TestProperties.PROFILE_DEPTH));
-        int profileInterval
-                = Integer.parseInt(properties.getProperty(TestProperties.PROFILE_INTERVAL));
-        File profileFile = new File(properties.getProperty(TestProperties.PROFILE_FILE));
-        boolean profileThreadGroup
-                = Boolean.parseBoolean(properties.getProperty(TestProperties.PROFILE_THREAD_GROUP));
 
         for (Iterator<String> i = argsList.iterator(); i.hasNext(); ) {
             String arg = i.next();
@@ -104,11 +92,6 @@
 
         this.monitorPort = monitorPort;
         this.skipPastReference = new AtomicReference<>(skipPast);
-        this.profile = profile;
-        this.profileDepth = profileDepth;
-        this.profileInterval = profileInterval;
-        this.profileFile = profileFile;
-        this.profileThreadGroup = profileThreadGroup;
         this.args = argsList.toArray(new String[argsList.size()]);
     }
 
@@ -211,22 +194,11 @@
         }
 
 
-        Profiler profiler = null;
-        if (profile) {
-            try {
-                profiler = Profiler.getInstance();
-            } catch (Exception e) {
-                System.out.println("Profiling is disabled: " + e);
-            }
-        }
-        if (profiler != null) {
-            profiler.setup(profileThreadGroup, profileDepth, profileInterval);
-        }
         for (Class<?> klass : classes) {
             TargetRunner targetRunner;
             try {
                 targetRunner = runnerFactory.newRunner(monitor, qualification, klass,
-                        skipPastReference, testEnvironment, timeoutSeconds, profile, args);
+                        skipPastReference, testEnvironment, timeoutSeconds, args);
             } catch (RuntimeException e) {
                 monitor.outcomeStarted(klass.getName());
                 e.printStackTrace();
@@ -242,14 +214,11 @@
                 continue;
             }
 
-            boolean completedNormally = targetRunner.run(profiler);
+            boolean completedNormally = targetRunner.run();
             if (!completedNormally) {
                 return; // let the caller start another process
             }
         }
-        if (profiler != null) {
-            profiler.shutdown(profileFile);
-        }
 
         monitor.completedNormally(true);
     }
@@ -274,10 +243,10 @@
         @Override @Nullable
         public TargetRunner newRunner(TargetMonitor monitor, String qualification,
                 Class<?> klass, AtomicReference<String> skipPastReference,
-                TestEnvironment testEnvironment, int timeoutSeconds, boolean profile, String[] args) {
+                TestEnvironment testEnvironment, int timeoutSeconds, String[] args) {
             for (RunnerFactory runnerFactory : runnerFactories) {
                 TargetRunner targetRunner = runnerFactory.newRunner(monitor, qualification, klass,
-                        skipPastReference, testEnvironment, timeoutSeconds, profile, args);
+                        skipPastReference, testEnvironment, timeoutSeconds, args);
                 if (targetRunner != null) {
                     return targetRunner;
                 }
diff --git a/src/vogar/target/junit/JUnitRunnerFactory.java b/src/vogar/target/junit/JUnitRunnerFactory.java
index 2f40ad0..2719356 100644
--- a/src/vogar/target/junit/JUnitRunnerFactory.java
+++ b/src/vogar/target/junit/JUnitRunnerFactory.java
@@ -30,8 +30,7 @@
     @Override @Nullable
     public TargetRunner newRunner(TargetMonitor monitor, String qualification,
             Class<?> klass, AtomicReference<String> skipPastReference,
-            TestEnvironment testEnvironment, int timeoutSeconds, boolean profile,
-            String[] args) {
+            TestEnvironment testEnvironment, int timeoutSeconds, String[] args) {
         if (supports(klass)) {
             return new JUnitTargetRunner(monitor, skipPastReference, testEnvironment,
                     timeoutSeconds, klass, qualification, args);
diff --git a/src/vogar/target/junit/JUnitTargetRunner.java b/src/vogar/target/junit/JUnitTargetRunner.java
index 861df9e..3fd2232 100644
--- a/src/vogar/target/junit/JUnitTargetRunner.java
+++ b/src/vogar/target/junit/JUnitTargetRunner.java
@@ -23,8 +23,6 @@
 import org.junit.runner.manipulation.Sorter;
 import org.junit.runners.model.RunnerBuilder;
 import vogar.monitor.TargetMonitor;
-import vogar.target.Profiler;
-import vogar.target.ProfilerRunListener;
 import vogar.target.SkipPastFilter;
 import vogar.target.TargetMonitorRunListener;
 import vogar.target.TargetRunner;
@@ -59,7 +57,7 @@
         runnerParams = new RunnerParams(qualification, args, timeoutRule);
     }
 
-    public boolean run(Profiler profiler) {
+    public boolean run() {
         // Use JUnit infrastructure to run the tests.
         RunnerBuilder builder = new VogarRunnerBuilder(runnerParams);
         Runner runner = builder.safeRunnerForClass(testClass);
@@ -87,11 +85,6 @@
             // The TargetMonitorRunListener sends the result of the tests back to the main Vogar
             // process.
             core.addListener(new TargetMonitorRunListener(monitor));
-            if (profiler != null) {
-                // The ProfilerRunListener starts the Profiler before the test starts and
-                // stops it afterwards.
-                core.addListener(new ProfilerRunListener(profiler));
-            }
             core.run(runner);
         } catch (VmIsUnstableException e) {
             // If a test reports that the VM is unstable then inform the caller so that the
diff --git a/src/vogar/tasks/BuildActionTask.java b/src/vogar/tasks/BuildActionTask.java
index b6fe45d..9d2de06 100644
--- a/src/vogar/tasks/BuildActionTask.java
+++ b/src/vogar/tasks/BuildActionTask.java
@@ -187,13 +187,6 @@
         properties.setProperty(TestProperties.TEST_CLASS_OR_PACKAGE, action.getTargetClass());
         properties.setProperty(TestProperties.MONITOR_PORT, Integer.toString(run.firstMonitorPort));
         properties.setProperty(TestProperties.TIMEOUT, Integer.toString(run.timeoutSeconds));
-        properties.setProperty(TestProperties.PROFILE, Boolean.toString(run.profile));
-        properties.setProperty(TestProperties.PROFILE_DEPTH, Integer.toString(run.profileDepth));
-        properties.setProperty(TestProperties.PROFILE_INTERVAL,
-                Integer.toString(run.profileInterval));
-        properties.setProperty(TestProperties.PROFILE_FILE, run.profileFile.getName());
-        properties.setProperty(TestProperties.PROFILE_THREAD_GROUP,
-                Boolean.toString(run.profileThreadGroup));
         properties.setProperty(TestProperties.RUNNER_TYPE, run.runnerType.toString());
     }
 }
diff --git a/test/vogar/target/AbstractTestRunnerTest.java b/test/vogar/target/AbstractTestRunnerTest.java
index 76466d9..b9cb8e5 100644
--- a/test/vogar/target/AbstractTestRunnerTest.java
+++ b/test/vogar/target/AbstractTestRunnerTest.java
@@ -125,20 +125,6 @@
             return this;
         }
 
-        public ExpectedResults ensureProfilingWasRequested() {
-            return addFilter(new Function<String, String>() {
-                @Override
-                public String apply(String input) {
-                    // Make sure that profiling is requested (even though it's not supported).
-                    assertTrue("Profiling was not requested",
-                            input.startsWith("Profiling is disabled: "));
-
-                    input = input.replaceAll("^Profiling is disabled:[^\n]+\\n", "");
-                    return input;
-                }
-            });
-        }
-
         public ExpectedResults forTestClass(Class<?> testClass) {
             this.testClassName = testClass.getName();
             return this;
diff --git a/test/vogar/target/TestRunnerProperties.java b/test/vogar/target/TestRunnerProperties.java
index 0d836ed..c63ed14 100644
--- a/test/vogar/target/TestRunnerProperties.java
+++ b/test/vogar/target/TestRunnerProperties.java
@@ -30,16 +30,6 @@
 
     int monitorPort() default 9999;
 
-    boolean profile() default false;
-
-    int profileDepth() default 4;
-
-    String profileFile() default "default-profile-file";
-
-    int profileInterval() default 10;
-
-    boolean profileThreadGroup() default false;
-
     Class testClass() default Default.class;
 
     String testClassOrPackage() default "";
diff --git a/test/vogar/target/TestRunnerRule.java b/test/vogar/target/TestRunnerRule.java
index 145bee1..e30473a 100644
--- a/test/vogar/target/TestRunnerRule.java
+++ b/test/vogar/target/TestRunnerRule.java
@@ -42,12 +42,6 @@
         if (testRunnerProperties != null) {
             properties = new Properties();
             setProperty(TestProperties.MONITOR_PORT, testRunnerProperties.monitorPort());
-            setProperty(TestProperties.PROFILE, testRunnerProperties.profile());
-            setProperty(TestProperties.PROFILE_DEPTH, testRunnerProperties.profileDepth());
-            setProperty(TestProperties.PROFILE_FILE, testRunnerProperties.profileFile());
-            setProperty(TestProperties.PROFILE_INTERVAL, testRunnerProperties.profileInterval());
-            setProperty(TestProperties.PROFILE_THREAD_GROUP,
-                    testRunnerProperties.profileThreadGroup());
             String testClassOrPackage = treatEmptyAsNull(testRunnerProperties.testClassOrPackage());
             if (testClassOrPackage == null) {
                 Class<?> testClass = testRunnerProperties.testClass();
diff --git a/test/vogar/target/caliper/TestRunnerCaliperTest.java b/test/vogar/target/caliper/TestRunnerCaliperTest.java
index d076e0a..c131456 100644
--- a/test/vogar/target/caliper/TestRunnerCaliperTest.java
+++ b/test/vogar/target/caliper/TestRunnerCaliperTest.java
@@ -67,36 +67,6 @@
                 .completedNormally();
     }
 
-    /**
-     * Ensure that requesting profiling doesn't send an invalid option to Caliper.
-     *
-     * <p>Cannot check that profiling works because it will only work on Android and these tests
-     * do not run on android yet.
-     */
-    @TestRunnerProperties(
-            testClass = CaliperBenchmark.class,
-            profile = true,
-            runnerType = RunnerType.CALIPER)
-    @Test
-    public void testRunner_CaliperBenchmark_Profile() throws Exception {
-        TestRunner runner = testRunnerRule.createTestRunner("-i", "runtime");
-        runner.run();
-
-        expectedResults()
-                .ensureProfilingWasRequested()
-                .success(null, ""
-                        + "Experiment selection: \n"
-                        + "  Benchmark Methods:   [timeMethod]\n"
-                        + "  Instruments:   [runtime]\n"
-                        + "  User parameters:   {}\n"
-                        + "  Virtual machines:  [default]\n"
-                        + "  Selection type:    Full cartesian product\n"
-                        + "\n"
-                        + "This selection yields 1 experiments.\n"
-                        + "1\n")
-                .completedNormally();
-    }
-
     public static class CaliperBenchmark {
 
         @Benchmark
diff --git a/test/vogar/target/junit3/TestRunnerJUnit3Test.java b/test/vogar/target/junit3/TestRunnerJUnit3Test.java
index e260e7f..2faed60 100644
--- a/test/vogar/target/junit3/TestRunnerJUnit3Test.java
+++ b/test/vogar/target/junit3/TestRunnerJUnit3Test.java
@@ -70,20 +70,6 @@
                 .completedNormally();
     }
 
-    @TestRunnerProperties(testClass = SimpleTest2.class, profile = true)
-    @Test
-    public void testRunner_SimpleTest2_Profile() throws Exception {
-        TestRunner runner = testRunnerRule.createTestRunner();
-        runner.run();
-
-        expectedResults()
-                .ensureProfilingWasRequested()
-                .success("testSimple1")
-                .success("testSimple2")
-                .success("testSimple3")
-                .completedNormally();
-    }
-
     @TestRunnerProperties(testClass = SimpleTest2.class)
     @Test
     public void testRunner_SkipPast() throws Exception {
diff --git a/test/vogar/target/junit4/TestRunnerJUnit4Test.java b/test/vogar/target/junit4/TestRunnerJUnit4Test.java
index d3cb87a..85e3b27 100644
--- a/test/vogar/target/junit4/TestRunnerJUnit4Test.java
+++ b/test/vogar/target/junit4/TestRunnerJUnit4Test.java
@@ -56,20 +56,6 @@
                 .completedNormally();
     }
 
-    @TestRunnerProperties(testClass = SimpleTest2.class, profile = true)
-    @Test
-    public void testRunner_SimpleTest2_Profile() throws Exception {
-        TestRunner runner = testRunnerRule.createTestRunner();
-        runner.run();
-
-        expectedResults()
-                .ensureProfilingWasRequested()
-                .success("Simple3")
-                .success("simple1")
-                .success("simple2")
-                .completedNormally();
-    }
-
     @TestRunnerProperties(testClass = SimpleTest2.class)
     @Test
     public void testRunner_SkipPast() throws Exception {