3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
6 # T2 SDE: package/.../cpuburn/cpuburn.sh
7 # Copyright (C) 2004 - 2005 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 ROCK Linux Project
10 # More information can be found in the files COPYING and README.
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; version 2 of the License. A copy of the
15 # GNU General Public License can be found in the file COPYING.
16 # --- T2-COPYRIGHT-NOTE-END ---
18 errors
=`mktemp -t cpuburn.XXXX`
19 start
=`date "+%s"` ; command="" ; jobs=1
24 Usage
: $0 [ -j Jobs
] { -k6 |
-k7 |
-p5 |
-p6 |
-bx |
-mmx } [ -mem Mem
]
26 The
-mem option is only available
for the bx and mmx tests. Possible values
27 for Mem are
: 2kb
, 4kb
, 8kb
, 16kb
, 32kb
, 64kb
, 128kb
, 256kb
, 512kb
, 1MB
, 2MB
,
28 4MB
, 8MB
, 16MB
, 32MB and
64MB.
55 [ "$command" != burnBX
-a "$command" != burnMMX
] && help
59 command="$command A" ;;
61 command="$command B" ;;
63 command="$command C" ;;
65 command="$command D" ;;
67 command="$command E" ;;
69 command="$command F" ;;
71 command="$command G" ;;
73 command="$command H" ;;
75 command="$command I" ;;
77 command="$command J" ;;
79 command="$command K" ;;
81 command="$command L" ;;
83 command="$command M" ;;
85 command="$command N" ;;
87 command="$command O" ;;
89 command="$command P" ;;
102 [ "$command" = "" ] && help
103 desc
="${jobs}x ${command#burn}"
105 while [ $jobs -gt 0 ] ; do
110 date "+%T - $?" >> $errors
113 jobs=$
(( $jobs - 1 ))
116 trap "fuser -9 -k $errors > /dev/null ; rm $errors ; exit 0" INT TERM
117 echo "Using temp file $errors ..."
121 tm
=$
(( `date +%s` - $start ))
122 tm
=$
( printf '%02d:%02d:%02d:%02d' \
123 $
(( ($tm / (60*60*24)) )) \
124 $
(( ($tm / (60*60)) % 24 )) \
125 $
(( ($tm / 60) % 60 )) \
127 echo `date "+%T ($tm)"` " [$desc] " Load average
: \
128 `uptime | sed "s,.*average: ,,"`, "" `wc -l < $errors` Errors.