+
+
+void dump_dev_stats(yaffs_Device *dev, const char * str)
+{
+ printf("%s\n",str);
+ printf( "space free %d erased %d "
+ "nand reads %d writes %d erases %d "
+ "gc all %d passive %d oldestdirty %d blocks %d copies %d \n",
+ dev->nFreeChunks, dev->nErasedBlocks * dev->param.nChunksPerBlock,
+ dev->nPageReads, dev->nPageWrites, dev->nBlockErasures,
+ dev->allGCs, dev->passiveGCs, dev->oldestDirtyGCs, dev->nGCBlocks, dev->nGCCopies);
+}
+
+void test_flash_traffic(const char *mountpt)
+{
+ char name0[100];
+ char name1[100];
+ int i;
+ yaffs_Device *dev;
+
+ yaffs_traceMask = 0;
+
+ yaffs_StartUp();
+
+ yaffs_mount(mountpt);
+
+ dev = yaffs_getdev(mountpt);
+
+ strcpy(name0,mountpt);
+ strcat(name0,"/x");
+
+ strcpy(name1,mountpt);
+ strcat(name1,"/y");
+
+ dump_dev_stats(dev,"start");
+ create_file_of_size(name0,32 * 1024 * 1024);
+ dump_dev_stats(dev,"32MB written");
+ for(i = 0; i < 20; i++)
+ create_file_of_size(name1,1024 * 1024);
+ dump_dev_stats(dev,"20x 1MB files written");
+
+}
+
+void link_follow_test(const char *mountpt)
+{
+ char fn[100];
+ char sn[100];
+ char hn[100];
+ int result;
+ int h;