diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 2fa3b9e..cd5dcab 100644
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -243,6 +243,7 @@ function simpletest_script_parse_args() {
     'color' => FALSE,
     'verbose' => FALSE,
     'keep-results' => FALSE,
+    'profile' => FALSE,
     'test_names' => array(),
     'repeat' => 1,
     'die-on-fail' => FALSE,
@@ -665,7 +666,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']);
   if (!empty($args['sqlite'])) {
     $command .= ' --sqlite ' . escapeshellarg($args['sqlite']);
