projects
/
yaffs2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3b6c99b
)
Tweaks to nor stress simulation. Save random seed so that we can do better debugging
author
charles
<charles>
Fri, 21 Nov 2008 02:19:30 +0000
(
02:19
+0000)
committer
charles
<charles>
Fri, 21 Nov 2008 02:19:30 +0000
(
02:19
+0000)
direct/Makefile
patch
|
blob
|
history
direct/dtest.c
patch
|
blob
|
history
direct/nor_stress.c
patch
|
blob
|
history
direct/run_fw_update_test.sh
patch
|
blob
|
history
direct/yaffs_test.c
patch
|
blob
|
history
direct/ynorsim.c
patch
|
blob
|
history
diff --git
a/direct/Makefile
b/direct/Makefile
index bfd98be92606ea00c4336cda0bf454822a97e78f..ff9f2e337c40f3e9413db2cbe2334f7c5053fc8f 100644
(file)
--- a/
direct/Makefile
+++ b/
direct/Makefile
@@
-14,7
+14,7
@@
#
# NB Warning this Makefile does not include header dependencies.
#
#
# NB Warning this Makefile does not include header dependencies.
#
-# $Id: Makefile,v 1.2
0 2008-11-11 01:48:47
charles Exp $
+# $Id: Makefile,v 1.2
1 2008-11-21 02:19:30
charles Exp $
#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
@@
-22,7
+22,7
@@
CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_Y
CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES -DNO_Y_INLINE
CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
#CFLAGS += -fno-strict-aliasing
CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES -DNO_Y_INLINE
CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
#CFLAGS += -fno-strict-aliasing
-CFLAGS += -O
3
+CFLAGS += -O
0
#CFLAGS += -DVALGRIND_TEST
#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
#CFLAGS += -DVALGRIND_TEST
#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
diff --git
a/direct/dtest.c
b/direct/dtest.c
index fd4f9666dd4fb6adb44754da61dc9743dbd77568..4478cdc9c515a588d5a26635d23db6515d84810c 100644
(file)
--- a/
direct/dtest.c
+++ b/
direct/dtest.c
@@
-2283,10
+2283,11
@@
void random_small_file_test(const char *mountpt,int iterations)
}
}
+int random_seed;
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
-
+ random_seed = time(NULL);
//return long_test(argc,argv);
//return cache_read_test();
//return long_test(argc,argv);
//return cache_read_test();
diff --git
a/direct/nor_stress.c
b/direct/nor_stress.c
index 4ac10b1c6186f929b0e1ea9f00aca7c353d679f3..b3704583a184ffc7f4f5b03f0285ee48783acd82 100644
(file)
--- a/
direct/nor_stress.c
+++ b/
direct/nor_stress.c
@@
-290,10
+290,11
@@
static int yVerifyFile(const char *fName)
return retval;
}
return retval;
}
-static unsigned long next = 1;
+extern int random_seed;
+
int myrand(void) {
int myrand(void) {
-
next = next
* 1103515245 + 12345;
- return((unsigned)(
next
/65536) % 32768);
+
random_seed = random_seed
* 1103515245 + 12345;
+ return((unsigned)(
random_seed
/65536) % 32768);
}
static void DoUpdateMainFile(void)
}
static void DoUpdateMainFile(void)
@@
-344,13
+345,16
@@
void NorStressTestRun(const char *prefix)
dump_directory_tree(fullPathName);
UpdateCounter(fullPowerUpName,&powerUps,0);
dump_directory_tree(fullPathName);
UpdateCounter(fullPowerUpName,&powerUps,0);
+ dump_directory_tree(fullPathName);
while(1){
UpdateCounter(fullStartName, &cycleStarts,0);
while(1){
UpdateCounter(fullStartName, &cycleStarts,0);
+ dump_directory_tree(fullPathName);
DoVerifyMainFile();
DoUpdateMainFile();
dump_directory_tree(fullPathName);
UpdateCounter(fullEndName,&cycleEnds,0);
DoVerifyMainFile();
DoUpdateMainFile();
dump_directory_tree(fullPathName);
UpdateCounter(fullEndName,&cycleEnds,0);
+ dump_directory_tree(fullPathName);
}
}
}
}
diff --git
a/direct/run_fw_update_test.sh
b/direct/run_fw_update_test.sh
index b08fa84d1a57a757dca737df294fecc9702ef2ee..8ba15306c644bd60eb0717dc4af95c6489fffa64 100755
(executable)
--- a/
direct/run_fw_update_test.sh
+++ b/
direct/run_fw_update_test.sh
@@
-3,10
+3,13
@@
for ((i=0; i < 100000; i++))
do
for ((i=0; i < 100000; i++))
do
- echo $i > cycle.count
+
+ seed=$RANDOM
j=$(( $i % 10 ))
j=$(( $i % 10 ))
-
+ rm seed*$j
+ echo $seed>seed$i
rm data*$j
cp ynorsimdata data$i
rm data*$j
cp ynorsimdata data$i
- ./yaffs_test /M18-1 fw_update
+ echo "######### Run $i with seed $seed"
+ ./yaffs_test /M18-1 fw_update $seed
done
done
diff --git
a/direct/yaffs_test.c
b/direct/yaffs_test.c
index 381df44052c13b8766491f41e2cbd191fbb9471a..04e3b2ae40e93e1fbf5f489dbe8542be49316719 100644
(file)
--- a/
direct/yaffs_test.c
+++ b/
direct/yaffs_test.c
@@
-26,20
+26,27
@@
+int random_seed;
+
void BadUsage(void)
{
void BadUsage(void)
{
- printf("usage root_dir test_id\n");
+ printf("usage root_dir test_id
seed
\n");
printf(" test_id: fw_update fw_update_init\n");
exit(2);
}
int main(int argc, const char *argv[])
{
yaffs_StartUp();
printf(" test_id: fw_update fw_update_init\n");
exit(2);
}
int main(int argc, const char *argv[])
{
yaffs_StartUp();
- if(argc == 3) {
+ if(argc == 4) {
+ random_seed = atoi(argv[3]);
+ if(random_seed <= 0)
+ BadUsage();
+
if(!strcmp(argv[2],"fw_update_init")){
NorStressTestInitialise(argv[1]);
}
else if(!strcmp(argv[2],"fw_update")){
if(!strcmp(argv[2],"fw_update_init")){
NorStressTestInitialise(argv[1]);
}
else if(!strcmp(argv[2],"fw_update")){
+ printf("Running stress on %s with seed %d\n",argv[1],random_seed);
NorStressTestRun(argv[1]);
}
else
NorStressTestRun(argv[1]);
}
else
diff --git
a/direct/ynorsim.c
b/direct/ynorsim.c
index 3281a2f374c3b78f05ec82572d974d4f2956e246..6936a9c874e2c9bffb4d995e8ab4d8e870c8fda6 100644
(file)
--- a/
direct/ynorsim.c
+++ b/
direct/ynorsim.c
@@
-39,6
+39,7
@@
static __u32 word[YNORSIM_DEV_SIZE_U32];
static __u32 word[YNORSIM_DEV_SIZE_U32];
+extern int random_seed;
static void NorError(void)
{
static void NorError(void)
{
@@
-89,7
+90,7
@@
static void ynorsim_Ready(void)
{
if(initialised)
return;
{
if(initialised)
return;
- srand(
time(NULL)
);
+ srand(
random_seed
);
remaining_ops = 1000000000;
remaining_ops = (rand() % 10000) * 3000 * YNORSIM_BIT_CHANGES;
ynorsim_RestoreImage();
remaining_ops = 1000000000;
remaining_ops = (rand() % 10000) * 3000 * YNORSIM_BIT_CHANGES;
ynorsim_RestoreImage();