diff --git a/tools/tinderbox/build-seamonkey-util.pl b/tools/tinderbox/build-seamonkey-util.pl index b600f26cc35..cd67f13a640 100644 --- a/tools/tinderbox/build-seamonkey-util.pl +++ b/tools/tinderbox/build-seamonkey-util.pl @@ -24,7 +24,7 @@ use Config; # for $Config{sig_name} and $Config{sig_num} use File::Find (); use File::Copy; -$::UtilsVersion = '$Revision: 1.372 $ '; +$::UtilsVersion = '$Revision: 1.373 $ '; package TinderUtils; @@ -2492,6 +2492,9 @@ sub run_all_tests { run_system_cmd("sync; sleep 5", 35); my @urlargs = (-chrome,"file:$build_dir/mozilla/xpfe/test/winopen.xul"); + if ($Settings::TestWithJprof) { + @urlargs = (-chrome,"javascript:try{JProfStartProfiling();}catch(e){};window.location='file:$build_dir/mozilla/xpfe/test/winopen.xul'"); + } if($test_result eq 'success') { if ($talkback_installed) { setTestnameForTalkbackReport($talkback_ini_path,$test_name); @@ -2684,6 +2687,11 @@ sub AliveTestReturnToken { } } + if ($Settings::TestWithJprof) { + print_log "Running jprof for $test_name..\n"; + run_shell_command("cd $binary_dir && ./jprof firefox-bin jprof-log > ../$test_name-jprof.html"); + } + return $rv; } @@ -2758,6 +2766,9 @@ sub LayoutPerformanceTest { my $layout_time_details; my $binary_log = "$build_dir/$test_name.log"; my $url = "http://$Settings::pageload_server/page-loader/loader.pl?delay=1000&nocache=0&maxcyc=4&timeout=$Settings::LayoutPerformanceTestPageTimeout&auto=1"; + if ($Settings::TestWithJprof) { + $url = "javascript:try{JProfStartProfiling();}catch(e){};window.location='http://$Settings::pageload_server/page-loader/loader.pl?delay=1000&nocache=0&maxcyc=4&timeout=$Settings::LayoutPerformanceTestPageTimeout&auto=1'"; + } # Settle OS. run_system_cmd("sync; sleep 5", 35); @@ -2834,6 +2845,9 @@ sub LayoutPerformanceLocalTest { my $layout_time_details; my $binary_log = "$build_dir/$test_name.log"; my $url = "http://localhost/pageload/cycler.html"; + if ($Settings::TestWithJprof) { + $url = "javascript:try{JProfStartProfiling();}catch(e){};window.location='http://localhost/pageload/cycler.html'"; + } # Settle OS. run_system_cmd("sync; sleep 5", 35); @@ -2890,6 +2904,9 @@ sub DHTMLPerformanceTest { my $dhtml_time_details; my $binary_log = "$build_dir/$test_name.log"; my $url = "http://www.mozilla.org/performance/test-cases/dhtml/runTests.html"; + if ($Settings::TestWithJprof) { + $url = "javascript:try{JProfStartProfiling();}catch(e){};window.location='http://www.mozilla.org/performance/test-cases/dhtml/runTests.html'"; + } # Settle OS. run_system_cmd("sync; sleep 5", 35); diff --git a/tools/tinderbox/post-mozilla-rel.pl b/tools/tinderbox/post-mozilla-rel.pl index d489a5caa76..a1b09e05e19 100755 --- a/tools/tinderbox/post-mozilla-rel.pl +++ b/tools/tinderbox/post-mozilla-rel.pl @@ -337,6 +337,10 @@ sub packit { $push_raw_xpis = $Settings::push_raw_xpis; } + if ($Settings::TestWithJprof) { + TinderUtils::run_shell_command("cp $package_location/../*-jprof.html $stagedir/"); + } + if (TinderUtils::is_windows() || TinderUtils::is_os2()) { if ($Settings::stub_installer) { TinderUtils::run_shell_command("cp $package_location/stub/*.exe $stagedir/"); diff --git a/tools/tinderbox/tinder-defaults.pl b/tools/tinderbox/tinder-defaults.pl index ad421610ab0..977d31d9df0 100644 --- a/tools/tinderbox/tinder-defaults.pl +++ b/tools/tinderbox/tinder-defaults.pl @@ -82,6 +82,7 @@ $RunUnitTests = 0; # TUnit # ("network","dom","toolkit","security/manager"); $CompareLocalesAviary = 0; # Should the compare-locales commands use the # aviary directory structure? +$TestWithJprof = 0; # Use jprof profiler during tests $TestsPhoneHome = 0; # Should test report back to server? $GraphNameOverride = ''; # Override name built from ::hostname() and $BuildTag