• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# Flood memory bus by pounding on the CPU...
4
5# Copyright (C) 2003-2006 IBM
6#
7# This program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as
9# published by the Free Software Foundation; either version 2 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15# General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20# 02111-1307, USA.
21
22
23# Try to find memxfer5b on the system
24MEMXFER5B=`ls $POUNDER_SRCDIR/memxfer5b/memxfer5b`
25if [ -z "$MEMXFER5B" ]; then
26	echo "Cannot find memxfer5b; did you run Install?"
27	exit -1
28fi
29
30# How much RAM do we have?
31RAM=`cat /proc/meminfo | grep MemTotal | awk -F " " '{print $2}'`
32MEM_BLOB=`expr $RAM \* 32` # convert to KB and then divide by 32
33
34# Run this test ten times.
35TIMES=0
36while [ $TIMES -lt 2 ]; do
37	"$MEMXFER5B" -s -p $MEM_BLOB 10 0 1 2 3 4 5 6
38	TIMES=$((TIMES + 1))
39done
40
41# No output; if system stays up, we pass.
42exit 0
43