[go: up one dir, main page]

Menu

[8e227d]: / misc / diskbench.mk  Maximize  Restore  History

Download this file

106 lines (84 with data), 2.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
############################################################################
# misc/diskbench.mk
#
# Part of the STXXL. See http://stxxl.sourceforge.net
#
# Copyright (C) 2008 Andreas Beckmann <beckmann@cs.uni-frankfurt.de>
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
############################################################################
HOST ?= unknown
SIZE ?= 100 # GB
disk2file ?= /stxxl/sd$1/stxxl
DISKS_1by1 ?= a b c d
DISKS_a ?= a
DISKS_ab ?= a b
DISKS_abcd ?= a b c d
DISKS ?= abcd $(DISKS_1by1) ab
pipefail ?= set -o pipefail;
define do-some-disks
-$(pipefail) \
$(RECORD_LOAD_IOSTAT) \
./benchmark_disks.stxxl.bin 0 $(SIZE) $(foreach d,$(DISKS_$*),$(call disk2file,$d)) | tee $@
endef
$(HOST)-%.cr.log:
$(RM) $(foreach d,$(DISKS_$*),$(call disk2file,$d))
$(do-some-disks)
$(HOST)-%.wr.log:
$(do-some-disks)
all: cr wr
cr: $(foreach d,$(DISKS_1by1),$(HOST)-$d.cr.log)
wr: $(foreach d,$(DISKS),$(HOST)-$d.wr.log)
plot: $(HOST).gnuplot
gnuplot $<
# $1 = logfile, $2 = column
extract_average = $(if $(wildcard $1),$(shell tail -n 1 $1 | awk '{ print $$($2+1) }'),......)
# $1 = logfile, $2 = disk, $3 = column, $4 = label
define plotline
echo ' "$1" using ($$3/1024):($$$3) w l title "$2 $4 ($(call extract_average,$1,$3))", \' >> $@ ;
endef
# $1 = logfile, $2 = disk
define plotline-cr1
$(if $(wildcard $1),$(call plotline,$1,$2,7,cr1))
endef
define plotline-cr
$(call plotline,$1,$2,7,cr)
endef
define plotline-wr
$(call plotline,$1,$2,7,wr)
endef
define plotline-rd
$(call plotline,$1,$2,14,rd)
endef
# $1 = disk letter
disk2label ?= sd$1
disks2label ?= sd[$1]
DISKNAME ?= unknown disk
PLOTXMAX ?= 475
PLOTYMAX ?= 120
$(HOST).gnuplot: Makefile $(wildcard *.log)
$(RM) $@
echo 'set title "STXXL Disk Benchmark $(DISKNAME) @ $(HOST)"' >> $@
echo 'set xlabel "Disk offset [GB]"' >> $@
echo 'set ylabel "Bandwidth per disk [MB/s]"' >> $@
echo '' >> $@
echo 'plot [0:$(PLOTXMAX)] [0:$(PLOTYMAX)] \' >> $@
$(foreach d,$(DISKS_1by1),\
$(call plotline-cr1,$(HOST)-$d.cr1.log,$(call disk2label,$d)) \
$(call plotline-cr,$(HOST)-$d.cr.log,$(call disk2label,$d)) \
$(call plotline-wr,$(HOST)-$d.wr.log,$(call disk2label,$d)) \
$(call plotline-rd,$(HOST)-$d.wr.log,$(call disk2label,$d)))
$(foreach d,$(filter-out $(DISKS_1by1),$(DISKS)),\
$(call plotline-wr,$(HOST)-$d.wr.log,$(call disks2label,$d)) \
$(call plotline-rd,$(HOST)-$d.wr.log,$(call disks2label,$d)))
echo ' "nothing" notitle' >> $@
echo '' >> $@
echo 'pause mouse' >> $@
echo '' >> $@
echo 'set title "STXXL Disk Benchmark $(DISKNAME) \\@ $(HOST)"' >> $@
echo 'set term postscript enhanced color' >> $@
echo 'set output "$(HOST).ps"' >> $@
echo 'replot' >> $@
-include iostat-plot.mk