Skip to content

Commit

Permalink
Move client files under client
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin J. Bligh committed Nov 23, 2006
0 parents commit 83bbf84
Show file tree
Hide file tree
Showing 106 changed files with 5,315 additions and 0 deletions.
1,514 changes: 1,514 additions & 0 deletions aiostress/aio-stress.c

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions aiostress/aiostress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This requires aio headers to build.
# Should work automagically out of deps now.

# NOTE - this should also have the ability to mount a filesystem,
# run the tests, unmount it, then fsck the filesystem

import test
from autotest_utils import *

class aiostress(test.test):
version = 2

def initialize(self):
self.job.setup_dep(['libaio'])
ldflags = '-L ' + self.autodir + '/deps/libaio/lib'
cflags = '-I ' + self.autodir + '/deps/libaio/include'
self.gcc_flags = ldflags + ' ' + cflags


# ftp://ftp.suse.com/pub/people/mason/utils/aio-stress.c
def setup(self, tarball = None):
print self.srcdir, self.bindir, self.tmpdir
os.mkdir(self.srcdir)
os.chdir(self.srcdir)
system('cp ' + self.bindir+'/aio-stress.c .')
os.chdir(self.srcdir)
self.gcc_flags += ' -Wall -lpthread -laio'
system('gcc ' + self.gcc_flags + ' aio-stress.c -o aio-stress')


def execute(self, args = ''):
os.chdir(self.tmpdir)
libs = self.autodir+'/deps/libaio/lib/'
ld_path = prepend_path(libs, environ('LD_LIBRARY_PATH'))
var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
cmd = self.srcdir + '/aio-stress ' + args + ' poo'
system(var_ld_path + ' ' + cmd)

# Do a profiling run if necessary
profilers = self.job.profilers
if profilers.present():
profilers.start(self)
system(var_ld_path + ' ' + cmd)
profilers.stop(self)
profilers.report(self)
1 change: 1 addition & 0 deletions aiostress/control
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
job.runtest(None, 'aiostress')
Binary file added bonnie/bonnie++-1.03a.tgz
Binary file not shown.
29 changes: 29 additions & 0 deletions bonnie/bonnie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import test, os_dep
from autotest_utils import *

class bonnie(test.test):
version = 1

# http://www.coker.com.au/bonnie++/bonnie++-1.03a.tgz
def setup(self, tarball = 'bonnie++-1.03a.tgz'):
tarball = unmap_url(self.bindir, tarball, self.tmpdir)
extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)

os_dep.command('g++')
system('./configure')
system('make')

def execute(self, iterations = 1, extra_args = '', user = 'root'):
args = '-d ' + self.tmpdir + ' -u ' + user + ' ' + extra_args

for i in range(1, iterations+1):
system(self.srcdir + '/bonnie++ ' + args)

# Do a profiling run if necessary
profilers = self.job.profilers
if profilers.present():
profilers.start(self)
system(self.srcdir + '/bonnie++ ' + args)
profilers.stop(self)
profilers.report(self)
1 change: 1 addition & 0 deletions bonnie/control
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
job.runtest(None, 'bonnie')
1 change: 1 addition & 0 deletions cpu_hotplug/control
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
job.runtest(None, 'cpu_hotplug')
44 changes: 44 additions & 0 deletions cpu_hotplug/cpu_hotplug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import test, time
from autotest_utils import *

class cpu_hotplug(test.test):
version = 1

# http://developer.osdl.org/dev/hotplug/tests/lhcs_regression-1.4.tgz
def setup(self, tarball = 'lhcs_regression-1.4.tgz'):
tarball = unmap_url(self.bindir, tarball, self.tmpdir)
extract_tarball_to_dir(tarball, self.srcdir)

def execute(self):
# Check if the kernel supports cpu hotplug
config = running_config()
if config and not grep('CONFIG_HOTPLUG_CPU=y', config):
raise TestError('Kernel does not support cpu hotplug')

# Check cpu nums, if equals 1, quit.
if count_cpus() == 1:
print 'Just only single cpu online, quiting...'
sys.exit()

# Have a simple and quick check first, FIX me please.
system('dmesg -c > /dev/null')
for cpu in cpu_online_map():
if os.path.isfile('/sys/devices/system/cpu/cpu%s/online' % cpu):
system('echo 0 > /sys/devices/system/cpu/cpu%s/online' % cpu, 1)
system('dmesg -c')
time.sleep(3)
system('echo 1 > /sys/devices/system/cpu/cpu%s/online' % cpu, 1)
system('dmesg -c')
time.sleep(3)

# Begin this cpu hotplug test big guru.
os.chdir(self.srcdir)
system('./runtests.sh')

# Do a profiling run if necessary
profilers = self.job.profilers
if profilers.present():
profilers.start(self)
system('./runtests.sh')
profilers.stop(self)
profilers.report(self)
Binary file added cpu_hotplug/lhcs_regression-1.4.tgz
Binary file not shown.
32 changes: 32 additions & 0 deletions cyclictest/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cyclictest -t 5 -p 80 -n -q -l 10

runs a test with 5 threads, stops after 10 loops and outputs:

T: 0 ( 2215) P:80 I: 1000 C: 10 Min: 31 Act: 33 Avg: 33 Max: 43
T: 1 ( 2216) P:79 I: 1500 C: 10 Min: 22 Act: 22 Avg: 36 Max: 61
T: 2 ( 2217) P:78 I: 2000 C: 10 Min: 27 Act: 33 Avg: 36 Max: 50
T: 3 ( 2218) P:77 I: 2500 C: 10 Min: 23 Act: 37 Avg: 38 Max: 59
T: 4 ( 2219) P:76 I: 3000 C: 10 Min: 26 Act: 48 Avg: 36 Max: 48

All numbers in micro seconds. You get the minimium, maximum and average latency for each thread.

I use this for automated regression testing.

The -v option outputs:

0: 0: 0
0: 1: 45
0: 2: 41
0: 3: 31
0: 4: 31
0: 5: 34
1: 0: 0
1: 1: 29
1: 2: 33
1: 3: 33
...
where the first column is the thread, the second column is the loop
counter and the third is the latency value for this step. You can use
this for your own statistics or for latency distribution plots.

tglx
1 change: 1 addition & 0 deletions cyclictest/control
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
job.runtest(None, 'cyclictest')
Binary file added cyclictest/cyclictest-v0.11.tar.bz2
Binary file not shown.
17 changes: 17 additions & 0 deletions cyclictest/cyclictest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import test
from autotest_utils import *

class cyclictest(test.test):
version = 1

# http://tglx.de/projects/misc/cyclictest/cyclictest-v0.11.tar.bz2

def setup(self, tarball = 'cyclictest-v0.11.tar.bz2'):
tarball = unmap_url(self.bindir, tarball, self.tmpdir)
extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)

system('make')

def execute(self, args = '-t 10 -l 100000'):
system(self.srcdir + '/cyclictest ' + args)
172 changes: 172 additions & 0 deletions cyclictest/help
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
Without parameters cyclictest creates one thread with a 1ms interval timer.

cyclictest -h provides help text for the various options
-b USEC --breaktrace=USEC send break trace command when latency > USEC
-c CLOCK --clock=CLOCK select clock

0 = CLOCK_MONOTONIC (default)
1 = CLOCK_REALTIME
-d DIST --distance=DIST distance of thread intervals in us default=500
-i INTV --interval=INTV base interval of thread in us default=1000
-l LOOPS --loops=LOOPS number of loops: default=0(endless)
-n --nanosleep use clock_nanosleep
-p PRIO --prio=PRIO priority of highest prio thread
-q --quiet print only a summary on exit
-r --relative use relative timer instead of absolute
-s --system use sys_nanosleep and sys_setitimer
-t NUM --threads=NUM number of threads: default=1
-v --verbose output values on stdout for statistics
format: n:c:v n=tasknum c=count v=value in us

-b is a debugging option to control the latency tracer in the realtime
preemption patch.

It is useful to track down unexpected large latencies on a system. This option
does only work with

* CONFIG_PREEMPT_RT=y
* CONFIG_LATENCY_TIMING=y
* CONFIG_LATENCY_TRACE=y

kernel configuration options enabled. The USEC parameter to the -b option
defines a maximum latency value, which is compared against the actual latencies
of the test. Once the measured latency is higher than the given maximum,
the kernel tracer and cyclictest is stopped. The trace can be read from
/proc/latency_trace

mybox# cat /proc/latency_trace >trace.log

Please be aware that the tracer adds significant overhead to the kernel,
so the latencies will be much higher than on a kernel with latency tracing
disabled.

-c CLOCK selects the clock, which is used

* 0 selects CLOCK_MONOTONIC, which is the monotonic increasing system time.
This is the default selection
* 1 selects CLOCK_REALTIME, which is the time of day time.

CLOCK_REALTIME can be set by settimeofday, while CLOCK_MONOTONIC can not be
modified by the user.

This option has no influence when the -s option is given.

-d DIST set the distance of thread intervals in microseconds (default is 500us)

When cylictest is called with the -t option and more than one thread is created,
then this distance value is added to the interval of the threads.

Interval(thread N) = Interval(thread N-1) + DIST

-i INTV set the base interval of the thread(s) in microseconds (default is 1000us)

This sets the interval of the first thread. See also -d.

-l LOOPS set the number of loops (default = 0(endless))

This option is useful for automated tests with a given number of test cycles.
Cyclictest is stopped once the number of timer intervals has been reached.

-n use clock_nanosleep instead of posix interval timers

Setting this option runs the tests with clock_nanosleep instead of posix
interval timers.

-p PRIO set the priority of the first thread

The given priority is set to the first test thread. Each further thread gets
a lower priority:

Priority(Thread N) = Priority(Thread N-1)

-q run the tests quiet and print only a summary on exit

Useful for automated tests, where only the summary output needs to be captured

-r use relative timers instead of absolute

The default behaviour of the tests is to use absolute timers. This option is
there for completeness and should not be used for reproducible tests.

-s use sys_nanosleep and sys_setitimer instead of posix timers

Note, that -s can only be used with one thread because itimers are per process
and not per thread. -s in combination with -n uses the nanosleep syscall
and is not restricted to one thread

-t NUM set the number of test threads (default is 1)

Create NUM test threads. See -d, -i and -p for further information.

-v output values on stdout for statistics

This option is used to gather statistical information about the latency
distribution. The output is sent to stdout. The output format is

n:c:v

where n=task number c=count v=latency value in us

Use this option in combination with -l


tglx's reference machine

All tests have been run on a Pentium III 400MHz based PC.

The tables show comparisons of vanilla Linux 2.6.16, Linux-2.6.16-hrt5
and Linux-2.6.16-rt12. The tests for intervals less than the jiffy resolution
have not been run on vanilla Linux 2.6.16. The test thread runs in all cases
with SCHED_FIFO and priority 80. All numbers are in microseconds.

* Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 microseconds,. 10000 loops, no load.

Kernel min max avg
2.6.16 24 4043 1989
2.6.16-hrt5 12 94 20
2.6.16-rt12 6 40 10

* Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 10000 loops, 100% load.

Kernel min max avg
2.6.16 55 4280 2198
2.6.16-hrt5 11 458 55
2.6.16-rt12 6 67 29

* Test case: POSIX interval timer, Interval 10000 micro seconds,. 10000 loops, no load.

Kernel min max avg
2.6.16 21 4073 2098
2.6.16-hrt5 22 120 35
2.6.16-rt12 20 60 31

* Test case: POSIX interval timer, Interval 10000 micro seconds,. 10000 loops, 100% load.

Kernel min max avg
2.6.16 82 4271 2089
2.6.16-hrt5 31 458 53
2.6.16-rt12 21 70 35

* Test case: clock_nanosleep(TIME_ABSTIME), Interval 500 micro seconds,. 100000 loops, no load.

Kernel min max avg
2.6.16-hrt5 5 108 24
2.6.16-rt12 5 48 7

* Test case: clock_nanosleep(TIME_ABSTIME), Interval 500 micro seconds,. 100000 loops, 100% load.

Kernel min max avg
2.6.16-hrt5 9 684 56
2.6.16-rt12 10 60 22

* Test case: POSIX interval timer, Interval 500 micro seconds,. 100000 loops, no load.

Kernel min max avg
2.6.16-hrt5 8 119 22
2.6.16-rt12 12 78 16

* Test case: POSIX interval timer, Interval 500 micro seconds,. 100000 loops, 100% load.

Kernel min max avg
2.6.16-hrt5 16 489 58
2.6.16-rt12 12 95 29
1 change: 1 addition & 0 deletions dbench/control
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
job.runtest(None, 'dbench')
Binary file added dbench/dbench-3.04.tar.gz
Binary file not shown.
28 changes: 28 additions & 0 deletions dbench/dbench.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import test
from autotest_utils import *

class dbench(test.test):
version = 1

# http://samba.org/ftp/tridge/dbench/dbench-3.04.tar.gz
def setup(self, tarball = 'dbench-3.04.tar.gz'):
tarball = unmap_url(self.bindir, tarball, self.tmpdir)
extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)

system('./configure')
system('make')

def execute(self, iterations = 1, nprocs = count_cpus(), args = ''):
for i in range(1, iterations+1):
args = args + ' -c '+self.srcdir+'/client.txt'
args += ' %s' % nprocs
system(self.srcdir + '/dbench ' + args)

# Do a profiling run if necessary
profilers = self.job.profilers
if profilers.present():
profilers.start(self)
system(self.srcdir + '/dbench ' + args)
profilers.stop(self)
profilers.report(self)
3 changes: 3 additions & 0 deletions dbt2/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
job.runtest('pgsql', 'dbt2', 'pgsql', '-w 1 -c 20 -d 1800 -s 100 -n -z "autotest pgsql"')
job.runtest('pgpool', 'dbt2', 'pgpool', '-w 1 -c 20 -d 1800 -s 100 -n -z "autotest pgpool"')
job.runtest('mysql', 'dbt2', 'mysql', '-w 1 -c 20 -d 1800 -s 100 -n -z "autotest mysql"')
Loading

0 comments on commit 83bbf84

Please sign in to comment.