ubuntu怎么安装disksim
1个回答
展开全部
一、安装须知:
1. 我是在在32位OS下安装使用DiskSim
2. DiskSim使用lex和yacc进行词法及语法分析,故linux如没安装flex、bison的话,先要安装。
$ sudo apt-get install bison flex(前提是先联网)
3. 下载源码安装包
disksim 4.0:http://www.pdl.cmu.edu/DiskSim/
SSDextension:http://research.microsoft.com/en-us/downloads/b41019e2-1d2b-44d8-b512-ba35ab814cd4/
二、安装步骤
Step 1. Download and unzip.
Sources can be downloaded from the links above. I downloaded DiskSim 4.0 with dixtrac.
$ tar -zxvf disksim-4.0-with-dixtrac.tar.gz
$ cd disksim-4.0
$ unzip ../ssd-add-on.zip
Step 2. Apply SSD add on patch.
$ patch -p1 < ssdmodel/ssd-patch
Step 3. Modify Makefile to support math library
a. 修改memsmodel/Makefile:
进入disksim4.0/memsmodel目录,然后执行命令sudo vim Makefile
待修改的部分:
mems_seektest: mems_seektest.o libmems_internals.a
$(CC) -o $@ mems_seektest.o $(LDFLAGS) $(CFLAGS) -lmems_internals
我们将$(LDFLAGS)放置最后;
修改后的结果如下:
mems_seektest: mems_seektest.o libmems_internals.a
$(CC) -o $@ mems_seektest.o $(CFLAGS) -lmems_internals $(LDFLAGS)
b.修改dixtrac/Makefile:
进入disksim4.0/dixtrac目录,然后执行命令sudo vim Makefile
待修改的部分:
LDFLAGS = -L. -lm -l$(LIBNAME) -ldxtools \
$(LIBDISKSIM_LDFLAGS) \
$(MEMSMODEL_LDFLAGS) \
$(DISKMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) \
$(LIBDDBG_LDFLAGS) \
$(ST_LDFLAGS)
我们将-lm放置最后;
修改后的结果如下:
LDFLAGS = -L. -l$(LIBNAME) -ldxtools \
$(LIBDISKSIM_LDFLAGS) \
$(MEMSMODEL_LDFLAGS) \
$(DISKMODEL_LDFLAGS) \
$(SSDMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) \
$(LIBDDBG_LDFLAGS) \
$(ST_LDFLAGS) -lm
c.修改src/Makefile:
进入disksim4.0/src目录,然后执行命令sudo vim Makefile
待修改的部分:
LDFLAGS = -lm -L. -ldisksim $(DISKMODEL_LDFLAGS) $(MEMSMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) $(LIBDDBG_LDFLAGS)
我们将-lm放置最后;
修改后的结果如下:
LDFLAGS = -L. -ldisksim $(DISKMODEL_LDFLAGS) $(MEMSMODEL_LDFLAGS) \
$(SSDMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) $(LIBDDBG_LDFLAGS) -lm
Step 4. Append SSD model library path to dixtrac.
4.1 add these lines to dixtrac/.paths(将下面的六行代码复制到该文件的最底端)
#PATH TO SSDMODEL
export SSDMODEL_PREFIX=../ssdmodel
export SSDMODEL_INCL=$(SSDMODEL_PREFIX)/include
export SSDMODEL_CFLAGS=-I$(SSDMODEL_INCL)
export SSDMODEL_LDPATH=$(SSDMODEL_PREFIX)/lib
export SSDMODEL_LDFLAGS=-L$(SSDMODEL_LDPATH) -lssdmodel
4.2 修改dixtrac/Makefile文件 :
$(LIBDISKSIM_LDFLAGS)
$(MEMSMODEL_LDFLAGS)
$(DISKMODEL_LDFLAGS)
$(SSDMODEL_LDFLAGS) #(添加这一行内容)
$(LIBPARAM_LDFLAGS)
$(LIBDDBG_LDFLAGS)
$(ST_LDFLAGS)
CFLAGS = -Wall -g -MD -I. $(DEFINES) -I$(STHREADS) $(DMINCLUDES)
$(LIBDISKSIM_CFLAGS)
$(DISKMODEL_CFLAGS) $(LIBPARAM_CFLAGS) $(LIBDDBG_CFLAGS)
$(SSDMODEL_CFLAGS)#(添加这一行内容,注意使用tab键来对齐)
Step 5. Compile!(进入disksim4.0目录执行该命令)
$ make
注意:此时编译时提示出错,错误提示如下:
make[1]: 正在进入目录 `/home/liyongwei/liyongwei/DiskSim安装/disksim-4.0/dixtrac'
Makefile:68: *** commands commence before first target。 停止。
make[1]:正在离开目录 `/home/liyongwei/liyongwei/DiskSim安装/disksim-4.0/dixtrac'
make: *** [all] 错误 2
有篇文章说这种错误时由于修改时没有采用tab键对齐造成的,但是我检查之后发现我的修改没有错误,于是忽略这个错误提示,继续进行。(执行完该操作之后,在disksim/src/中会有一个名为disksim的可执行文件,代表编译成功)
Step 6. Check if it works well.
$ cd valid; ./runvalid
$ chmod a+x ../ssdmodel/valid/runvalid
$ cd ../ssdmodel/valid; ./runvalid
需等待段时间获得结果,结果如下:
—Running tests with the synthetic workload generator—
Sequential read (250K I/Os): average SSD response time should be around 0.132 ms
ssd Response time average: 0.132511
Sequential write (250K I/Os): average SSD response time should be around 0.310 ms
ssd Response time average: 0.310895
Sequential write (5M I/Os): average SSD response time should be around 0.334 ms
ssd Response time average: 0.334365
Random read (250K I/Os): average SSD response time should be around 0.136 ms
ssd Response time average: 0.136118
Random write (250K I/Os): average SSD response time should be around 0.329 ms
ssd Response time average: 0.329458
Random write (5M I/Os): average SSD response time should be around 0.593 ms
ssd Response time average: 0.593438
—Running tests with the real traces—
IOzone: average SSD response time should be around 6.394276 ms
ssd Response time average: 6.394276
Postmark: average SSD response time should be around 4.140330 ms
ssd Response time average: 4.140330
说明安装成功!
7.也可以进disksim4.0/valid/执行$ ./runvalid
部分结果如下:
These results represent actual drive validation experiments
QUANTUM_QM39100TD-SW (rms should be about 0.378)
rms = 0.377952
SEAGATE_ST32171W (rms should be about 0.349)
rms = 0.347570
SEAGATE_ST34501N (rms should be about 0.318)
rms = 0.317972
8.再做另外一个测试,
进入disksim-4.0/ssdmodel/valid/目录下,新建一个test.outv文件用于存放测试输出的结果。
运行示例(在disksim-4.0文件夹下执行下面的命令):./src/disksim ./ssdmodel/valid/ssd-postmark.parv ./ssdmodel/valid/test.outv ascii ./ssdmodel/valid/ssd-postmark-aligned2.trace 0
等待结束后打开test.outv就会发现里面多了好多的数据,那就恭喜你了。
1. 我是在在32位OS下安装使用DiskSim
2. DiskSim使用lex和yacc进行词法及语法分析,故linux如没安装flex、bison的话,先要安装。
$ sudo apt-get install bison flex(前提是先联网)
3. 下载源码安装包
disksim 4.0:http://www.pdl.cmu.edu/DiskSim/
SSDextension:http://research.microsoft.com/en-us/downloads/b41019e2-1d2b-44d8-b512-ba35ab814cd4/
二、安装步骤
Step 1. Download and unzip.
Sources can be downloaded from the links above. I downloaded DiskSim 4.0 with dixtrac.
$ tar -zxvf disksim-4.0-with-dixtrac.tar.gz
$ cd disksim-4.0
$ unzip ../ssd-add-on.zip
Step 2. Apply SSD add on patch.
$ patch -p1 < ssdmodel/ssd-patch
Step 3. Modify Makefile to support math library
a. 修改memsmodel/Makefile:
进入disksim4.0/memsmodel目录,然后执行命令sudo vim Makefile
待修改的部分:
mems_seektest: mems_seektest.o libmems_internals.a
$(CC) -o $@ mems_seektest.o $(LDFLAGS) $(CFLAGS) -lmems_internals
我们将$(LDFLAGS)放置最后;
修改后的结果如下:
mems_seektest: mems_seektest.o libmems_internals.a
$(CC) -o $@ mems_seektest.o $(CFLAGS) -lmems_internals $(LDFLAGS)
b.修改dixtrac/Makefile:
进入disksim4.0/dixtrac目录,然后执行命令sudo vim Makefile
待修改的部分:
LDFLAGS = -L. -lm -l$(LIBNAME) -ldxtools \
$(LIBDISKSIM_LDFLAGS) \
$(MEMSMODEL_LDFLAGS) \
$(DISKMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) \
$(LIBDDBG_LDFLAGS) \
$(ST_LDFLAGS)
我们将-lm放置最后;
修改后的结果如下:
LDFLAGS = -L. -l$(LIBNAME) -ldxtools \
$(LIBDISKSIM_LDFLAGS) \
$(MEMSMODEL_LDFLAGS) \
$(DISKMODEL_LDFLAGS) \
$(SSDMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) \
$(LIBDDBG_LDFLAGS) \
$(ST_LDFLAGS) -lm
c.修改src/Makefile:
进入disksim4.0/src目录,然后执行命令sudo vim Makefile
待修改的部分:
LDFLAGS = -lm -L. -ldisksim $(DISKMODEL_LDFLAGS) $(MEMSMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) $(LIBDDBG_LDFLAGS)
我们将-lm放置最后;
修改后的结果如下:
LDFLAGS = -L. -ldisksim $(DISKMODEL_LDFLAGS) $(MEMSMODEL_LDFLAGS) \
$(SSDMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) $(LIBDDBG_LDFLAGS) -lm
Step 4. Append SSD model library path to dixtrac.
4.1 add these lines to dixtrac/.paths(将下面的六行代码复制到该文件的最底端)
#PATH TO SSDMODEL
export SSDMODEL_PREFIX=../ssdmodel
export SSDMODEL_INCL=$(SSDMODEL_PREFIX)/include
export SSDMODEL_CFLAGS=-I$(SSDMODEL_INCL)
export SSDMODEL_LDPATH=$(SSDMODEL_PREFIX)/lib
export SSDMODEL_LDFLAGS=-L$(SSDMODEL_LDPATH) -lssdmodel
4.2 修改dixtrac/Makefile文件 :
$(LIBDISKSIM_LDFLAGS)
$(MEMSMODEL_LDFLAGS)
$(DISKMODEL_LDFLAGS)
$(SSDMODEL_LDFLAGS) #(添加这一行内容)
$(LIBPARAM_LDFLAGS)
$(LIBDDBG_LDFLAGS)
$(ST_LDFLAGS)
CFLAGS = -Wall -g -MD -I. $(DEFINES) -I$(STHREADS) $(DMINCLUDES)
$(LIBDISKSIM_CFLAGS)
$(DISKMODEL_CFLAGS) $(LIBPARAM_CFLAGS) $(LIBDDBG_CFLAGS)
$(SSDMODEL_CFLAGS)#(添加这一行内容,注意使用tab键来对齐)
Step 5. Compile!(进入disksim4.0目录执行该命令)
$ make
注意:此时编译时提示出错,错误提示如下:
make[1]: 正在进入目录 `/home/liyongwei/liyongwei/DiskSim安装/disksim-4.0/dixtrac'
Makefile:68: *** commands commence before first target。 停止。
make[1]:正在离开目录 `/home/liyongwei/liyongwei/DiskSim安装/disksim-4.0/dixtrac'
make: *** [all] 错误 2
有篇文章说这种错误时由于修改时没有采用tab键对齐造成的,但是我检查之后发现我的修改没有错误,于是忽略这个错误提示,继续进行。(执行完该操作之后,在disksim/src/中会有一个名为disksim的可执行文件,代表编译成功)
Step 6. Check if it works well.
$ cd valid; ./runvalid
$ chmod a+x ../ssdmodel/valid/runvalid
$ cd ../ssdmodel/valid; ./runvalid
需等待段时间获得结果,结果如下:
—Running tests with the synthetic workload generator—
Sequential read (250K I/Os): average SSD response time should be around 0.132 ms
ssd Response time average: 0.132511
Sequential write (250K I/Os): average SSD response time should be around 0.310 ms
ssd Response time average: 0.310895
Sequential write (5M I/Os): average SSD response time should be around 0.334 ms
ssd Response time average: 0.334365
Random read (250K I/Os): average SSD response time should be around 0.136 ms
ssd Response time average: 0.136118
Random write (250K I/Os): average SSD response time should be around 0.329 ms
ssd Response time average: 0.329458
Random write (5M I/Os): average SSD response time should be around 0.593 ms
ssd Response time average: 0.593438
—Running tests with the real traces—
IOzone: average SSD response time should be around 6.394276 ms
ssd Response time average: 6.394276
Postmark: average SSD response time should be around 4.140330 ms
ssd Response time average: 4.140330
说明安装成功!
7.也可以进disksim4.0/valid/执行$ ./runvalid
部分结果如下:
These results represent actual drive validation experiments
QUANTUM_QM39100TD-SW (rms should be about 0.378)
rms = 0.377952
SEAGATE_ST32171W (rms should be about 0.349)
rms = 0.347570
SEAGATE_ST34501N (rms should be about 0.318)
rms = 0.317972
8.再做另外一个测试,
进入disksim-4.0/ssdmodel/valid/目录下,新建一个test.outv文件用于存放测试输出的结果。
运行示例(在disksim-4.0文件夹下执行下面的命令):./src/disksim ./ssdmodel/valid/ssd-postmark.parv ./ssdmodel/valid/test.outv ascii ./ssdmodel/valid/ssd-postmark-aligned2.trace 0
等待结束后打开test.outv就会发现里面多了好多的数据,那就恭喜你了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询