Bug 584826: add a windows build of VTune instrumented avmshell (r+cpeyer)
authorBrent Baker <brbaker@adobe.com>
Mon, 16 Aug 2010 08:59:29 -0400
changeset 5043 20701f93ea0a4bafac597a882bff2be07c06e407
parent 5042 91cc3ad80f823ff0a647e240053b51cf730720d2
child 5044 4a1fce3e968f31ff6b41fe505858a30b494b3ea1
push id2701
push userbrbaker@adobe.com
push dateMon, 16 Aug 2010 13:00:07 +0000
bugs584826
Bug 584826: add a windows build of VTune instrumented avmshell (r+cpeyer) - fix a selftest so that the release-debugger shell is not required to be deinfed (r+brbaker)
build/buildbot/master/tamarinredux.py
build/buildbot/slaves/windows-deep/scripts/build-vtune.sh
build/buildbot/slaves/windows-deep/scripts/environment.sh
test/cmdline/testShellSystem.py
--- a/build/buildbot/master/tamarinredux.py
+++ b/build/buildbot/master/tamarinredux.py
@@ -1792,16 +1792,24 @@ class tamarinredux:
     windows_deep_factory.addStep(test_selftest(name="Debug", shellname="avmshell_d"))
     windows_deep_factory.addStep(test_selftest(name="ReleaseDebugger", shellname="avmshell_s"))
     windows_deep_factory.addStep(test_selftest(name="DebugDebugger", shellname="avmshell_sd"))
     windows_deep_factory.addStep(compile_generic(name="ReleaseDebugger-air", shellname="avmshell_air", args="--enable-shell --enable-override-global-new --enable-use-system-malloc --enable-debugger", upload="true"))
     windows_deep_factory.addStep(test_generic(name="ReleaseDebugger-air", shellname="avmshell_air", vmargs="", config="", scriptargs=""))
     windows_deep_factory.addStep(test_generic(name="Release-Dgreedy", shellname="avmshell", vmargs="-Dgreedy", config="", scriptargs="--timeout=180 --random"))
     windows_deep_factory.addStep(test_generic(name="DebugDebugger_VerifyAll", shellname="avmshell_sd", vmargs="", config="", scriptargs="--verify --timeout=300 --random"))
     windows_deep_factory.addStep(test_generic(name="DebugDebugger_VerifyOnly", shellname="avmshell_sd", vmargs="", config="", scriptargs="--verifyonly --timeout=300 --random"))
+    windows_deep_factory.addStep(BuildShellCommand(
+                command=['./build-vtune.sh', WithProperties('%s','revision')],
+                env={'branch': WithProperties('%s','branch')},
+                description='starting VTune build...',
+                descriptionDone='finished VTune build.',
+                name="VTune",
+                workdir="../repo/build/buildbot/slaves/scripts")
+    )
     windows_deep_factory.addStep(util_process_clean)
     windows_deep_factory.addStep(util_clean_buildsdir)
 
     windows_deep_builder = {
                 'name': "windows-deep",
                 'slavename': "windows-deep",
                 'factory': windows_deep_factory,
                 'builddir': './windows-deep',
new file mode 100755
--- /dev/null
+++ b/build/buildbot/slaves/windows-deep/scripts/build-vtune.sh
@@ -0,0 +1,113 @@
+#!/bin/bash
+#  ***** BEGIN LICENSE BLOCK *****
+#  Version: MPL 1.1/GPL 2.0/LGPL 2.1
+# 
+#  The contents of this file are subject to the Mozilla Public License Version
+#  1.1 (the "License"); you may not use this file except in compliance with
+#  the License. You may obtain a copy of the License at
+#  http://www.mozilla.org/MPL/
+# 
+#  Software distributed under the License is distributed on an "AS IS" basis,
+#  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+#  for the specific language governing rights and limitations under the
+#  License.
+# 
+#  The Original Code is [Open Source Virtual Machine.].
+# 
+#  The Initial Developer of the Original Code is
+#  Adobe System Incorporated.
+#  Portions created by the Initial Developer are Copyright (C) 2010
+#  the Initial Developer. All Rights Reserved.
+# 
+#  Contributor(s):
+#    Adobe AS3 Team
+# 
+#  Alternatively, the contents of this file may be used under the terms of
+#  either the GNU General Public License Version 2 or later (the "GPL"), or
+#  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+#  in which case the provisions of the GPL or the LGPL are applicable instead
+#  of those above. If you wish to allow use of your version of this file only
+#  under the terms of either the GPL or the LGPL, and not to allow others to
+#  use your version of this file under the terms of the MPL, indicate your
+#  decision by deleting the provisions above and replace them with the notice
+#  and other provisions required by the GPL or the LGPL. If you do not delete
+#  the provisions above, a recipient may use your version of this file under
+#  the terms of any one of the MPL, the GPL or the LGPL.
+# 
+#  ***** END LICENSE BLOCK ****
+(set -o igncr) 2>/dev/null && set -o igncr; # comment is needed
+
+
+##
+# Bring in the environment variables
+##
+. ./environment.sh
+
+
+##
+# Calculate the change number and change id
+##
+. ../all/util-calculate-change.sh $1
+
+
+
+##
+# Update the version string
+##
+. ../all/util-update-version.sh
+
+
+##
+# Make sure that there are no left over directories from previous compile
+##
+cd $basedir/platform/win32
+test -d obj_9 && {
+    echo Remove directory $basedir/platform/win32/obj_9
+    rm -rf obj_9
+}
+
+
+test -f build.out && rm -f build.out
+
+echo "devenv avmplus2008.sln /clean VTune"
+devenv avmplus2008.sln /clean VTune
+
+echo "devenv avmplus2008.sln /rebuild VTune /out build.out"
+devenv avmplus2008.sln /rebuild VTune /out build.out
+res=$?
+cat build.out
+rm build.out
+test "$res" = "0" || {
+    echo "build failed return value $res"
+}
+test -f obj_9/shell/VTune/avmplus.exe || {
+    echo "avmshell is missing, build failed"
+    cd $basedir/core
+    hg revert avmplusVersion.h
+    exit 1
+}
+
+
+mkdir -p $buildsdir/${change}-${changeid}/$platform
+chmod 777 $buildsdir/${change}-${changeid}/$platform
+cp obj_9/shell/VTune/avmplus.exe $buildsdir/${change}-${changeid}/$platform/$shell_release_vtune
+chmod 777 $buildsdir/${change}-${changeid}/$platform/$shell_release_vtune
+
+echo ""
+echo "*******************************************************************************"
+echo "shell compiled with these features:"
+features=`$buildsdir/${change}-${changeid}/$platform/$shell_release_vtune -Dversion | grep AVM | sed 's/\;/ /g' | sed 's/features //g'`
+for i in ${features}; do
+    echo feature: $i
+done
+echo ""
+echo "*******************************************************************************"
+
+
+cd $basedir/core
+hg revert avmplusVersion.h
+
+echo "build succeeded"
+rm -rf $basedir/platform/win32/obj_9
+
+exit 0
--- a/build/buildbot/slaves/windows-deep/scripts/environment.sh
+++ b/build/buildbot/slaves/windows-deep/scripts/environment.sh
@@ -49,29 +49,31 @@ export shell_extension=.exe
 
 export platform=windows
 
 export shell_release_cov=avmshell_cov.exe
 export shell_release_debugger_cov=avmshell_s_cov.exe
 export shell_debug_cov=avmshell_d_cov.exe
 export shell_debug_debugger_cov=avmshell_sd_cov.exe
 
+export shell_release_vtune=avmshell_vtune.exe
+
 export build_shell_release_cov=avmshell_cov
 export build_shell_release_debugger_cov=avmshell_s_cov
 export build_shell_debug_cov=avmshell_d_cov
 export build_shell_debug_debugger_cov=avmshell_sd_cov
 
 bullseyedir="/c/Progra~1/BullseyeCoverage/bin"
 
 
 VS_HOME_PATH="/c/Program Files/Microsoft Visual Studio 9.0"
 VS_HOME="c:\Program Files\Microsoft Visual Studio 9.0"
 
 # ${PREPATH} if it exists will be the first thing in the path,
 # this is needed for code coverage.
 export PATH="${PREPATH}:$VS_HOME_PATH/Common7/IDE:$VS_HOME_PATH/VC/bin:$VS_HOME_PATH\Common7\Tools:$VS_HOME_PATH/VC/VCPackages:$PATH"
-export INCLUDE="c:\Program Files\Microsoft SDKs\Windows\v6.0\Include;$VS_HOME\VC\atlmfc\include;$VS_HOME\VC\include;"
-export LIB="c:\Program Files\Microsoft SDKs\Windows\v6.0\Lib;$VS_HOME\VC\atlmfc\lib;$VS_HOME\VC\lib"
-export LIBPATH="c:\Program Files\Microsoft SDKs\Windows\v6.0\Lib;$VS_HOME\VC\atlmfc\lib;$VS_HOME\VC\lib;"
+export INCLUDE="c:\Program Files\Microsoft SDKs\Windows\v6.0\Include;$VS_HOME\VC\atlmfc\include;$VS_HOME\VC\include;C:\Program Files\Intel\VTune\Analyzer\Include"
+export LIB="c:\Program Files\Microsoft SDKs\Windows\v6.0\Lib;$VS_HOME\VC\atlmfc\lib;$VS_HOME\VC\lib;C:\Program Files\Intel\VTune\Analyzer\Lib;"
+export LIBPATH="c:\Program Files\Microsoft SDKs\Windows\v6.0\Lib;$VS_HOME\VC\atlmfc\lib;$VS_HOME\VC\lib;C:\Program Files\Intel\VTune\Analyzer\Lib;"
 
 ## Used by make in the build scripts
 export make_opt="-j3"
 
--- a/test/cmdline/testShellSystem.py
+++ b/test/cmdline/testShellSystem.py
@@ -54,17 +54,18 @@ def run():
     #      avmshell commandline args with values can't assume the values are present
     #      Prior to fix the shell would segfault on these tests
     r.run_test('memlimit no value','%s -memlimit' %r.avm,expectedout=['Unrecognized option -memlimit'],expectedcode=1)
     r.run_test('load no value','%s -load' %r.avm,expectedout=['Unrecognized option -load'],expectedcode=1)
     r.run_test('gcwork no value','%s -gcwork' %r.avm,expectedout=['Unrecognized option -gcwork'],expectedcode=1)
     r.run_test('cache_bindings no value','%s -cache_bindings' %r.avm,expectedout=['Unrecognized option -cache_bindings'],expectedcode=1)
     r.run_test('cache_metadata no value','%s -cache_metadata' %r.avm,expectedout=['Unrecognized option -cache_metadata'],expectedcode=1)
     r.run_test('cache_methods no value','%s -cache_methods' %r.avm,expectedout=['Unrecognized option -cache_methods'],expectedcode=1)
-    r.run_test('Dastrace no value','%s -Dastrace' %r.avmrd,expectedout=['Unrecognized option -Dastrace'],expectedcode=1)
+    if r.avmrd!=None:
+        r.run_test('Dastrace no value','%s -Dastrace' %r.avmrd,expectedout=['Unrecognized option -Dastrace'],expectedcode=1)
     
 
 if __name__ == '__main__':
     r=RunTestLib()
     r.compile("testdata/exec.as")
     r.compile("testdata/exit.as")
     r.compile("testdata/readline.as")
     r.compile("testdata/trace1.as")