diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 230afd6..2d4b6d5 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -212,6 +212,7 @@ function simpletest_script_parse_args() {
     'color' => FALSE,
     'verbose' => FALSE,
     'keep-results' => FALSE,
+    'profile' => FALSE,
     'test_names' => array(),
     'repeat' => 1,
     'die-on-fail' => FALSE,
@@ -532,7 +533,11 @@ function simpletest_script_run_one_test($test_id, $test_class) {
 function simpletest_script_command($test_id, $test_class) {
   global $args, $php;
 
-  $command = escapeshellarg($php) . ' ' . escapeshellarg('./core/scripts/' . $args['script']);
+  $command = escapeshellarg($php);
+  if ($args['profile']) {
+    $command .= ' -d xdebug.profiler_enable=On';
+  }
+  $command .= ' ' . escapeshellarg('./core/scripts/' . $args['script']);
   $command .= ' --url ' . escapeshellarg($args['url']);
   $command .= ' --php ' . escapeshellarg($php);
   $command .= " --test-id $test_id";
