Changeset 260610 in webkit


Ignore:
Timestamp:
Apr 23, 2020 5:12:00 PM (4 years ago)
Author:
ysuzuki@apple.com
Message:

Support --report-execution-time to report execution time for each JSC stress test
https://bugs.webkit.org/show_bug.cgi?id=210938

Reviewed by Saam Barati.

We can run run-javascriptcore-tests with --report-execution-time option to report execution time for each JSC stress test,
to figure out which test is taking a long time. It appends execution-time to the verbose log. To see it stderr, --verbose is also
required.

$ run-javascriptcore-tests .... --verbose --report-execution-time

  • Scripts/run-javascriptcore-tests:

(runJSCStressTests):

  • Scripts/run-jsc-stress-tests:
  • Scripts/webkitruby/jsc-stress-test-writer-default.rb:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r260609 r260610  
     12020-04-23  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        Support `--report-execution-time` to report execution time for each JSC stress test
     4        https://bugs.webkit.org/show_bug.cgi?id=210938
     5
     6        Reviewed by Saam Barati.
     7
     8        We can run `run-javascriptcore-tests` with `--report-execution-time` option to report execution time for each JSC stress test,
     9        to figure out which test is taking a long time. It appends execution-time to the verbose log. To see it stderr, --verbose is also
     10        required.
     11
     12        $ run-javascriptcore-tests .... --verbose --report-execution-time
     13
     14        * Scripts/run-javascriptcore-tests:
     15        (runJSCStressTests):
     16        * Scripts/run-jsc-stress-tests:
     17        * Scripts/webkitruby/jsc-stress-test-writer-default.rb:
     18
    1192020-04-23  Wenson Hsieh  <wenson_hsieh@apple.com>
    220
  • trunk/Tools/Scripts/run-javascriptcore-tests

    r260130 r260610  
    6363my $testWriter;
    6464my $memoryLimited;
     65my $reportExecutionTime;
    6566
    6667my $report;
     
    273274                                Skip tests tagged with //\@skip if \$memoryLimited
    274275
     276  --report-execution-time       Print execution time for each stress test.
     277
    275278  --filter                      Only run tests whose name matches the given regular expression.
    276279  --env-vars                    Pass a list of environment variables to set before running tests.
     
    335338    'test-writer=s' => \$testWriter,
    336339    'memory-limited' => \$memoryLimited,
     340    'report-execution-time' => \$reportExecutionTime,
    337341    'filter=s' => \$filter,
    338342    'help' => \$showHelp,
     
    788792    }
    789793
     794    if ($reportExecutionTime) {
     795        push(@jscStressDriverCmd, "--report-execution-time");
     796    }
     797
    790798    if ($filter) {
    791799        push(@jscStressDriverCmd, "--filter");
  • trunk/Tools/Scripts/run-jsc-stress-tests

    r260349 r260610  
    122122$buildType = "release"
    123123$forceCollectContinuously = false
     124$reportExecutionTime = false
    124125
    125126def usage
     
    151152    puts "--remote                    Specify a remote host on which to run tests from command line argument."
    152153    puts "--remote-config-file        Specify a remote host on which to run tests from JSON file."
     154    puts "--report-execution-time     Print execution time for each test."
    153155    puts "--child-processes    (-c)   Specify the number of child processes."
    154156    puts "--filter                    Only run tests whose name matches the given regular expression."
     
    186188               ['--remote', GetoptLong::REQUIRED_ARGUMENT],
    187189               ['--remote-config-file', GetoptLong::REQUIRED_ARGUMENT],
     190               ['--report-execution-time', GetoptLong::NO_ARGUMENT],
    188191               ['--model', GetoptLong::REQUIRED_ARGUMENT],
    189192               ['--child-processes', '-c', GetoptLong::REQUIRED_ARGUMENT],
     
    237240    when '--remote-config-file'
    238241        $remoteConfigFile = arg
     242    when '--report-execution-time'
     243        $reportExecutionTime = true
    239244    when '--child-processes'
    240245        $numChildProcesses = arg.to_i
  • trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-default.rb

    r255365 r260610  
    264264   
    265265    def successCommand
    266         if $progressMeter or $verbosity >= 2
    267             "rm -f #{failFile} ; echo PASS: #{Shellwords.shellescape(@name)}"
     266        executionTimeMessage = ""
     267        if $reportExecutionTime
     268            executionTimeMessage = " $(($SECONDS - $START_TIME))s"
     269        end
     270        if $progressMeter or $reportExecutionTime or $verbosity >= 2
     271            "rm -f #{failFile} ; echo PASS: #{Shellwords.shellescape(@name)}#{executionTimeMessage}"
    268272        else
    269273            "rm -f #{failFile}"
     
    278282        File.open(filename, "w") {
    279283            | outp |
     284            if $reportExecutionTime
     285                outp.puts "START_TIME=$SECONDS"
     286            end
    280287            outp.puts "echo Running #{Shellwords.shellescape(@name)}"
    281288            cmd  = "(" + shellCommand + " || (echo $? > #{failFile})) 2>&1 "
Note: See TracChangeset for help on using the changeset viewer.