Add CPU cost measurement, tune parameters, decrease default maxjobs
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 8f07256..637aff8 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -603,7 +603,7 @@
         help='A positive integer or "inf". If "inf", all tests will run in an '
              'infinite loop. Especially useful in combination with "-f"')
 argp.add_argument('-r', '--regex', default='.*', type=str)
-argp.add_argument('-j', '--jobs', default=2 * multiprocessing.cpu_count(), type=int)
+argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int)
 argp.add_argument('-s', '--slowdown', default=1.0, type=float)
 argp.add_argument('-f', '--forever',
                   default=False,
@@ -650,6 +650,8 @@
                   action='store_const',
                   const=True,
                   help='Perform all the build steps but dont run any tests.')
+argp.add_argument('--measure_cpu_costs', default=False, action='store_const', const=True,
+                  help='Measure the cpu costs of tests')
 argp.add_argument('--update_submodules', default=[], nargs='*',
                   help='Update some submodules before building. If any are updated, also run generate_projects. ' +
                        'Submodules are specified as SUBMODULE_NAME:BRANCH; if BRANCH is omitted, master is assumed.')
@@ -658,6 +660,8 @@
         help='Generates a JUnit-compatible XML report')
 args = argp.parse_args()
 
+jobset.measure_cpu_costs = args.measure_cpu_costs
+
 if args.use_docker:
   if not args.travis:
     print 'Seen --use_docker flag, will run tests under docker.'