2015年3月11日 星期三

bonnie++-1.03a -cross complie

source download:
http://sourceforge.net/projects/bonnie/?source=typ_redirect

references:
http://www.eygle.com/archives/2004/10/use_bonnie_plus2_test_iospeed.html
http://www.net527.cn/a/caozuoxitong/Linux/2012/1117/25062.html
http://www.eygle.com/archives/2004/10/use_bonnie_plus2_test_iospeed.html
http://mkl-note.blogspot.tw/2008/11/using-bonnie.html
http://www.360doc.com/relevant/282911096_more.shtml
http://www.360doc.com/content/10/0511/17/1059940_27092422.shtml

(優化)
http://blog.csdn.net/fireroll/article/details/13770567

./configure --host=arm-unknown-linux-uclibcgnueabi CXX=arm-unknown-linux-uclibcgnueabi-g++
make

=> 會出現以下問題
......
zcav.cpp: In function ‘int main(int, char**)’:
zcav.cpp:73: error: ‘strdup’ was not declared in this scope
zcav.cpp:112: error: ‘strcmp’ was not declared in this scope
......

解決辦法:
zcav.cpp 加入以下2個header file
#include <stdio.h>
#include <string.h>

==> make clean && make

拷貝 bonnie++到板子執行,會出現以下問題
./bonnie++: can't load library 'libstdc++.so.6'

解決辦法: 改成靜態編譯
vi Makefile
......
WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope $(MORE_WARNINGS)
CFLAGS=-O2  -DNDEBUG $(WFLAGS) $(MORECFLAGS) -static
CXX=arm-unknown-linux-uclibcgnueabi-g++ $(CFLAGS)
.....

拷貝 bonnie++到板子執行即可

[如何下command]

can't load library 'libstdc++.so.6'

source:
http://www.blogbus.com/daodaoluan-logs/65253239.html

==
# ./iperf 
./iperf: can't load library 'libstdc++.so.6' 
的提示,解决办法是:
要静态编译: 
$cd iperf-2.0.4/src 
$vi Makefile 
在CFLAGS和CXXFLAGS都加-static参数 
CFLAGS = -O2 -static 
CXXFLAGS = -O2 -static 

2015年3月10日 星期二

linux test tools

source:
http://ltp.sourceforge.net/tooltable.php

==
Linux Test Tools

The purpose of this Linux Test Tools Table is to provide the open-source community with a comprehensive list of tools commonly used for testing the various components of Linux.
My hope is that the community will embrace and contribute to this list making it a valuable addition to the Linux Test Project.

Please feel free to send additions, updates or suggestions to Jeff MartinLast update:07/12/06

Cluster
HINT allows fair comparisons over extreme variations in computer architecture, absolute performance, storage capacity, and precision. It's listed as a Past Projectwith a link to http://hint.byu.edu but I have not been able to find where it is being maintained. If you know, please drop me a note. 

Code Coverage Analysis
gcov Code analysis tool for profiling code and determining: 1) how often each line of code executes, 2) what lines of code are actually executed, 3.) how much computing time each section of codeuses  
lcov LCOV is an extension of GCOV, a GNU tool which provides information about what parts of a program are actually executed (i.e. "covered") while running a particular test case. The extension provides HTML output and support for large projects. 

Database
DOTS Database Opensource Test Suite 
dbgrinder perl script to inflict stress on a mysql server 
OSDL Database Testsuite OSDL Database Testsuite 

Debug
Dynamic Probes Dynamic Probes is a generic and pervasive debugging facility. 
Kernel Debug (KDB) KDB is an interactive debugger built into the Linux kernel. It allows the user to examine kernel memory, disassembled code and registers. 
Linux Kernel Crash Dump LKCD project is designed to help detect, save and examine system crashes and crash info. 
Linux Trace Toolkit (LTT) The Linux Trace Toolkit is a fully-featured tracing system for the Linux kernel. 

Defect Tracking
Bugzilla allows individuals or groups of developers to keep track of outstanding bugs in their product effectively 

Desktop/GUI Libraries
Android open source testing tool for GUI programs 
ldtpGNU/Linux Desktop Testing Project

Event Logging
included tests Various tests are included in the tarball 

Filesystems
Bonnie Bonnie++ is test suite, which performs several hard drive/ filesystem tests. 
dbench Filesystem benchmark that generates good filesystem load 
fs_inode Part of the LTP: This test creates several subdirectories and files off of two parent directories and removes directories and files as part of the test. 
fs_maim Part of the LTP: a set of scripts to test and stress filesystem and storage management utilities 
IOZone Filesystem benchmark tool (read, write, re-read, re-write, read backwards, read strided, fread, fwrite, random read, pread, aio_read, aio_write) 
lftest Part of the LTP:lftest is a tool/test designed to create large files and lseek from the beginning of the file to the end of the file after each block write. This test verifies large file support and can be used to generate large files for other filesystem tests. Files up to 2Tb have been created using this tool. This test is VERY picky about glibc version. 
LTP The Linux Test Project is a collection of tools for testing the Linux kernel and related features. 
PostMark Filesystem benchmark that simulates load generated by enterprise applications such as email, news and web-based commerce. 
stress puts the system under a specified amount of load 
mongo set of the programs to test linux filesystems for performance and functionality 
fsx File system exerciser from Apple. The test is most effective if you let it run for a minute or two, so that it overlaps the periodic sync that most Unix systems do. 
xddStorage I/O Performance Characterization tool that runs on most UNIX-like systems and Windows.Has been around since 1992 and is in use at various government labs.

Harnesses
Cerberus The Cerberus Test Control System(CTCS) is a free (freedom) test suite for use by developers and others to test hardware. It generates good filesystem stress in the process. 
STAF The Software Testing Automation Framework (STAF) is an open source framework designed to improvethe level of reuse and automation in test cases and test environments.  

I/O & Storage
tiobench Portable, robust, fully-threaded I/O benchmark program 
xddStorage I/O Performance Characterization tool that runs on most UNIX-like systems and Windows.Has been around since 1992 and is in use at various government labs.

Kernel System Calls
crashme a tool for testing the robustness of an operating environment using a technique of "Random Input" response analysis 
LTP The Linux Test Project is a collection of tools for testing the Linux kernel and related features. 

Network
Connectathon NFS Testsuite This testsuite tests the NFS Protocol 
ISIC ISIC is a suite of utilities to exercise the stability of an IP Stack and its component stacks 
LTP The Linux Test Project has a collection of tools for testing the network components of the Linux kernel. 
netperf Netperf is a benchmark that can be used to measure the performance of many different types of networking. 
NetPIPE Variable time bench mark, ie, it measures network performance using variable sized communiation transfers 
TAHI Providesinteroperability and conformance tests for IPv6 
VolanoMark A java chatroom benchmark/stress 
UNH IPv6 Tests there are several IPv6 tests on this site 
Iperf for measuring TCP and UDP bandwidth performance 

Network Security
Kerberos Test suite These tests are for testing Kerberos clients (kinit,klist and kdestroy) and Kerberized Applications, ftp and telnet. 

Other
cpuburn This program was designed by Robert Redelmeier to heavily loadCPU chips. 

Performance
contest test system responsiveness by running kernel compilation under anumber of different load conditions 
glibench/clibench benchmarking tool to check your computer CPU and hard disk performance 
lmbench Suite of simple, portable benchmarks 
AIM Benchmark Performance benchmark 
unixbench Performance benchmark based on the early BYTE UNIX Benchmarks "retired" since about 1997, but still used by some testers 

Scalability
dbench Used for dcache scalability testing 
Chat Used for file_struct scalability testing 
httperf Used for dcache scalability testing 

Scheduler
LTP The Linux Test Project is a collection of tools for testing the Linux kernel and related features. sched_stress and process_stress 
VolanoMark A java chatroom benchmark/stress VolanoMark has been used to stress the scheduler. 

SCSI Hardening
Bonnie Bonnie is test suite, which performs several hard drive and filesystem tests.  
LTP The Linux Test Project is a collection of toolsfor testing the Linux kernel and related features. disktest 
dt dt (Data Test) is a generic data test program used to verify proper operation of peripherals, file systems, device drivers, or any data stream supported by the operating system 

Security
Nessus remote security scanner 

Standards
LSB Test suites used for LSB compliance testing 

Stream Controlled Transmission Protocol
LTP The Linux Test Project is a collection of tools for testing the Linux kernel and related features. 

System Management
sblim The "SBLIM Reference Implementation (SRI)" is a component of the SBLIM project. Its purposes are (among others): (1) easily set up, run and test systems management scenarios based on CIM/CIMOM technology (2) test CIM Providers (on local and/or remote Linux machines) 

Threads
LTP The Linux Test Project is a collection of tools for testing the Linux kernel and related features. 
VSTHlite Tests for compliance with IEEE POSIX 1003.1c extensions (pthreads). 

USB
usbstress Sent to us by the folks at Linux-usb.org 

Version Control
cvs the dominant open-source network-transparent version control system 
BitKeeper BK/Pro is a scalable configuration management system, supporting globally distributed development, disconnected operation, compressed repositories, change sets, and repositories as branches. Read the licensing info 
Subversion 

VMM
vmregress regrssion, testing and benchmark tool 
LTP The Linux Test Project is a collection of tools for testing the Linux kernel and related features. 
memtest86 A thorough real-mode memory tester 
stress puts the system under a specified amount of load 
memtest86+ fork / enhanced version of the memtest86 
memtester Utility to test for faulty memory subsystem 

Web Server
Hammerhead Hammerhead is a web server stress tool that can simulate multiple connections and users. 
httperf httperf is a popular web server benchmark tool for measuring web server performance 
siege Siege is an http regression testing and benchmarking utility. 
PagePoker for loadtesting and benchmarking web servers 

2015年3月9日 星期一

mdev v.s. exfat

在arm平台下,/etc/mdev.conf
mmcblk[0-9]p[0-9] 0:0 666 @ /gm/bin/sd_card_inserting.sh

mmcblk[0-9] 0:0 666 $ /gm/bin/sd_card_removing.sh
==
[sd_card_inserting.sh]
#!/bin/sh
echo "mount..."
mount -t vfat /dev/mmcblk0p1 /mnt/sd_card
mount -t exfat /dev/mmcblk0p1 /mnt/sd_card =>加入這行
[ -d /var/log ] || mkdir /var/log
echo "" > /var/log/has_sd_card



[sd_card_removing.sh]
#!/bin/sh
echo "umount......"
[ -d /var/log ] && [ -f /var/log/has_sd_card ] && rm -f /var/log/has_sd_card
sync
umount -lf /mnt/sd_card


[test]
1.FAT32/exFAT 不同 filesystem 交換測試SD card 插拔是否能自動 auto mount : OK
2.record

==
reference:
http://breakice1016.blogspot.tw/2011/08/usb-hotplug-procsyskernel-mdev-udev.html

(auto mount)
http://clc168.blogspot.tw/2008/04/arm-embedded-linuxautomount.html
==
source:
http://breakice1016.blogspot.tw/2011/08/usb-hotplug-procsyskernel-mdev-udev.html

busybox的mdev是一個精簡了的udev管理程序,它可以間接的以hotplug方式被內核調用,進而在arm平台上/dev目錄下動態創建設備 節點,因為hotplug會被內核發送uevent之前調用,所以如果動態可插拔設備很多,很頻繁,那麼每次內核都會調用elf格式的用戶空間的 hotplug,生成一個獨立的hotplug程序來處理,所以hotplug是一個非常笨重的實現方法,但是在我們的arm開發板上,可插拔設備並沒有 想像中的頻繁
目前還沒有必要移植完全版的udev,所以完全可以在不複雜的嵌入式設備上使用mdev來管理動態節點,

方法也很簡單,就是在rcS腳本中加入下面一句,將用戶空間的應用程序路徑傳遞給內核,
echo /sbin/mdev > /proc/sys/kernel/hotplug
之後kernel會在每次設備出現變動時調用上面一句傳遞進去的用戶空間應用程序/sbin/mdev來處理對應的信息,進而mdev應用程序操作/dev目錄下的設備,進行添加或刪除,可以參考添加hotplug函數到內核,監控uevent信息
  mdev的另外一個很有用的地方是,他可以通過proc和sys文件系統來動態整理出註冊的設備,進而到/dev/下生成他們對應的節點,
使用該功能之前必須mount上proc和sys文件系統,然後簡單的執行下面的一句就彎成了:

  mdev -s

1, busybox 添加mdev支持

2, 在/etc/rc.d/rcS中添加
#mount filesystem
/bin/mount -a
#start mdev
#設置系統的hotplug 程序為mdev
echo /sbin/mdev > /proc/sys/kernel/hotplug   
#掃瞄並創建節點,這一步可不能少 
mdev –s

/etc/fstab的內容如下:
proc    /proc   proc    defaults    0       0
none    /tmp    ramfs   defaults 0       0
mdev    /dev    ramfs   defaults 0       0
sysfs   /sys    sysfs   defaults    0       0

執行mdev -s :以『-s'為參數調用位於 /sbin目錄寫的mdev(其實是個鏈接,作用是傳遞參數給/bin目錄下的busybox 程序並調用它),mdev掃瞄 /sys/class 和 /sys/block 中所有的類設備目錄,如果在目錄中含有名為「dev」的文件,且文件中包含的是設備號,則mdev就利用這些信息為這個設備在/dev 下創建設備節點文件。一般只在啟動時才執行一次 「mdev -s」。

熱插拔事件:由於啟動時運行了命令:echo /sbin/mdev > /proc/sys/kernel/ hotplug ,那麼當有熱插拔事件產生時,內核就會調用位於 /sbin目錄的mdev。這時mdev通過環境變量中的 ACTION 和 DEVPATH,來確定此次熱插拔事件的動作以及影響了/sys中的那個目錄。接著會看看這個目錄中是否有「dev」的屬性文件,如果有就利用這些信息為 這個設備在/dev 下創建設備節點文件。

解決使用mdev時「cannot create /proc/sys/kernel/hotplug :nonexistent directory」錯誤
確保編譯內核時編譯如下選項:
CONFIG_PROC_FS=y
CONFIG_PROC_SYSCTL=y
CONFIG_HOTPLUG=y
CONFIG_NET=y

如果CONFIG_HOTPLUG和CONFIG_NET不選或沒全選上的話,/proc/sys/kernel下將不會創建hotplug文件.(參見kernel/sysctl.c)

2015年3月1日 星期日

exfat ultis for arm

scons -Q -c => make clean
scons -Q     => make
(1) scons -Q CC=/usr/src/arm-linux-3.3/toolchain_gnueabi-4.4.0_ARMv5TE/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc

(2)修改SConstruct,然後scons -Q
修改SConstruct如下:
......
import os
import platform
import SCons

env = Environment(**ARGUMENTS)
env = Environment(CC='/usr/src/arm-linux-3.3/toolchain_gnueabi-4.4.0_ARMv5TE/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc')   =>新增加
......
......
......



(key)
(2)cross compile
看了一下SConstrct不太懂
後來搜尋一些網頁,在這邊得到很大的幫助
https://community.freescale.com/docs/DOC-94850
因此寫了一個簡單的script來幫助編譯
但比較重要的大概只有這一行:

scons SYSROOT=$PWD DESTDIR=$PWD/release CC=$GCC_PATH/bin/arm-marvell-linux-gnueabi-gcc AR=$GCC_PATH/bin/arm-marvell-linux-gnueabi-ar RANLIB=$GCC_PATH/bin/arm-marvell-linux-gnueabi-ranlib STRIP=$GCC_PATH/bin/arm-marvell-linux-gnueabi-strip install

簡單說就是要指向你cross compiler的環境
改完這邊應該就可以進行編譯了
(3)libexfat/compiler.h
這時候執行scons,應該會出現下列error:

In file included from libexfat/exfat.h:33:0,
                 from fuse/main.c:30:
libexfat/compiler.h:28:2: error: #error C99-compliant compiler is required
scons: *** [fuse/main.o] Error 1
scons: building terminated because of errors.

解決方法就是將compiler.h內的某幾行給註解掉,原因應該很明顯
#if __STDC_VERSION__ < 199901L
#error C99-compliant compiler is required
#endif

compile完會出現mount.exfat執行檔

3.exfat-utils-1.1.1
可參考第2項的(2)與(3)

之後將編譯出來的libfuse.so.*與mount.exfat放到嵌入式平台上
應該就可以用來mount exfat格式的隨身碟了