summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorgabucino <gabucino@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-30 21:16:52 +0000
committergabucino <gabucino@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-30 21:16:52 +0000
commit26013a4273229ee9420bbc3c2eb88801e6c7c73f (patch)
treea05139d16322e31170be272e7a32aa481a7e58f5 /TOOLS
parent37e6450cfe4268a8edad41d959c951a4d733f7f8 (diff)
downloadmpv-26013a4273229ee9420bbc3c2eb88801e6c7c73f.tar.bz2
mpv-26013a4273229ee9420bbc3c2eb88801e6c7c73f.tar.xz
v0.9 of my compile+benchmark script, designed for my local boxes, shared on
NFS, etc.. Read README, and RTFS before using it. Oh, and feel free to reverse/del, but al3x wanted it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7178 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/benchmark-gab/README40
-rwxr-xr-xTOOLS/benchmark-gab/benchmark100
-rwxr-xr-xTOOLS/benchmark-gab/compile56
-rwxr-xr-xTOOLS/benchmark-gab/start24
-rwxr-xr-xTOOLS/benchmark-gab/variables17
5 files changed, 237 insertions, 0 deletions
diff --git a/TOOLS/benchmark-gab/README b/TOOLS/benchmark-gab/README
new file mode 100644
index 0000000000..bc6dfbe58e
--- /dev/null
+++ b/TOOLS/benchmark-gab/README
@@ -0,0 +1,40 @@
+===================================================
+MPlayer benchmark scripts v0.9
+By Gabucino 2002-08-30
+License: for exclusive usage with MPlayer (wonder;)
+ NO WARRANTY
+ By using this software you agree not to
+ blame the author or the MPlayer team
+ for any mischief, backdoor, rm -rf /
+ or else this script may or may not do.
+===================================================
+
+Preamble
+========
+
+ BEGINNERS MUST NOT TRY USING THESE SCRIPTS!!!
+
+Installation
+============
+ - READ AND _U N D E R S T A N D_ WHAT THE SCRIPTS DO!
+ - Copy the four shell scripts into an empty dir
+ - Copy main.tar.gz to the same place (CVS checkout, compressed)
+ - Copy ffmpeg.tar.gz to the same place (CVS checkout, compressed)
+ - Create samples/ dir
+ - Create samples to be used for benchmarking
+ - (OPTIONAL) Create SAMPLE_FILE_NAME.opts file, containing
+ standard MPlayer options - for usage with ONLY that file.
+ Like: samples/MPEG1 MPEG1 file
+ samples/MPEG1.opts "-vc mpeg12"
+ samples/MPEG1_ffmpeg12 same MPEG1 file as MPEG1
+ samples/MPEG1_ffmpeg12.opts "-vc ffmpeg12"
+ etc...
+ - 'touch xmga' if you have Matrox, and want to test mga_vid too
+ (RTFS for these "touch" features)
+ - if doing Xv and/or xmga tests, start an X server, and exec xhost +localhost
+ - Push ./start
+ - WAIT
+ - (recover from backup;)))
+ - See $BUILDDIR/log-2002-08-30 (today's date..) for the output.
+
+Fuck. (TODO?;)
diff --git a/TOOLS/benchmark-gab/benchmark b/TOOLS/benchmark-gab/benchmark
new file mode 100755
index 0000000000..966251e84b
--- /dev/null
+++ b/TOOLS/benchmark-gab/benchmark
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+. ./variables
+
+function benchsamples {
+for i in `ls samples/* | grep -v -e '\.opts'`; do
+ BENCHOPTS=`cat $i.opts 2> /dev/null`
+ wrtlog Caching file...
+ dd if=$i of=/dev/null bs=512k 2> /dev/null
+ wrtlog Video decoding: `basename $i`, size: `ls -Ll $i | awk '{print $5}'`
+ wrtlog Options for this run:
+ wrtlog "$DEFAULTOPTS"
+ wrtlog "Options for this file:"
+ wrtlog "$BENCHOPTS"
+ BENCH="`$BUILD/mplayer $DEFAULTOPTS $BENCHOPTS $i 2>&1 | grep BENCHMARKs`"
+ VC=`echo $BENCH | awk '{print $3}'`
+ SYS=`echo $BENCH | awk '{print $9}'`
+ wrtlog VC: $VC \(Sys: $SYS\)
+
+ BENCH="`$BUILD/mplayer $DEFAULTOPTS $BENCHOPTS $i 2>&1 | grep BENCHMARKs`"
+ VC=`echo $BENCH | awk '{print $3}'`
+ SYS=`echo $BENCH | awk '{print $9}'`
+ wrtlog VC: $VC \(Sys: $SYS\)
+
+ BENCH="`$BUILD/mplayer $DEFAULTOPTS $BENCHOPTS $i 2>&1 | grep BENCHMARKs`"
+ VC=`echo $BENCH | awk '{print $3}'`
+ SYS=`echo $BENCH | awk '{print $9}'`
+ wrtlog VC: $VC \(Sys: $SYS\)
+done
+}
+
+if [ ! -d samples ]; then
+ wrtlog Samples subdirectory not present, exiting...
+ exit 1
+fi
+
+wrtlog Starting benchmarks
+
+if [ ! -e no_codec ]; then
+ wrtlog Starting CODEC benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo null -vop disabled -autoq 0"
+ benchsamples
+fi
+
+export DISPLAY=:0
+export XAUTHORITY=$HOME/.Xauthority
+
+if [ ! -e no_xv ]; then
+ if [ ! -e no_xv_nodr ]; then
+ wrtlog Starting XVideo \(no DR\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xv -fs -nodr -slices -vop disabled -autoq 0"
+ benchsamples
+ fi
+
+ if [ ! -e no_xv_nodr_noslices ]; then
+ wrtlog Starting XVideo \(no DR\) \(no slices\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xv -fs -nodr -noslices -vop disabled -autoq 0"
+ benchsamples
+ fi
+
+ if [ ! -e no_xv_dr ]; then
+ wrtlog Starting XVideo \(DR\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xv -fs -dr -slices -vop disabled -autoq 0"
+ benchsamples
+ fi
+
+ if [ ! -e no_xv_dr_noslices ]; then
+ wrtlog Starting XVideo \(DR\) \(no slices\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xv -fs -dr -noslices -vop disabled -autoq 0"
+ benchsamples
+ fi
+fi
+
+if [ -e xmga ]; then
+ if [ ! -e xmga_nodr ]; then
+ wrtlog Starting XMGA \(no DR\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xmga -fs -dr -slices -vop disabled -autoq 0"
+ benchsamples
+ fi
+
+ if [ ! -e xmga_nodr_noslices ]; then
+ wrtlog Starting XMGA \(no DR\) \(no slices\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xmga -fs -dr -noslices -vop disabled -autoq 0"
+ benchsamples
+ fi
+
+ if [ ! -e xmga_dr ]; then
+ wrtlog Starting XMGA \(DR\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xmga -fs -dr -vop disabled -autoq 0"
+ benchsamples
+ fi
+
+ if [ ! -e xmga_dr ]; then
+ wrtlog Starting XMGA \(DR\) \(no slices\) benchmark runs, with 3 tries...
+ DEFAULTOPTS="-nosound -benchmark -vo xmga -fs -dr -noslices -vop disabled -autoq 0"
+ benchsamples
+ fi
+fi
+
+wrtlog Benchmarks ready
diff --git a/TOOLS/benchmark-gab/compile b/TOOLS/benchmark-gab/compile
new file mode 100755
index 0000000000..46e403d3ec
--- /dev/null
+++ b/TOOLS/benchmark-gab/compile
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+. ./variables
+
+wrtlog Starting compilation
+wrtlog Options: $COMPILEOPTIONS
+
+if [ ! -e main.tar.gz ]; then
+ wrtlog MPlayer source main.tar.gz not present, exiting...
+ exit 1
+fi
+
+if [ ! -e main.tar.gz ]; then
+ wrtlog libavcodec source ffmpeg.tar.gz not present, exiting...
+ exit 1
+fi
+
+if [ ! -d main ]; then
+ wrtlog Unpacking source...
+ tar xfzv main.tar.gz > /dev/null || (wrtlog Error; exit 1)
+ wrtlog Unpacking done
+ wrtlog Source total size: `du -hs main | awk '{print $1}'`
+else
+ wrtlog MPlayer source already there, not unpacking
+fi
+
+wrtlog Creating and entering separate build dir...
+rm -rf $BUILD
+mkdir $BUILD || (wrtlog Error; exit 1)
+cd $BUILD
+lndir ../main > /dev/null || (wrtlog Error; exit 1)
+wrtlog Separate build dir created
+
+wrtlog Unpacking libavcodec
+rm -rf libavcodec
+ln -s . ffmpeg || (wrtlog Error; exit 1)
+tar xfzv ../ffmpeg.tar.gz ffmpeg/libavcodec > /dev/null || (wrtlog Error; exit 1)
+rm -f ffmpeg
+wrtlog Unpacking libavcodec done
+wrtlog libavcodec total size: `du -hs libavcodec | awk '{print $1}'`
+
+wrtlog Executing configure...
+./configure $COMPILEOPTIONS > /dev/null || (wrtlog Error; exit 1)
+wrtlog Configure done
+
+wrtlog Executing main compile process...
+unset CFLAGS CPPFLAGS CXXFLAGS
+make > /dev/null 2> /dev/null || (wrtlog Error; exit 1)
+wrtlog Compile ready
+wrtlog Build dir size: `du -hs . | awk '{print $1}'`
+
+wrtlog Unstripped mplayer binary size: `ls -l mplayer | awk '{print $5}'`
+wrtlog Unstripped mencoder binary size: `ls -l mencoder | awk '{print $5}'`
+
+cd ..
+rm -rf main
diff --git a/TOOLS/benchmark-gab/start b/TOOLS/benchmark-gab/start
new file mode 100755
index 0000000000..9872077e67
--- /dev/null
+++ b/TOOLS/benchmark-gab/start
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+. ./variables
+
+rm -f $LOGFILE
+
+wrtlog Script version v0.9
+wrtlog CPU: $VENDOR $MODEL $MHZ
+wrtlog MEM: $MEMORY
+wrtlog VGA: $VGA
+
+if [ ! -e no_compile ]; then
+ ./compile
+else
+ wrtlog Skipping compilation
+fi
+
+if [ ! -e no_benchmark ]; then
+ ./benchmark
+else
+ wrtlog Skipping benchmark
+fi
+
+wrtlog Exiting.
diff --git a/TOOLS/benchmark-gab/variables b/TOOLS/benchmark-gab/variables
new file mode 100755
index 0000000000..482c003744
--- /dev/null
+++ b/TOOLS/benchmark-gab/variables
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+VENDOR="`cat /proc/cpuinfo | grep vendor_id | cut -c 13-`"
+MODEL="`cat /proc/cpuinfo | grep "model name" | cut -c 14-`"
+MHZ="`cat /proc/cpuinfo | grep MHz | cut -c 12-14` MHz"
+MEMORY="`cat /proc/meminfo | grep MemTotal | awk '{print $2}'` Kb"
+BUILD="`echo $VENDOR $MODEL $MHZ | tr [\ ] [_]`"
+VGA="`lspci | grep VGA | cut -c 36-`"
+
+export LOGFILE="`pwd`/$BUILD.logs/log-`date +\"%Y-%m-%d\"`"
+export COMPILEOPTIONS="--enable-runtime-cpudetection"
+
+mkdir $BUILD.logs 2> /dev/null
+
+function wrtlog {
+ echo "[ `date +\"%Y-%m-%d %T\"` ] $*" >> "$LOGFILE"
+}