A Diagnostic Tool for FUSE Modules Final Report
Total Page:16
File Type:pdf, Size:1020Kb
University of St Andrews Senior Honours Project A Diagnostic Tool for FUSE Modules Final Report Matthew Dooler April 2014 Supervisor: Dr. Graham Kirby 0.1 Abstract Filesystems provide the mechanisms for retrieval and storage of information on a computer, often organising files using a hierarchical naming scheme. Filesystems generally abstract over local physical media while others access information over the network. FUSE (Filesystem in Userspace) is a framework allowing filesystems to be implemented in user space, avoiding modification of the kernel by developers and users. This project presents a software diagnostic tool that facilitates de- velopment of FUSE filesystems. The tool provides three main facilities: a wizard that interactively guides developers through implementation of a FUSE filesystem from scratch, an automated test suite, and a debugger. i 0.2 Declaration I declare that the material submitted for assessment is my own work except where credit is explicitly given to others by citation or acknowledgement. This work was performed during the current academic year except where otherwise stated. The main text of this project report is 15,850 words long, including project specification and plan. In submitting this project report to the University of St Andrews, I give permission for it to be made available for use in accordance with the regulations of the University Library. I also give permission for the title and abstract to be published and for copies of the report to be made and supplied at cost to any bona fide library or research worker, and to be made available on the World Wide Web. I retain the copyright in this work. ii 0.3 Acknowledgements I wish to express my sincere appreciation to Dr. Graham Kirby for his guidance during practical work and write-up of this project. I am also grateful to Prof Alan Dearle for his advice during the initiation of this project. iii Contents 0.1 Abstract . .i 0.2 Declaration . ii 0.3 Acknowledgements . iii 1 Introduction 1 1.1 Context . .1 1.2 Problem definition . .2 1.2.1 Filesystem development from scratch . .2 1.2.2 Documentation . .3 1.2.3 Testing . .3 1.2.4 Platform independence . .4 1.2.5 Debugging . .5 1.3 Aim .............................................6 1.4 Success criteria . .6 1.5 Use cases . .7 1.5.1 Filesystem development from scratch . .7 1.5.2 Debugging on a new platform . .7 1.5.3 Quality assurance of a filesystem . .8 1.6 Report structure . .8 2 Objectives 9 3 Context Survey 11 3.1 User-space filesystems . 11 3.2 FUSE filesystems . 12 3.3 FUSE for Mac OS X . 13 3.4 General purpose debugging . 13 3.5 Filesystem monitoring . 14 3.6 Testing . 15 3.7 Summary . 15 iv 4 Requirements Specification 16 4.1 Preface . 16 4.2 Glossary . 16 4.3 User requirements . 17 4.3.1 General . 17 4.3.2 Wizard . 18 4.3.3 Test suite . 20 4.3.4 Debugger . 22 4.4 System requirements . 23 4.4.1 General . 23 4.4.2 Wizard . 24 4.4.3 Test suite . 24 4.4.4 Debugger . 25 4.5 Domain requirements . 26 5 Software Engineering Process 27 5.1 Methodology . 27 5.2 Version control . 29 5.3 Testing . 29 5.4 Programming conventions . 30 5.5 Debugging . 30 6 Ethics 31 7 Design 32 7.1 Overall architecture . 32 7.2 Application . 33 7.3 Instrumentation . 36 7.4 Simulated invocation . 37 7.5 Inter-process communication . 39 7.6 Controlling execution . 41 8 Implementation 42 8.1 Application . 42 8.2 GUI ............................................. 43 8.3 FUSE user-space library . 44 8.3.1 Compilation . 44 8.3.2 Dynamic linking . 45 8.4 Inter-process communication . 46 v 8.4.1 Pipes . 46 8.4.2 Environment variables . 46 8.4.3 Semaphores . 47 8.5 Wizard . 48 8.5.1 Test execution . 48 8.5.2 Frontend . 49 8.6 Debugger . 51 8.6.1 Call interception . 51 8.6.2 Frontend . 51 8.7 Test suite . 54 8.7.1 Logging test data . 54 8.7.2 Test execution . 55 8.7.3 Frontend . 56 8.8 Platform compatibility . 58 8.8.1 Unsupported functions . 58 9 Evaluation 59 9.1 Original objectives . 59 9.2 Emergent objectives . 60 9.3 Requirements . 60 9.3.1 User requirements . 60 9.3.2 System requirements . 62 9.3.3 Domain requirements . 63 9.4 Related work . 64 9.4.1 Filesystem debugging . 64 9.4.2 Filesystem monitoring . 64 9.4.3 Filesystem testing . 65 9.5 Summary . 65 10 Conclusion 66 10.1 Achievements . 66 10.1.1 C Programming & FUSE . 66 10.1.2 Extensible test suite . ..