Compare commits
320 Commits
v1.0
...
18e1407254
| Author | SHA1 | Date | |
|---|---|---|---|
|
18e1407254
|
|||
|
e0c6be3270
|
|||
|
43de918fa3
|
|||
|
c775ba686b
|
|||
|
eaba782ca6
|
|||
|
47b5b147b6
|
|||
|
06f7346533
|
|||
|
569ee2b898
|
|||
|
ba991c0639
|
|||
|
5a9c7b84ee
|
|||
|
59da5d3763
|
|||
|
7b0e79d45b
|
|||
|
81f30926a2
|
|||
|
f4f688acb6
|
|||
|
eade35bd98
|
|||
|
c491750494
|
|||
|
c10739b8df
|
|||
|
c1441d9f5e
|
|||
|
91bd98db62
|
|||
|
241c583c54
|
|||
|
bca506ddcc
|
|||
|
ee42a0ca0b
|
|||
|
c205b2fcd0
|
|||
| c78bbcb632 | |||
| 4d33831978 | |||
| 4d7ccd2d86 | |||
| da7af918c6 | |||
| e52ece5aed | |||
| 7bdefb6849 | |||
| 67f1be840f | |||
| 3b7404de43 | |||
| 6598520c0a | |||
| 355015fb64 | |||
| 2fd5c20a7c | |||
| 18b3203257 | |||
| f33b4bac22 | |||
| 4489537b4d | |||
| d35ae687b0 | |||
| 625756f338 | |||
| 43ebf3ee81 | |||
| eb43273e9b | |||
| cd150a6f5b | |||
| 86267cce9f | |||
| c148b70b55 | |||
| f2e8c508de | |||
| c422a86bfd | |||
| bd7cf9c922 | |||
| b516f2f07f | |||
| 54155b1fe5 | |||
| c5d7b19752 | |||
| 28cf14cf00 | |||
| 5929eac85c | |||
| 2ecdba92a5 | |||
| f92b930acb | |||
| df44da9f33 | |||
| 973716ff35 | |||
| 743e746e0f | |||
| d296f15652 | |||
| 8421e1ef03 | |||
| 5e80a59058 | |||
| cd31e27e97 | |||
| f9ed535c4a | |||
| e17dfe9c3a | |||
| 73b246c7df | |||
| 1dd929aad5 | |||
| 0c38fd7345 | |||
| 33d40df4bd | |||
| dc73349a4d | |||
| 8d1657a409 | |||
| 0dc0225dfa | |||
| d625021c2e | |||
| 25d153e037 | |||
| 039fa7bedf | |||
| b94ef2acec | |||
| 4e07ba50bd | |||
| 63b3a5772a | |||
| 1cbd5acab0 | |||
| f7f982fec5 | |||
| d04afaac54 | |||
| ea6c1c031b | |||
| 3ae5076cbd | |||
| 0c176e66f7 | |||
| d0f3e28d09 | |||
| f3d5b20327 | |||
| 956112cc01 | |||
| aec09d1565 | |||
| 14aba36c6a | |||
| c34917ca80 | |||
| 198a2dde97 | |||
| 8d060ef375 | |||
| 924e234db1 | |||
| 50704e9b59 | |||
| 67f30a171e | |||
| 9625587fc4 | |||
| 171fe54330 | |||
| 60329bface | |||
| 805bede338 | |||
| 527763e87f | |||
| 8426084e5a | |||
| d11579db30 | |||
| 3a47b20df2 | |||
| a547b0d5b4 | |||
| f89794329c | |||
| 500d060376 | |||
| 453a6efe0b | |||
| a256e1c5af | |||
| 1c774ce50d | |||
| 00882f98ad | |||
| ad0640cedd | |||
| 742ec092eb | |||
| 68229afa84 | |||
| 2c7640fe90 | |||
| d581fd27a2 | |||
| d370ded9b9 | |||
| 226545de58 | |||
| 45c7906d41 | |||
| eef19b80a0 | |||
| 5d5927a88a | |||
| 8adc859223 | |||
| 54f3d3f9b6 | |||
| dd1b18e580 | |||
| 9bd58cb294 | |||
| 3d292cb217 | |||
| c11547a952 | |||
| 385830969c | |||
| e64fd740fe | |||
| 0baca64468 | |||
| 3abdc51043 | |||
| a88b014578 | |||
| f5b34a962c | |||
| 27b697200b | |||
| e63f7376f8 | |||
| c5e0825c6f | |||
| c88c034ca7 | |||
| be0b7b630c | |||
| ff3a5fb498 | |||
| baaa6c3ce8 | |||
| 9272c5cbed | |||
| 191219ad06 | |||
| 42d6ff4a97 | |||
| bbe60745e1 | |||
| 9ae8123433 | |||
| 5a5a99145c | |||
| 6f41ad73d3 | |||
| 4a068792e8 | |||
| 6c120004eb | |||
| 48ceeb6a14 | |||
| 3ad42e270c | |||
| d0d62de3f4 | |||
| da3a78ec4d | |||
| 87f7cae1da | |||
| e25c42f2b2 | |||
| 3c6502a111 | |||
| 9886a0345e | |||
| 85844b86cc | |||
| 89866de85f | |||
| fbd788f05e | |||
| a2798cc2bf | |||
| 436930de71 | |||
| 2aeded20be | |||
| 8a63533137 | |||
| 3fc3c6a689 | |||
| feb61ced7b | |||
| 6509d50ec1 | |||
| b5aaddcb8f | |||
| d3d2faf680 | |||
| 94a56c43c8 | |||
| 69da134956 | |||
| de8598ab83 | |||
| 449ac1a692 | |||
| 39b120f7ca | |||
| 5bd7c4a9c5 | |||
| e08deef9d5 | |||
| 7168566ef5 | |||
| ee8759f6b8 | |||
| e8ca3ba6ea | |||
| 915a344223 | |||
| ea0a5f90e2 | |||
| 3dd7c9cb48 | |||
| 2bed7c124a | |||
| dd7ad77731 | |||
| 584ef57aab | |||
| 5851f5d848 | |||
| 927d6a5103 | |||
| cae6860e4e | |||
| f171fe9286 | |||
| 806c71580f | |||
| d46b81eb3d | |||
| ad558abeb6 | |||
| bcf75bceee | |||
| 52baab2d76 | |||
| c0420987ea | |||
| 2c176715ed | |||
| fe5ccdf425 | |||
| f114944af9 | |||
| 9a7e07986b | |||
| bfcb1b415b | |||
| 1e572faa04 | |||
| f73008f60a | |||
| 07b6275cbb | |||
| 05f557ec80 | |||
| b6db95ffaa | |||
| 748b0aea09 | |||
| f7c9917f7e | |||
| 65e4409c90 | |||
| c4437e1bd3 | |||
| c2b8566e35 | |||
| d71db9211c | |||
| c069e87c6f | |||
| 6ae7c6becc | |||
| d2f99b909f | |||
| 1d9dae0e21 | |||
| 246938d4a6 | |||
| 32b11b35d8 | |||
| 257a3fb542 | |||
| 442fa35c19 | |||
| 610e5d798d | |||
| eaf4e1f510 | |||
| 9424a2ead7 | |||
| a993fad273 | |||
| 614531ed67 | |||
| ce41b30fb1 | |||
| f24f9f2107 | |||
| 6991499e43 | |||
| d38218f0eb | |||
| ae15ac704d | |||
| 96fae94b1f | |||
| 374011986c | |||
| b02831adc5 | |||
| e59918b6df | |||
| 193e5b757e | |||
| 91a9c6f688 | |||
| bd5802e5d7 | |||
| d2899e8db7 | |||
| 8973f65a50 | |||
| 0fce4f435c | |||
| 48423054b0 | |||
| 6a0214b132 | |||
| e99e4aafa8 | |||
| 8c2b6cf028 | |||
| b01a5e80fd | |||
| 41a191eeaa | |||
| 8e5cd0d632 | |||
| 2c6aa6cd37 | |||
| 975d4de90d | |||
| a19eb6db74 | |||
| 0e305034e9 | |||
| 141cefbaf4 | |||
| c499292e2f | |||
| 26076d070c | |||
| 0047919644 | |||
| cf6b481d5e | |||
| a7184af37b | |||
| 61038c2578 | |||
| fe9e25374a | |||
| bae03bc929 | |||
| 6995dffca8 | |||
| 1dcd4fbeb2 | |||
| b8c03bca8d | |||
| add9b80a1a | |||
| 412ecbba63 | |||
| d58694521c | |||
| c422911741 | |||
| 336ffd6453 | |||
| 39df0a979e | |||
| 4cbcf30b7c | |||
| 79211fd31d | |||
| 99a923b11e | |||
| f8e0f1bb3f | |||
| 2f70e05db6 | |||
| b0c58bab78 | |||
| f23860c139 | |||
| ed18399ff6 | |||
| 57e4541190 | |||
| b2b53380f4 | |||
| a1e3b31cd5 | |||
| d9028e9d70 | |||
| fd6bd279ad | |||
| a00c4d9a69 | |||
| d68ea990ca | |||
| c4d44aeb0c | |||
| 32e8a679b5 | |||
| 722715c01f | |||
| 80da913264 | |||
| 88dff29415 | |||
| 62c3cc7f20 | |||
| f0a4dacd87 | |||
| be6e4e687c | |||
| 4d070c6362 | |||
| 957f9c9357 | |||
| d536cc72aa | |||
| 874e5881b7 | |||
| 2ae7e87abc | |||
| 38641ff34b | |||
| aebe801dbf | |||
| c2b4a4fa8a | |||
| b5c261d762 | |||
| 7c51ca0a63 | |||
| 2d2e477ddc | |||
| 9df01a4a48 | |||
| 1faa885cb4 | |||
| 63670e7bce | |||
| 42773e2be5 | |||
| fc8ad04db2 | |||
| 4575da411a | |||
| 9a34d7a78a | |||
| 0ed1a4e306 | |||
| 1d81e2b519 | |||
| 5bef0d4182 | |||
| ca99aee02b | |||
| 1d66db3625 | |||
| a3a77141f3 | |||
| e83e87ecc7 | |||
| bfd6a55f58 | |||
| 96ead7df84 | |||
| 6e6148f701 | |||
| 36d9e77c96 | |||
| 569dd3328b | |||
| d30ffdd3e5 | |||
| ea4c350bcc |
26
.editorconfig
Normal file
26
.editorconfig
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[{**/*.cc,**/*.hpp,**/*.ah,**/*.ah.in,**/*.proto}]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[CMakeLists.txt]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@ -8,6 +8,7 @@
|
|||||||
*.pb.cc
|
*.pb.cc
|
||||||
*.gcda
|
*.gcda
|
||||||
*.pyc
|
*.pyc
|
||||||
|
*.swp
|
||||||
*~
|
*~
|
||||||
Makefile
|
Makefile
|
||||||
build
|
build
|
||||||
@ -53,3 +54,6 @@ debuggers/openocd/src/startup.tcl
|
|||||||
debuggers/openocd/src/startup_tcl.c
|
debuggers/openocd/src/startup_tcl.c
|
||||||
debuggers/openocd/src/target/xscale_debug.h
|
debuggers/openocd/src/target/xscale_debug.h
|
||||||
debuggers/openocd/stamp-h1
|
debuggers/openocd/stamp-h1
|
||||||
|
|
||||||
|
.idea
|
||||||
|
0 prebuilt
|
||||||
|
|||||||
@ -5,12 +5,18 @@ if("${CMAKE_VERSION}" VERSION_GREATER 2.8.3)
|
|||||||
# (makes cmake 2.8.4 and newer)
|
# (makes cmake 2.8.4 and newer)
|
||||||
cmake_policy(SET CMP0017 NEW)
|
cmake_policy(SET CMP0017 NEW)
|
||||||
endif("${CMAKE_VERSION}" VERSION_GREATER 2.8.3)
|
endif("${CMAKE_VERSION}" VERSION_GREATER 2.8.3)
|
||||||
|
if(NOT ("${CMAKE_VERSION}" VERSION_LESS 3.0)) # >= 3.0?
|
||||||
|
# overwrite PROJECT_VERSION when calling PROJECT()
|
||||||
|
cmake_policy(SET CMP0048 NEW)
|
||||||
|
|
||||||
|
PROJECT(FAIL* VERSION 1.0.1)
|
||||||
|
else()
|
||||||
|
PROJECT(FAIL*)
|
||||||
|
set(PROJECT_VERSION "1.0.1" CACHE INTERNAL "FAIL* version number" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
ENABLE_TESTING()
|
ENABLE_TESTING()
|
||||||
|
|
||||||
PROJECT(Fail*)
|
|
||||||
|
|
||||||
set(PROJECT_VERSION "1.0" CACHE STRING "Fail* version number")
|
|
||||||
|
|
||||||
#### Put all resulting library files in <your_build_dir>/lib ####
|
#### Put all resulting library files in <your_build_dir>/lib ####
|
||||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
|
||||||
@ -31,6 +37,7 @@ ENDIF (EXECUTABLE_OUTPUT_PATH)
|
|||||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
#### Compiler configuration, see cmake/compilerconfig.cmake
|
#### Compiler configuration, see cmake/compilerconfig.cmake
|
||||||
|
include(BuildType)
|
||||||
include(compilerconfig)
|
include(compilerconfig)
|
||||||
include(doxygen)
|
include(doxygen)
|
||||||
|
|
||||||
@ -45,7 +52,7 @@ OPTION( BUILD_X86 "Build for x86 guests?" ON)
|
|||||||
OPTION( BUILD_ARM "Build for ARM guests?" OFF)
|
OPTION( BUILD_ARM "Build for ARM guests?" OFF)
|
||||||
|
|
||||||
# FIXME: only add simulators/ to include_directories, and include, e.g.,
|
# FIXME: only add simulators/ to include_directories, and include, e.g.,
|
||||||
# bochs/bochs.h in Fail*. -> avoids naming conflicts (e.g., /usr/include/elf.h
|
# bochs/bochs.h in FAIL*. -> avoids naming conflicts (e.g., /usr/include/elf.h
|
||||||
# vs. qemu/elf.h)
|
# vs. qemu/elf.h)
|
||||||
if(BUILD_BOCHS)
|
if(BUILD_BOCHS)
|
||||||
## add necessary additional header search paths.
|
## add necessary additional header search paths.
|
||||||
@ -64,7 +71,7 @@ elseif(BUILD_PANDA)
|
|||||||
include_directories(debuggers/openocd/src debuggers/openocd/jimtcl src/core)
|
include_directories(debuggers/openocd/src debuggers/openocd/jimtcl src/core)
|
||||||
endif(BUILD_BOCHS)
|
endif(BUILD_BOCHS)
|
||||||
|
|
||||||
## Tell the linker where to find the Fail* libraries
|
## Tell the linker where to find the FAIL* libraries
|
||||||
link_directories("${LIBRARY_OUTPUT_PATH}")
|
link_directories("${LIBRARY_OUTPUT_PATH}")
|
||||||
|
|
||||||
# Add "simulators"-directory to the include path. This allows
|
# Add "simulators"-directory to the include path. This allows
|
||||||
|
|||||||
11
COPYING
11
COPYING
@ -1,18 +1,19 @@
|
|||||||
FAIL* - FAult Injection Leveraged
|
FAIL* - FAult Injection Leveraged
|
||||||
|
|
||||||
Copyright (c) 2011-2014 Horst Schirmeier <horst.schirmeier@tu-dortmund.de>
|
Copyright (c) 2011-2016 Horst Schirmeier <horst.schirmeier@tu-dortmund.de>
|
||||||
Copyright (c) 2011-2013 Adrian Böckenkamp <adrian.boeckenkamp@tu-dortmund.de>
|
Copyright (c) 2011-2013 Adrian Böckenkamp <adrian.boeckenkamp@tu-dortmund.de>
|
||||||
Copyright (c) 2011-2014 Richard Hellwig <richard.hellwig@tu-dortmund.de>
|
Copyright (c) 2011-2014 Richard Hellwig <richard.hellwig@tu-dortmund.de>
|
||||||
Copyright (c) 2011-2014 Martin Hoffmann <hoffmann@cs.fau.de>
|
Copyright (c) 2011-2015 Martin Hoffmann <hoffmann@cs.fau.de>
|
||||||
Copyright (c) 2012-2013 Martin Unzner <martin.unzner@googlemail.com>
|
Copyright (c) 2012-2013 Martin Unzner <martin.unzner@googlemail.com>
|
||||||
Copyright (c) 2013-2014 Christian Dietrich <stettberger@dokucode.de>
|
Copyright (c) 2013-2016 Christian Dietrich <stettberger@dokucode.de>
|
||||||
Copyright (c) 2013-2014 Lars Rademacher <lars.rademacher@udo.edu>
|
Copyright (c) 2013-2014 Lars Rademacher <lars.rademacher@udo.edu>
|
||||||
Copyright (c) 2012-2014 Christoph Borchert <christoph.borchert@tu-dortmund.de>
|
Copyright (c) 2012-2016 Christoph Borchert <christoph.borchert@tu-dortmund.de>
|
||||||
Copyright (c) 2013-2014 Björn Döbel <bjoern.doebel@gmail.com>
|
Copyright (c) 2013-2014 Björn Döbel <bjoern.doebel@gmail.com>
|
||||||
Copyright (c) 2012-2013 Tobias Friemel <tobias.friemel@tu-dortmund.de>
|
Copyright (c) 2012-2013 Tobias Friemel <tobias.friemel@tu-dortmund.de>
|
||||||
Copyright (c) 2013-2014 Michael Lenz <michael.lenz@udo.edu>
|
Copyright (c) 2013-2016 Michael Lenz <michael.lenz@udo.edu>
|
||||||
Copyright (c) 2013-2014 Florian Lukas <florian.lukas@gmail.com>
|
Copyright (c) 2013-2014 Florian Lukas <florian.lukas@gmail.com>
|
||||||
Copyright (c) 2012 Robby Zippel <robby.zippel@informatik.stud.uni-erlangen.de>
|
Copyright (c) 2012 Robby Zippel <robby.zippel@informatik.stud.uni-erlangen.de>
|
||||||
|
Copyright (c) 2015 Hannes Weisbach <hannes.weisbach@tu-dresden.de>
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
128
README.md
128
README.md
@ -1,3 +1,5 @@
|
|||||||
|
Forked from [https://github.com/danceos/fail](https://github.com/danceos/fail).
|
||||||
|
|
||||||
FAIL* - FAult Injection Leveraged
|
FAIL* - FAult Injection Leveraged
|
||||||
=======================================
|
=======================================
|
||||||
|
|
||||||
@ -41,6 +43,9 @@ be manipulated.
|
|||||||
Building FAIL*
|
Building FAIL*
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
**Note:** The Docker images are currently out of date; at the moment, FAIL*
|
||||||
|
needs to be built and installed manually.
|
||||||
|
|
||||||
Since FAIL* is a complex research project with many dependencies,
|
Since FAIL* is a complex research project with many dependencies,
|
||||||
which are listed in `doc/how-to-build.txt`, we provide several
|
which are listed in `doc/how-to-build.txt`, we provide several
|
||||||
[Docker.io](http://www.docker.com) images that contain all
|
[Docker.io](http://www.docker.com) images that contain all
|
||||||
@ -111,7 +116,7 @@ docker instance.
|
|||||||
|
|
||||||
Mailing list
|
Mailing list
|
||||||
------------
|
------------
|
||||||
The Fail* developers, and some of its previous and current users, can be
|
The FAIL* developers, and some of its previous and current users, can be
|
||||||
contacted on the
|
contacted on the
|
||||||
[fail@lists.cs.tu-dortmund.de](mailto:fail@lists.cs.tu-dortmund.de)
|
[fail@lists.cs.tu-dortmund.de](mailto:fail@lists.cs.tu-dortmund.de)
|
||||||
mailing list
|
mailing list
|
||||||
@ -119,6 +124,19 @@ mailing list
|
|||||||
|
|
||||||
Publications about FAIL*
|
Publications about FAIL*
|
||||||
------------------------
|
------------------------
|
||||||
|
Please cite the EDCC paper if you want to refer to FAIL*:
|
||||||
|
|
||||||
|
- H. Schirmeier, M. Hoffmann, C. Dietrich, M. Lenz, D. Lohmann, and O.
|
||||||
|
Spinczyk. FAIL*: An open and versatile fault-injection framework for the
|
||||||
|
assessment of software-implemented hardware fault tolerance. In Proceedings
|
||||||
|
of the 11th European Dependable Computing Conference (EDCC '15), pages
|
||||||
|
245–255. IEEE Computer Society Press, Sept. 2015.
|
||||||
|
[PDF](https://ess.cs.uos.de/danceos/publications/EDCC-2015-Schirmeier.pdf)
|
||||||
|
|
||||||
|
- H. Schirmeier. Efficient Fault-Injection-based Assessment of
|
||||||
|
Software-Implemented Hardware Fault Tolerance. Dissertation, Technische
|
||||||
|
Universität Dortmund, July 2016.
|
||||||
|
[PDF](https://eldorado.tu-dortmund.de/bitstream/2003/35175/1/Dissertation.pdf)
|
||||||
|
|
||||||
- H. Schirmeier, M. Hoffmann, R. Kapitza, D. Lohmann, and
|
- H. Schirmeier, M. Hoffmann, R. Kapitza, D. Lohmann, and
|
||||||
O. Spinczyk. FAIL*: Towards a versatile fault-injection experiment
|
O. Spinczyk. FAIL*: Towards a versatile fault-injection experiment
|
||||||
@ -127,14 +145,66 @@ Publications about FAIL*
|
|||||||
(ARCS '12), Workshop Proceedings, volume 200 of Lecture Notes in
|
(ARCS '12), Workshop Proceedings, volume 200 of Lecture Notes in
|
||||||
Informatics, pages 201–210. German Society of Informatics,
|
Informatics, pages 201–210. German Society of Informatics,
|
||||||
Mar. 2012.
|
Mar. 2012.
|
||||||
[PDF](http://danceos.org/publications/VERFE-2012-Schirmeier.pdf)
|
[PDF](https://ess.cs.uos.de/danceos/publications/VERFE-2012-Schirmeier.pdf)
|
||||||
|
|
||||||
Selected publications using FAIL*
|
Selected publications using FAIL*
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
- M. Hoffmann, P. Ulbrich, C. Dietrich, H. Schirmeier, D. Lohmann, and
|
- O. Pusz, D. Kiechle, C. Dietrich, D. Lohmann. Program-Structure–Guided
|
||||||
W. Schröder-Preikschat. Experiences with software-based soft-error
|
Approximation of Large Fault Spaces. In Proceedings of the 24th IEEE Pacific
|
||||||
mitigation using AN-codes. Software Quality Journal, 2015. (accepted).
|
Rim International Symposium on Dependable Computing (PRDC '19). IEEE Computer
|
||||||
|
Society Press, Dec. 2019.
|
||||||
|
|
||||||
|
- C. Borchert. Aspect-Oriented Technology for Dependable Operating Systems.
|
||||||
|
Dissertation, Technische Universität Dortmund, May 2017.
|
||||||
|
|
||||||
|
- C. Borchert, H. Schirmeier, and O. Spinczyk. Generic soft-error detection and
|
||||||
|
correction for concurrent data structures. IEEE Transactions on Dependable
|
||||||
|
and Secure Computing, 14(1):22–36, Jan. 2017.
|
||||||
|
|
||||||
|
- C. Dietrich, M. Hoffmann, and D. Lohmann. Global optimization of
|
||||||
|
fixed-priority real-time systems by RTOS-aware control-flow analysis. ACM
|
||||||
|
Transactions on Embedded Computing Systems (TECS), 16(2):1–25, Jan. 2017.
|
||||||
|
|
||||||
|
- H. Schirmeier. Efficient Fault-Injection-based Assessment of
|
||||||
|
Software-Implemented Hardware Fault Tolerance. Dissertation, Technische
|
||||||
|
Universität Dortmund, July 2016.
|
||||||
|
|
||||||
|
- M. Hoffmann. Konstruktive Zuverlässigkeit – Eine Methodik für zuverlässige
|
||||||
|
Systemsoftware auf unzuverlässiger Hardware. Dissertation,
|
||||||
|
Friedrich-Alexander-Universität Erlangen-Nürnberg, Apr. 2016.
|
||||||
|
|
||||||
|
- C. Borchert and O. Spinczyk. Hardening an L4 microkernel against soft errors
|
||||||
|
by aspect-oriented programming and whole-program analysis. In Proceedings of
|
||||||
|
the 8th Workshop on Programming Languages and Operating Systems (PLOS '15),
|
||||||
|
pages 1–7, New York, NY, USA, Oct. 2015. ACM Press.
|
||||||
|
|
||||||
|
- T. Stumpf. How to Protect the Protector? In Proceedings of the 45th Annual
|
||||||
|
IEEE/IFIP International Conference on Dependable Systems and Networks (DSN '15),
|
||||||
|
Student Forum. IEEE Computer Society Press, June 2015.
|
||||||
|
|
||||||
|
- C. Dietrich, M. Hoffmann, and D. Lohmann. Cross-kernel control-flow-graph
|
||||||
|
analysis for event-driven real-time systems. In Proceedings of the 2015 ACM
|
||||||
|
SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded
|
||||||
|
Systems (LCTES '15), New York, NY, USA, June 2015. ACM Press.
|
||||||
|
|
||||||
|
- H. Schirmeier, C. Borchert, and O. Spinczyk. Avoiding pitfalls in
|
||||||
|
fault-injection based comparison of program susceptibility to soft errors. In
|
||||||
|
Proceedings of the 45th IEEE/IFIP International Conference on Dependable
|
||||||
|
Systems and Networks (DSN '15). IEEE Computer Society Press, June 2015.
|
||||||
|
|
||||||
|
- M. Hoffmann, F. Lukas, C. Dietrich, and D. Lohmann. dOSEK: The design and
|
||||||
|
implementation of a dependability-oriented static embedded kernel. In
|
||||||
|
Proceedings of the 21st IEEE Real-Time and Embedded Technology and
|
||||||
|
Applications (RTAS '15), Los Alamitos, CA, USA, Apr. 2015. IEEE Computer
|
||||||
|
Society Press.
|
||||||
|
|
||||||
|
- Christian Dietrich and Daniel Lohmann. The dataref versuchung. ACM Operating
|
||||||
|
Systems Review, pages 1–10, 2015.
|
||||||
|
|
||||||
|
- M. Hoffmann, P. Ulbrich, C. Dietrich, H. Schirmeier, D. Lohmann, and W.
|
||||||
|
Schröder-Preikschat. Experiences with software-based soft-error mitigation
|
||||||
|
using AN codes. Software Quality Journal, pages 1–27, 2015.
|
||||||
|
|
||||||
- I. Stilkerich, P. Taffner, C. Erhardt, C. Dietrich, C. Wawersich, and
|
- I. Stilkerich, P. Taffner, C. Erhardt, C. Dietrich, C. Wawersich, and
|
||||||
M. Stilkerich. Team Up: Cooperative Memory Management in Embedded
|
M. Stilkerich. Team Up: Cooperative Memory Management in Embedded
|
||||||
@ -142,30 +212,34 @@ Selected publications using FAIL*
|
|||||||
Architectures and Synthesis for Embedded Systems (CASES '14). ACM,
|
Architectures and Synthesis for Embedded Systems (CASES '14). ACM,
|
||||||
October 2014.
|
October 2014.
|
||||||
|
|
||||||
- H. Schirmeier, C. Borchert, and O. Spinczyk. Rapid fault-space
|
- H. Schirmeier, C. Borchert, and O. Spinczyk. Rapid fault-space exploration by
|
||||||
exploration by evolutionary pruning. In Proceedings of the 33rd
|
evolutionary pruning. In Proceedings of the 33rd International Conference on
|
||||||
International Conference on Computer Safety, Reliability and
|
Computer Safety, Reliability and Security (SAFECOMP '14), Lecture Notes in
|
||||||
Security (SAFECOMP '14), Lecture Notes in Computer
|
Computer Science, pages 17–32. Springer-Verlag, Sept. 2014.
|
||||||
Science. Springer-Verlag, Sept. 2014.
|
|
||||||
|
|
||||||
- M. Hoffmann, C. Borchert, C. Dietrich, H. Schirmeier, R. Kapitza,
|
- Björn Döbel. Operating System Support for Redundant Multithreading.
|
||||||
O. Spinczyk, and D. Lohmann. Effectiveness of fault detection
|
Dissertation, Technische Universität Dresden, August 2014.
|
||||||
mechanisms in static and dynamic operating system designs. In
|
|
||||||
Proceedings of the 17th IEEE International Symposium on
|
|
||||||
Object-Oriented Real-Time Distributed Computing (ISORC '14). IEEE
|
|
||||||
Computer Society Press, June 2014.
|
|
||||||
|
|
||||||
- H. Schirmeier, L. Rademacher, and O. Spinczyk. Smart-hopping: Highly
|
- Peter Ulbrich. Ganzheitliche Fehlertoleranz in eingebetteten
|
||||||
efficient ISA-level fault injection on real hardware. In Proceedings
|
Softwaresystemen. Dissertation, Friedrich-Alexander-Universität
|
||||||
of the 19th IEEE European Test Symposium (ETS '14). IEEE Computer
|
Erlangen-Nürnberg, August 2014.
|
||||||
Society Press, May 2014.
|
|
||||||
|
|
||||||
- M. Hoffmann, P. Ulbrich, C. Dietrich, H. Schirmeier, D. Lohmann, and
|
- M. Hoffmann, C. Borchert, C. Dietrich, H. Schirmeier, R. Kapitza, O.
|
||||||
W. Schröder-Preikschat. A practitioner's guide to software-based
|
Spinczyk, and D. Lohmann. Effectiveness of fault detection mechanisms in
|
||||||
soft-error mitigation using AN-codes. In Proceedings of the 15th
|
static and dynamic operating system designs. In Proceedings of the 17th IEEE
|
||||||
IEEE International Symposium on High Assurance Systems Engineering
|
International Symposium on Object-Oriented Real-Time Distributed Computing
|
||||||
(HASE '14), Miami, Florida, USA, Jan. 2014. IEEE Computer Society
|
(ISORC '14), pages 230–237. IEEE Computer Society Press, June 2014.
|
||||||
Press.
|
|
||||||
|
- H. Schirmeier, L. Rademacher, and O. Spinczyk. Smart-hopping: Highly efficient
|
||||||
|
ISA-level fault injection on real hardware. In Proceedings of the 19th IEEE
|
||||||
|
European Test Symposium (ETS '14), pages 69–74. IEEE Computer Society Press,
|
||||||
|
May 2014.
|
||||||
|
|
||||||
|
- M. Hoffmann, P. Ulbrich, C. Dietrich, H. Schirmeier, D. Lohmann, and W.
|
||||||
|
Schröder-Preikschat. A practitioner's guide to software-based soft-error
|
||||||
|
mitigation using AN-codes. In Proceedings of the 15th IEEE International
|
||||||
|
Symposium on High Assurance Systems Engineering (HASE '14), pages 33–40,
|
||||||
|
Miami, Florida, USA, Jan. 2014. IEEE Computer Society Press.
|
||||||
|
|
||||||
- C. Borchert, H. Schirmeier, and O. Spinczyk. Return-address
|
- C. Borchert, H. Schirmeier, and O. Spinczyk. Return-address
|
||||||
protection in C/C++ code by dependability aspects. In Proceedings of
|
protection in C/C++ code by dependability aspects. In Proceedings of
|
||||||
@ -187,7 +261,7 @@ Selected publications using FAIL*
|
|||||||
|
|
||||||
- C. Borchert, H. Schirmeier, and O. Spinczyk. Generative
|
- C. Borchert, H. Schirmeier, and O. Spinczyk. Generative
|
||||||
software-based memory error detection and correction for operating
|
software-based memory error detection and correction for operating
|
||||||
system data structures. In Proceedings of the 43nd IEEE/IFIP
|
system data structures. In Proceedings of the 43rd IEEE/IFIP
|
||||||
International Conference on Dependable Systems and Networks (DSN
|
International Conference on Dependable Systems and Networks (DSN
|
||||||
'13). IEEE Computer Society Press, June 2013.
|
'13). IEEE Computer Society Press, June 2013.
|
||||||
|
|
||||||
|
|||||||
9
cmake/BuildType.cmake
Normal file
9
cmake/BuildType.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Set a default build type if none was specified
|
||||||
|
set(default_build_type "Release")
|
||||||
|
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||||
|
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the build type." FORCE)
|
||||||
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||||
|
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
|
endif()
|
||||||
33
cmake/FindCapstone.cmake
Normal file
33
cmake/FindCapstone.cmake
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# - Try to find CAPSTONE
|
||||||
|
# Once done, this will define
|
||||||
|
#
|
||||||
|
# CAPSTONE_FOUND - system has CAPSTONE
|
||||||
|
# CAPSTONE_INCLUDE_DIRS - the CAPSTONE include directories
|
||||||
|
# CAPSTONE_LIBRARIES - link these to use CAPSTONE
|
||||||
|
|
||||||
|
include(LibFindMacros)
|
||||||
|
message(STATUS "[FAIL*] looking for Capstone library")
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
# libfind_package(CAPSTONE capstone)
|
||||||
|
|
||||||
|
# Use pkg-config to get hints about paths
|
||||||
|
# libfind_pkg_check_modules(CAPSTONE_PKGCONF capstone)
|
||||||
|
|
||||||
|
# Include dir
|
||||||
|
find_path(CAPSTONE_INCLUDE_DIR
|
||||||
|
NAMES capstone/capstone.h
|
||||||
|
PATHS ${CAPSTONE_PKGCONF_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Finally the library itself
|
||||||
|
find_library(CAPSTONE_LIBRARY
|
||||||
|
NAMES capstone
|
||||||
|
PATHS ${CAPSTONE_PKGCONF_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||||
|
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||||
|
set(CAPSTONE_PROCESS_INCLUDES CAPSTONE_INCLUDE_DIR CAPSTONE_INCLUDE_DIRS)
|
||||||
|
set(CAPSTONE_PROCESS_LIBS CAPSTONE_LIBRARY CAPSTONE_LIBRARIES)
|
||||||
|
libfind_process(CAPSTONE)
|
||||||
@ -1,9 +1,9 @@
|
|||||||
find_program(LLVMCONFIG NAMES llvm-config llvm-config-3.4 llvm-config-3.3 llvm-config-3.2 llvm-config-3.1)
|
find_program(LLVMCONFIG NAMES llvm-config-8 llvm-config-7 llvm-config-6.0 llvm-config-5.0 llvm-config-4.0 llvm-config-3.9 llvm-config)
|
||||||
|
|
||||||
if( NOT LLVMCONFIG )
|
if( NOT LLVMCONFIG )
|
||||||
message(FATAL_ERROR "llvm-config not found, try installing llvm-dev llvm")
|
message(FATAL_ERROR "llvm-config not found, try installing llvm-dev llvm")
|
||||||
else()
|
else()
|
||||||
message(STATUS "[Fail*] LLVM Disassembler: Found llvm-config @ ${LLVMCONFIG}")
|
message(STATUS "[FAIL*] LLVM Disassembler: Found llvm-config @ ${LLVMCONFIG}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# examine LLVM include directory
|
# examine LLVM include directory
|
||||||
|
|||||||
@ -18,12 +18,16 @@ endif (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS)
|
|||||||
|
|
||||||
find_path (DWARF_INCLUDE_DIR
|
find_path (DWARF_INCLUDE_DIR
|
||||||
NAMES
|
NAMES
|
||||||
dwarf.h
|
libdwarf.h
|
||||||
PATHS
|
PATHS
|
||||||
/usr/include
|
/usr/include
|
||||||
|
/usr/include/libdwarf
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
|
/usr/local/include/libdwarf
|
||||||
/opt/local/include
|
/opt/local/include
|
||||||
|
/opt/local/include/libdwarf
|
||||||
/sw/include
|
/sw/include
|
||||||
|
/sw/include/libdwarf
|
||||||
ENV CPATH) # PATH and INCLUDE will also work
|
ENV CPATH) # PATH and INCLUDE will also work
|
||||||
#find_path (LIBDW_INCLUDE_DIR
|
#find_path (LIBDW_INCLUDE_DIR
|
||||||
# NAMES
|
# NAMES
|
||||||
|
|||||||
@ -6,10 +6,10 @@
|
|||||||
# LIBUDIS86_LIBRARIES - Link these to use libudis86
|
# LIBUDIS86_LIBRARIES - Link these to use libudis86
|
||||||
# LIBUDIS86_DEFINITIONS - Compiler switches required for using libudis86
|
# LIBUDIS86_DEFINITIONS - Compiler switches required for using libudis86
|
||||||
|
|
||||||
FIND_PATH(LIBUDIS86_INCLUDE_DIRS udis86.h)
|
FIND_PATH(LIBUDIS86_INCLUDE_DIRS udis86.h PATHS ${LIBUDIS86_PREFIX_DIR}/include)
|
||||||
|
|
||||||
FIND_LIBRARY(LIBUDIS86_LIBRARIES NAMES udis86
|
FIND_LIBRARY(LIBUDIS86_LIBRARIES NAMES udis86
|
||||||
PATHS /usr/lib /usr/local/lib /opt/local/lib
|
PATHS /usr/lib /usr/local/lib /opt/local/lib ${LIBUDIS86_PREFIX_DIR}/lib
|
||||||
ENV LIBRARY_PATH # PATH and LIB will also work
|
ENV LIBRARY_PATH # PATH and LIB will also work
|
||||||
ENV LD_LIBRARY_PATH)
|
ENV LD_LIBRARY_PATH)
|
||||||
|
|
||||||
|
|||||||
@ -1,24 +1,26 @@
|
|||||||
# Find the MySQL includes and client library
|
# Find the MySQL includes and client library
|
||||||
# This module defines
|
# This module defines
|
||||||
# MYSQL_INCLUDE_DIR, where to find mysql.h
|
# MYSQL_CFLAGS, contain compiler -I parameters with MySQL/MariaDB headers
|
||||||
# MYSQL_LIBRARIES, the libraries needed to use MySQL.
|
# MYSQL_LIBRARIES, the libraries needed to use MySQL.
|
||||||
# MYSQL_FOUND, If false, do not try to use MySQL.
|
# MYSQL_FOUND, If false, do not try to use MySQL.
|
||||||
|
|
||||||
set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH
|
set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH
|
||||||
"preferred path to MySQL (mysql_config)")
|
"preferred path to MySQL (mysql_config)")
|
||||||
find_program(MYSQL_CONFIG mysql_config
|
find_program(MYSQL_CONFIG
|
||||||
|
NAMES mysql_config mariadb_config
|
||||||
${MYSQL_CONFIG_PREFER_PATH}
|
${MYSQL_CONFIG_PREFER_PATH}
|
||||||
/usr/local/mysql/bin/
|
/usr/local/mysql/bin/
|
||||||
|
/usr/local/mariadb/bin/
|
||||||
/usr/local/bin/
|
/usr/local/bin/
|
||||||
/usr/bin/
|
/usr/bin/
|
||||||
)
|
)
|
||||||
|
|
||||||
if(MYSQL_CONFIG)
|
if(MYSQL_CONFIG)
|
||||||
message(STATUS "Using mysql_config: ${MYSQL_CONFIG}")
|
message(STATUS "Using mysql_config: ${MYSQL_CONFIG}")
|
||||||
# set INCLUDE_DIR
|
# set MYSQL_CFLAGS
|
||||||
exec_program(${MYSQL_CONFIG}
|
exec_program(${MYSQL_CONFIG}
|
||||||
ARGS --include
|
ARGS --cflags
|
||||||
OUTPUT_VARIABLE MYSQL_INCLUDE_DIR)
|
OUTPUT_VARIABLE MYSQL_CFLAGS)
|
||||||
|
|
||||||
# set LIBRARY_DIR
|
# set LIBRARY_DIR
|
||||||
exec_program(${MYSQL_CONFIG}
|
exec_program(${MYSQL_CONFIG}
|
||||||
@ -34,6 +36,8 @@ else(MYSQL_CONFIG)
|
|||||||
/usr/local/mysql/include/mysql
|
/usr/local/mysql/include/mysql
|
||||||
/usr/include
|
/usr/include
|
||||||
/usr/include/mysql
|
/usr/include/mysql
|
||||||
|
/usr/include/mariadb
|
||||||
|
)
|
||||||
#find_library(mysqlclient_r ...
|
#find_library(mysqlclient_r ...
|
||||||
# PATHS
|
# PATHS
|
||||||
# ${MYSQL_ADD_LIBRARY_PATH}
|
# ${MYSQL_ADD_LIBRARY_PATH}
|
||||||
@ -42,18 +46,18 @@ else(MYSQL_CONFIG)
|
|||||||
# /usr/local/lib/mysql
|
# /usr/local/lib/mysql
|
||||||
# /usr/local/mysql/lib
|
# /usr/local/mysql/lib
|
||||||
#)
|
#)
|
||||||
)
|
set(MYSQL_CFLAGS "-I${MYSQL_INCLUDE_DIR}")
|
||||||
endif(MYSQL_CONFIG)
|
endif(MYSQL_CONFIG)
|
||||||
|
|
||||||
set(MYSQL_INCLUDE_DIR ${MYSQL_INCLUDE_DIR} CACHE FILEPATH INTERNAL)
|
set(MYSQL_CFLAGS ${MYSQL_CFLAGS} CACHE FILEPATH INTERNAL)
|
||||||
set(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} CACHE FILEPATH INTERNAL)
|
set(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} CACHE FILEPATH INTERNAL)
|
||||||
|
|
||||||
if(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
if(MYSQL_CFLAGS AND MYSQL_LIBRARIES)
|
||||||
set(MYSQL_FOUND TRUE CACHE INTERNAL "MySQL found")
|
set(MYSQL_FOUND TRUE CACHE INTERNAL "MySQL found")
|
||||||
message(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
|
message(STATUS "Found MySQL: ${MYSQL_CFLAGS}, ${MYSQL_LIBRARIES}")
|
||||||
else(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
else(MYSQL_CFLAGS AND MYSQL_LIBRARIES)
|
||||||
set(MYSQL_FOUND FALSE CACHE INTERNAL "MySQL found")
|
set(MYSQL_FOUND FALSE CACHE INTERNAL "MySQL found")
|
||||||
message(STATUS "MySQL not found.")
|
message(STATUS "MySQL not found.")
|
||||||
endif(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
endif(MYSQL_CFLAGS AND MYSQL_LIBRARIES)
|
||||||
|
|
||||||
mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES)
|
mark_as_advanced(MYSQL_CFLAGS MYSQL_LIBRARIES)
|
||||||
|
|||||||
99
cmake/LibFindMacros.cmake
Normal file
99
cmake/LibFindMacros.cmake
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
|
||||||
|
# used for the current package. For this to work, the first parameter must be the
|
||||||
|
# prefix of the current package, then the prefix of the new package etc, which are
|
||||||
|
# passed to find_package.
|
||||||
|
macro (libfind_package PREFIX)
|
||||||
|
set (LIBFIND_PACKAGE_ARGS ${ARGN})
|
||||||
|
if (${PREFIX}_FIND_QUIETLY)
|
||||||
|
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
|
||||||
|
endif (${PREFIX}_FIND_QUIETLY)
|
||||||
|
if (${PREFIX}_FIND_REQUIRED)
|
||||||
|
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
|
||||||
|
endif (${PREFIX}_FIND_REQUIRED)
|
||||||
|
find_package(${LIBFIND_PACKAGE_ARGS})
|
||||||
|
endmacro (libfind_package)
|
||||||
|
|
||||||
|
# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
|
||||||
|
# where they added pkg_check_modules. Consequently I need to support both in my scripts
|
||||||
|
# to avoid those deprecated warnings. Here's a helper that does just that.
|
||||||
|
# Works identically to pkg_check_modules, except that no checks are needed prior to use.
|
||||||
|
macro (libfind_pkg_check_modules PREFIX PKGNAME)
|
||||||
|
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||||
|
include(UsePkgConfig)
|
||||||
|
pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
|
||||||
|
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
if (PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(${PREFIX} ${PKGNAME})
|
||||||
|
endif (PKG_CONFIG_FOUND)
|
||||||
|
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||||
|
endmacro (libfind_pkg_check_modules)
|
||||||
|
|
||||||
|
# Do the final processing once the paths have been detected.
|
||||||
|
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
|
||||||
|
# all the variables, each of which contain one include directory.
|
||||||
|
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
|
||||||
|
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
|
||||||
|
# Also handles errors in case library detection was required, etc.
|
||||||
|
macro (libfind_process PREFIX)
|
||||||
|
# Skip processing if already processed during this run
|
||||||
|
if (NOT ${PREFIX}_FOUND)
|
||||||
|
# Start with the assumption that the library was found
|
||||||
|
set (${PREFIX}_FOUND TRUE)
|
||||||
|
|
||||||
|
# Process all includes and set _FOUND to false if any are missing
|
||||||
|
foreach (i ${${PREFIX}_PROCESS_INCLUDES})
|
||||||
|
if (${i})
|
||||||
|
set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
|
||||||
|
mark_as_advanced(${i})
|
||||||
|
else (${i})
|
||||||
|
set (${PREFIX}_FOUND FALSE)
|
||||||
|
endif (${i})
|
||||||
|
endforeach (i)
|
||||||
|
|
||||||
|
# Process all libraries and set _FOUND to false if any are missing
|
||||||
|
foreach (i ${${PREFIX}_PROCESS_LIBS})
|
||||||
|
if (${i})
|
||||||
|
set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
|
||||||
|
mark_as_advanced(${i})
|
||||||
|
else (${i})
|
||||||
|
set (${PREFIX}_FOUND FALSE)
|
||||||
|
endif (${i})
|
||||||
|
endforeach (i)
|
||||||
|
|
||||||
|
# Print message and/or exit on fatal error
|
||||||
|
if (${PREFIX}_FOUND)
|
||||||
|
if (NOT ${PREFIX}_FIND_QUIETLY)
|
||||||
|
message (STATUS "Found ${PREFIX} include directory: ${${PREFIX}_INCLUDE_DIR}")
|
||||||
|
message (STATUS "Found ${PREFIX} library: ${${PREFIX}_LIBRARY}")
|
||||||
|
endif (NOT ${PREFIX}_FIND_QUIETLY)
|
||||||
|
else (${PREFIX}_FOUND)
|
||||||
|
if (${PREFIX}_FIND_REQUIRED)
|
||||||
|
foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
|
||||||
|
message("${i}=${${i}}")
|
||||||
|
endforeach (i)
|
||||||
|
message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
|
||||||
|
endif (${PREFIX}_FIND_REQUIRED)
|
||||||
|
endif (${PREFIX}_FOUND)
|
||||||
|
endif (NOT ${PREFIX}_FOUND)
|
||||||
|
endmacro (libfind_process)
|
||||||
|
|
||||||
|
macro(libfind_library PREFIX basename)
|
||||||
|
set(TMP "")
|
||||||
|
if(MSVC80)
|
||||||
|
set(TMP -vc80)
|
||||||
|
endif(MSVC80)
|
||||||
|
if(MSVC90)
|
||||||
|
set(TMP -vc90)
|
||||||
|
endif(MSVC90)
|
||||||
|
set(${PREFIX}_LIBNAMES ${basename}${TMP})
|
||||||
|
if(${ARGC} GREATER 2)
|
||||||
|
set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
|
||||||
|
string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
|
||||||
|
set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
|
||||||
|
endif(${ARGC} GREATER 2)
|
||||||
|
find_library(${PREFIX}_LIBRARY
|
||||||
|
NAMES ${${PREFIX}_LIBNAMES}
|
||||||
|
PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
endmacro(libfind_library)
|
||||||
@ -71,15 +71,15 @@ if(BUILD_BOCHS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# FIXME: some libraries still need to be located the "cmake way"
|
# FIXME: some libraries still need to be located the "cmake way"
|
||||||
set(bochs_library_dependencies ${bochs_library_dependencies} -lfontconfig -lrt -lvgagl -pthread)
|
set(bochs_library_dependencies ${bochs_library_dependencies} -lfontconfig -lrt -pthread)
|
||||||
|
|
||||||
|
|
||||||
set(bochs_src_dir ${PROJECT_SOURCE_DIR}/simulators/bochs)
|
set(bochs_src_dir ${PROJECT_SOURCE_DIR}/simulators/bochs)
|
||||||
set(bochs_install_prefix ${bochs_src_dir}/install CACHE STRING "FailBochs installation path")
|
set(bochs_install_prefix ${bochs_src_dir}/install CACHE STRING "FailBochs installation path")
|
||||||
set(bochs_configure_params --enable-a20-pin --enable-x86-64 --enable-cpu-level=6 --enable-ne2000 --enable-acpi --enable-pci --enable-usb --enable-trace-cache --enable-fast-function-calls --enable-host-specific-asms --enable-disasm --enable-readline --enable-clgd54xx --enable-fpu --enable-vmx=2 --enable-monitor-mwait --enable-cdrom --enable-sb16=linux --enable-gdb-stub --disable-docbook --with-all-libs CACHE STRING "Bochs default configure parameters")
|
set(bochs_configure_params --enable-a20-pin --enable-x86-64 --enable-cpu-level=6 --enable-ne2000 --enable-acpi --enable-pci --enable-usb --enable-trace-cache --enable-fast-function-calls --enable-host-specific-asms --enable-disasm --enable-readline --enable-clgd54xx --enable-fpu --enable-vmx=2 --enable-monitor-mwait --enable-cdrom --enable-sb16=linux --enable-gdb-stub --disable-docbook --with-nogui --with-x11 --with-wx --with-sdl CACHE STRING "Bochs configure parameters")
|
||||||
|
|
||||||
## Bochs CXX args for calling make
|
## Bochs CXX args for calling make
|
||||||
set(bochs_build_CXX CXX=ag++\ -p\ ${PROJECT_SOURCE_DIR}/src\ -p\ ${PROJECT_SOURCE_DIR}/simulators\ -p\ ${PROJECT_SOURCE_DIR}/debuggers\ -p\ ${PROJECT_SOURCE_DIR}/tools\ -p\ ${PROJECT_BINARY_DIR}/src\ -I${PROJECT_SOURCE_DIR}/src/core\ -I${CMAKE_BINARY_DIR}/src/core\ ${CMAKE_AGPP_FLAGS}\ --Xcompiler)
|
set(bochs_build_CXX CXX=${AGXX}\ -p\ ${PROJECT_SOURCE_DIR}/src\ -p\ ${PROJECT_SOURCE_DIR}/simulators\ -p\ ${PROJECT_SOURCE_DIR}/debuggers\ -p\ ${PROJECT_SOURCE_DIR}/tools\ -p\ ${PROJECT_BINARY_DIR}/src\ -I${PROJECT_SOURCE_DIR}/src/core\ -I${CMAKE_BINARY_DIR}/src/core\ ${CMAKE_AGPP_FLAGS}\ --Xcompiler\ -std=gnu++11\ -Wno-narrowing)
|
||||||
## Bochs libtool command.
|
## Bochs libtool command.
|
||||||
set(bochs_build_LIBTOOL LIBTOOL=/bin/sh\ ./libtool\ --tag=CXX)
|
set(bochs_build_LIBTOOL LIBTOOL=/bin/sh\ ./libtool\ --tag=CXX)
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,10 @@
|
|||||||
|
#### C++14 ####
|
||||||
|
# We need at least C++11, as some library headers begin to require it. C++14
|
||||||
|
# has already aged sufficiently to mandate it here.
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
##### Verbose make ####
|
##### Verbose make ####
|
||||||
option( VERBOSE_MAKE "Verbose Makefile output" OFF) # defaults to OFF
|
option( VERBOSE_MAKE "Verbose Makefile output" OFF) # defaults to OFF
|
||||||
set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE_MAKE})
|
set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE_MAKE})
|
||||||
@ -11,11 +18,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
|
|||||||
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections")
|
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections")
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER "gcc")
|
set(CMAKE_C_COMPILER "gcc")
|
||||||
set(CMAKE_CXX_COMPILER "ag++")
|
find_program(AGXX ag++ PATHS /usr/bin /usr/local/bin /opt/bin /opt/local/bin ENV PATH)
|
||||||
set(CMAKE_AGPP_FLAGS "--real-instances" CACHE STRING "Additional ag++ flags, e.g. --real-instances --keep_woven")
|
if(${AGXX} MATCHES "NOTFOUND")
|
||||||
|
message(FATAL_ERROR "ag++ not found.")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_CXX_COMPILER "${AGXX}")
|
||||||
|
set(CMAKE_AGPP_FLAGS "-D__NO_MATH_INLINES" CACHE STRING "Additional ag++ flags (space-separated), e.g., --keep_woven")
|
||||||
## Here we add the build dir holding the generated header files (protobuf)
|
## Here we add the build dir holding the generated header files (protobuf)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --Xweaver -p ${PROJECT_SOURCE_DIR}/src -p ${PROJECT_SOURCE_DIR}/simulators -p ${PROJECT_SOURCE_DIR}/debuggers -p ${PROJECT_SOURCE_DIR}/tools -p ${PROJECT_BINARY_DIR}/src ${CMAKE_AGPP_FLAGS} --Xcompiler")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --Xweaver -p ${PROJECT_SOURCE_DIR}/src -p ${PROJECT_SOURCE_DIR}/simulators -p ${PROJECT_SOURCE_DIR}/debuggers -p ${PROJECT_SOURCE_DIR}/tools -p ${PROJECT_BINARY_DIR}/src ${CMAKE_AGPP_FLAGS} --Xcompiler")
|
||||||
|
|
||||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||||
|
|
||||||
message(STATUS "[${PROJECT_NAME}] Compiler: ${CMAKE_C_COMPILER}/${CMAKE_CXX_COMPILER}" )
|
message(STATUS "[${PROJECT_NAME}] Compiler: ${CMAKE_C_COMPILER} + ${CMAKE_CXX_COMPILER}" )
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
### Setup doxygen documentation
|
### Setup doxygen documentation
|
||||||
|
include(CMakeParseArguments) # work around internal FindDoxygen bug
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
if(DOXYGEN_FOUND)
|
if(DOXYGEN_FOUND)
|
||||||
# Using a .in file means we can use CMake to insert project settings
|
# Using a .in file means we can use CMake to insert project settings
|
||||||
@ -13,14 +14,14 @@ set(FAIL_DOC_SOURCE "${FAIL_DOC_SOURCE} ${PROJECT_SOURCE_DIR}/src/plugins")
|
|||||||
set(FAIL_DOC_EXCLUDE_PATTERNS "*/util/pstream.h */util/optionparser/optionparser.h")
|
set(FAIL_DOC_EXCLUDE_PATTERNS "*/util/pstream.h */util/optionparser/optionparser.h")
|
||||||
file(MAKE_DIRECTORY ${FAIL_DOC_OUTPUT})
|
file(MAKE_DIRECTORY ${FAIL_DOC_OUTPUT})
|
||||||
# FIXME: The find command does not quote the paths to be processed by doxygen. That
|
# FIXME: The find command does not quote the paths to be processed by doxygen. That
|
||||||
# means, the path to your Fail* directory should not contain any blanks.
|
# means, the path to your FAIL* directory should not contain any blanks.
|
||||||
|
|
||||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/Doxyfile.in
|
configure_file(${PROJECT_SOURCE_DIR}/cmake/Doxyfile.in
|
||||||
${PROJECT_BINARY_DIR}/Doxyfile @ONLY}
|
${PROJECT_BINARY_DIR}/Doxyfile @ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
## call make doc to generate documentation
|
## call make doc to generate documentation
|
||||||
set(line0 "[${PROJECT_NAME}] Generating Fail* documentation with Doxygen")
|
set(line0 "[${PROJECT_NAME}] Generating FAIL* documentation with Doxygen")
|
||||||
set(line1 " Directories: ${FAIL_DOC_SOURCE}")
|
set(line1 " Directories: ${FAIL_DOC_SOURCE}")
|
||||||
set(line2 " Excluded patterns: ${FAIL_DOC_EXCLUDE_PATTERNS}")
|
set(line2 " Excluded patterns: ${FAIL_DOC_EXCLUDE_PATTERNS}")
|
||||||
add_custom_target(doc
|
add_custom_target(doc
|
||||||
|
|||||||
@ -85,7 +85,7 @@ if(BUILD_GEM5)
|
|||||||
|
|
||||||
# Cleans up everything (gem5 and Fail related):
|
# Cleans up everything (gem5 and Fail related):
|
||||||
add_custom_target(gem5-allclean
|
add_custom_target(gem5-allclean
|
||||||
COMMAND @echo "Cleaning Fail* and gem5 ..."
|
COMMAND @echo "Cleaning FAIL* and gem5 ..."
|
||||||
COMMAND cd "${PROJECT_BINARY_DIR}/" && make clean
|
COMMAND cd "${PROJECT_BINARY_DIR}/" && make clean
|
||||||
COMMAND cd "${gem5_src_dir}/" && scons -c build/ARM
|
COMMAND cd "${gem5_src_dir}/" && scons -c build/ARM
|
||||||
COMMAND cd "${gem5_src_dir}/" && rm -rf build/
|
COMMAND cd "${gem5_src_dir}/" && rm -rf build/
|
||||||
|
|||||||
@ -45,7 +45,7 @@ if(BUILD_PANDA)
|
|||||||
|
|
||||||
# ensure, elf path is set for enabling openocd to read elf symbols
|
# ensure, elf path is set for enabling openocd to read elf symbols
|
||||||
if(EXISTS $ENV{FAIL_ELF_PATH})
|
if(EXISTS $ENV{FAIL_ELF_PATH})
|
||||||
message(STATUS "[Fail*] PandaBoard ELF under test: $ENV{FAIL_ELF_PATH}")
|
message(STATUS "[FAIL*] PandaBoard ELF under test: $ENV{FAIL_ELF_PATH}")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Please set the FAIL_ELF_PATH environment variable to the binary under test.")
|
message(FATAL_ERROR "Please set the FAIL_ELF_PATH environment variable to the binary under test.")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -8,7 +8,7 @@ if [ -z $1 ]; then
|
|||||||
find ${FAILPATH}/src/experiments -maxdepth 1 -mindepth 1 -type d -printf \-\>\ %P\\n | sort
|
find ${FAILPATH}/src/experiments -maxdepth 1 -mindepth 1 -type d -printf \-\>\ %P\\n | sort
|
||||||
else
|
else
|
||||||
|
|
||||||
CONFIG='-DBUILD_BOCHS:BOOL=ON -DBUILD_X86:BOOL=ON -DCONFIG_BOCHS_NO_ABORT:BOOL=ON -DCONFIG_EVENT_BREAKPOINTS:BOOL=ON -DCONFIG_EVENT_BREAKPOINTS_RANGE:BOOL=ON -DCONFIG_EVENT_INTERRUPT:BOOL=ON -DCONFIG_EVENT_IOPORT:BOOL=ON -DCONFIG_EVENT_MEMREAD:BOOL=ON -DCONFIG_EVENT_MEMWRITE:BOOL=ON -DCONFIG_EVENT_TRAP:BOOL=ON -DCONFIG_SR_RESTORE:BOOL=ON -DCONFIG_SR_SAVE:BOOL=ON -Dbochs_configure_params:STRING="--enable-a20-pin;--enable-x86-64;--enable-cpu-level=6;--enable-ne2000;--enable-acpi;--enable-pci;--enable-usb;--enable-trace-cache;--enable-fast-function-calls;--enable-host-specific-asms;--enable-disasm;--enable-readline;--enable-clgd54xx;--enable-fpu;--enable-vmx=2;--enable-monitor-mwait;--enable-cdrom;--enable-sb16=linux;--enable-gdb-stub;--with-nogui" -DEXPERIMENTS_ACTIVATED:STRING='${EXP}' -DBUILD_IMPORT_TRACE:BOOL=ON -DBUILD_PRUNE_TRACE:BOOL=ON -DBUILD_LLVM_DISASSEMBLER=ON'
|
CONFIG='-DBUILD_BOCHS:BOOL=ON -DBUILD_X86:BOOL=ON -DBUILD_GEM5:BOOL=OFF -DBUILD_ARM:BOOL=OFF -DBUILD_SIMULAVR:BOOL=OFF -DBUILD_AVR:BOOL=OFF -DCONFIG_BOCHS_NO_ABORT:BOOL=ON -DCONFIG_EVENT_BREAKPOINTS:BOOL=ON -DCONFIG_EVENT_BREAKPOINTS_RANGE:BOOL=ON -DCONFIG_EVENT_INTERRUPT:BOOL=ON -DCONFIG_EVENT_IOPORT:BOOL=ON -DCONFIG_EVENT_MEMREAD:BOOL=ON -DCONFIG_EVENT_MEMWRITE:BOOL=ON -DCONFIG_EVENT_TRAP:BOOL=ON -DCONFIG_SR_RESTORE:BOOL=ON -DCONFIG_SR_SAVE:BOOL=ON -Dbochs_configure_params:STRING="--enable-a20-pin;--enable-x86-64;--enable-cpu-level=6;--enable-ne2000;--enable-acpi;--enable-pci;--enable-usb;--enable-trace-cache;--enable-fast-function-calls;--enable-host-specific-asms;--enable-disasm;--enable-readline;--enable-clgd54xx;--enable-fpu;--enable-vmx=2;--enable-monitor-mwait;--enable-cdrom;--enable-sb16=linux;--enable-gdb-stub;--with-nogui" -DEXPERIMENTS_ACTIVATED:STRING='${EXP}' -DBUILD_IMPORT_TRACE:BOOL=ON -DBUILD_PRUNE_TRACE:BOOL=ON -DBUILD_LLVM_DISASSEMBLER=ON'
|
||||||
|
|
||||||
if [ -e "${FAILPATH}/src/experiments/${EXP}/config.cmake" ]; then
|
if [ -e "${FAILPATH}/src/experiments/${EXP}/config.cmake" ]; then
|
||||||
CONFIG="-C ${FAILPATH}/src/experiments/${EXP}/config.cmake -DEXPERIMENTS_ACTIVATED:STRING=${EXP}"
|
CONFIG="-C ${FAILPATH}/src/experiments/${EXP}/config.cmake -DEXPERIMENTS_ACTIVATED:STRING=${EXP}"
|
||||||
|
|||||||
@ -326,7 +326,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
init_symbols();
|
init_symbols();
|
||||||
|
|
||||||
LOG << "OpenOCD 0.7.0 for Fail* and Pandaboard initialized" << endl;
|
LOG << "OpenOCD 0.7.0 for FAIL* and Pandaboard initialized" << endl;
|
||||||
|
|
||||||
/* === INITIALIZATION COMPLETE => MAIN LOOP === */
|
/* === INITIALIZATION COMPLETE => MAIN LOOP === */
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
#ifndef __FIRETIMER_AH__
|
|
||||||
#define __FIRETIMER_AH__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
// FIXME: This seems deprecated...?!
|
|
||||||
|
|
||||||
aspect fireTimer {
|
|
||||||
|
|
||||||
advice "bx_pc_system_c" : slice class {
|
|
||||||
public:
|
|
||||||
// TODO: Log-level?
|
|
||||||
void fireTimer(Bit32u timerNum){
|
|
||||||
if(timerNum <= numTimers){
|
|
||||||
if(!timer[timerNum].active){
|
|
||||||
std::cout << "[FAIL] WARNING: The selected timer is actually NOT active!" << std::endl;
|
|
||||||
}
|
|
||||||
currCountdownPeriod = Bit64u(1);
|
|
||||||
timer[timerNum].timeToFire = Bit64u(currCountdownPeriod) + ticksTotal;
|
|
||||||
std::cout << "[FAIL] Timer " << timerNum <<" will fire now!" << std::endl;
|
|
||||||
}else{
|
|
||||||
std::cout << "[FAIL] There are actually only " << numTimers <<" allocated!" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __FIRETIMER_AH__
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
#ifndef __JUMP_TO_PREVIOUS_CTX_AH__
|
|
||||||
#define __JUMP_TO_PREVIOUS_CTX_AH__
|
|
||||||
|
|
||||||
#include "config/FailConfig.hpp"
|
|
||||||
|
|
||||||
// FIXME: What's the purpose of this file/code? Deprecated?
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// #if defined(CONFIG_SR_RESTORE) || defined(CONFIG_SR_REBOOT)
|
|
||||||
|
|
||||||
#include "bochs.h"
|
|
||||||
#include "../SALInst.hpp"
|
|
||||||
|
|
||||||
aspect jumpToPreviousCtx
|
|
||||||
{
|
|
||||||
pointcut end_reset_handler() = "void bx_gui_c::reset_handler(...)";
|
|
||||||
//|| "int bxmain()";
|
|
||||||
|
|
||||||
|
|
||||||
advice execution (end_reset_handler()) : after ()
|
|
||||||
{
|
|
||||||
|
|
||||||
if (fail::restore_bochs_request || fail::reboot_bochs_request )
|
|
||||||
{
|
|
||||||
fail::restore_bochs_request = false;
|
|
||||||
fail::reboot_bochs_request = false;
|
|
||||||
fail::simulator.toPreviousCtx();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CONFIG_SR_RESTORE || CONFIG_SR_REBOOT
|
|
||||||
|
|
||||||
#endif // __JUMP_TO_PREVIOUS_CTX_AH__
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
#ifndef __MEM_ACCESS_BIT_FLIP_AH__
|
|
||||||
#define __MEM_ACCESS_BIT_FLIP_AH__
|
|
||||||
|
|
||||||
#include "config/FailConfig.hpp"
|
|
||||||
|
|
||||||
#ifdef CONFIG_FI_MEM_ACCESS_BITFLIP
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
#include "bochs.h"
|
|
||||||
#include "../../controller/EventList.hpp"
|
|
||||||
#include "../../controller/Event.hpp"
|
|
||||||
|
|
||||||
// FIXME: This is deprecated stuff. Delete this file.
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
// FIXME this code doesn't make any sense for the read_virtual_% functions
|
|
||||||
// (the fault would need to be injected into their *return* value)
|
|
||||||
|
|
||||||
aspect MemAccessBitFlip
|
|
||||||
{
|
|
||||||
pointcut injection_methods()
|
|
||||||
= "% ...::bx_cpu_c::read_virtual_%(...)" || // -> access32/64.cc
|
|
||||||
/*
|
|
||||||
"% ...::bx_cpu_c::read_RMW_virtual_%(...)" || // -> access32.cc
|
|
||||||
"% ...::bx_cpu_c::system_read_%(...)" || // -> access.cc
|
|
||||||
"% ...::bx_cpu_c::v2h_read_byte(...)" || // -> access.cc
|
|
||||||
*/
|
|
||||||
"% ...::bx_cpu_c::write_virtual_%(...)"; // -> access32/64.cc
|
|
||||||
/*
|
|
||||||
"% ...::bx_cpu_c::write_RMW_virtual_%(...)" || // -> access32.cc
|
|
||||||
"% ...::bx_cpu_c::write_new_stack_%(...)" || // -> access32/64.cc
|
|
||||||
"% ...::bx_cpu_c::system_write_%(...)" || // -> access.cc
|
|
||||||
"% ...::bx_cpu_c::v2h_write_byte(...)"; // -> access.cc
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Injects a bitflip each time the guest system requests to write/read
|
|
||||||
// data to/from RAM at the (hardcoded) addresses defined above:
|
|
||||||
//
|
|
||||||
// Event source: "memory write/read access"
|
|
||||||
//
|
|
||||||
advice execution (injection_methods()) : before ()
|
|
||||||
{
|
|
||||||
for(size_t i = 0; i < fi::evbuf.getEventCount(); i++) // check for active events
|
|
||||||
{
|
|
||||||
fi::SimpleBitFlip* pEv = dynamic_cast<fi::SimpleBitFlip*>(fi::evbuf.getEvent(i)); // FIXME: Performance verbessern
|
|
||||||
if(pEv && *(tjp->arg<1>())/*typed!*/ == pEv->getAddress())
|
|
||||||
{
|
|
||||||
cout << " " << tjp->signature() << endl;
|
|
||||||
|
|
||||||
// Get a pointer to the data that should be written to RAM
|
|
||||||
// *before* it is actually written:
|
|
||||||
Bit32u* pData = (Bit32u*)(tjp->arg(JoinPoint::ARGS-1));
|
|
||||||
|
|
||||||
// Flip bit at position pEv->getBitPos():
|
|
||||||
char* ptr = (char*)pData; // For simplification we're just looking at the
|
|
||||||
// first byte of the data
|
|
||||||
ptr[0] = (ptr[0]) ^ (pEv->getMask() << pEv->getBitPos());
|
|
||||||
|
|
||||||
cout << " >>> Bit flipped at index " << pEv->getBitPos()
|
|
||||||
<< " at address 0x" << hex << (*(tjp->arg<1>())) << "!" << endl;
|
|
||||||
fi::evbuf.fireEvent(pEv);
|
|
||||||
// Continue... (maybe more events to process)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
//
|
|
||||||
// Shows the mapping of a virtual address (within eCos) to a *host* address:
|
|
||||||
//
|
|
||||||
if(g_fEnableInjection) // event fired?
|
|
||||||
{
|
|
||||||
g_fEnableInjection = false;
|
|
||||||
const unsigned SEGMENT_SELECTOR_IDX = 2; // always the code segment (seg-base-addr should be zero)
|
|
||||||
const bx_address logicalAddr = MEM_ADDR_TO_INJECT; // offset within the segment ("local eCos address")
|
|
||||||
|
|
||||||
// Get the linear address:
|
|
||||||
Bit32u linearAddr = pThis->get_laddr32(SEGMENT_SELECTOR_IDX/ *seg* /, logicalAddr/ *offset* /);
|
|
||||||
// Map the linear address to the physical address:
|
|
||||||
bx_phy_address physicalAddr;
|
|
||||||
bx_bool fValid = pThis->dbg_xlate_linear2phy(linearAddr, (bx_phy_address*)&physicalAddr);
|
|
||||||
// Determine the *host* address of the physical address:
|
|
||||||
Bit8u* hostAddr = BX_MEM(0)->getHostMemAddr(pThis, physicalAddr, BX_READ);
|
|
||||||
// Now, hostAddr contains the "final" address where we are allowed to inject errors:
|
|
||||||
*(unsigned*)hostAddr = BAD_VALUE; // inject error
|
|
||||||
if(!fValid)
|
|
||||||
printf("[Error]: Could not map logical address to host address.\n");
|
|
||||||
else
|
|
||||||
printf("[Info]: Error injected at logical addr %p (host addr %p).\n", logicalAddr, hostAddr);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CONFIG_FI_MEM_ACCESS_BITFLIP
|
|
||||||
|
|
||||||
#endif // __MEM_ACCESS_BIT_FLIP_AH__
|
|
||||||
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "DataRetrievalExperiment.hpp"
|
|
||||||
#include "../SAL/SALInst.hpp"
|
|
||||||
#include "../controller/Event.hpp"
|
|
||||||
#include "ExperimentDataExample/FaultCoverageExperiment.pb.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace fail;
|
|
||||||
|
|
||||||
#define MEMTEST86_BREAKPOINT 0x4EDC
|
|
||||||
|
|
||||||
bool DataRetrievalExperiment::run()
|
|
||||||
{
|
|
||||||
cout << "[getExperimentDataExperiment] Experiment start." << endl;
|
|
||||||
|
|
||||||
// Breakpoint address for Memtest86:
|
|
||||||
BPSingleEvent mainbp(MEMTEST86_BREAKPOINT);
|
|
||||||
simulator.addEventAndWait(&mainbp);
|
|
||||||
cout << "[getExperimentDataExperiment] Breakpoint reached." << endl;
|
|
||||||
|
|
||||||
FaultCoverageExperimentData* test = NULL;
|
|
||||||
cout << "[getExperimentDataExperiment] Getting ExperimentData (FaultCoverageExperiment)..." << endl;
|
|
||||||
test = simulator.getExperimentData<FaultCoverageExperimentData>();
|
|
||||||
cout << "[getExperimentDataExperiment] Content of ExperimentData (FaultCoverageExperiment):" << endl;
|
|
||||||
|
|
||||||
if (test->has_data_name())
|
|
||||||
cout << "Name: "<< test->data_name() << endl;
|
|
||||||
// m_instrptr1 augeben
|
|
||||||
cout << "m_instrptr1: " << hex << test->m_instrptr1() << endl;
|
|
||||||
// m_instrptr2 augeben
|
|
||||||
cout << "m_instrptr2: " << hex << test->m_instrptr2() << endl;
|
|
||||||
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return true; // experiment successful
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#ifndef __DATA_RETRIEVAL_EXPERIMENT_HPP__
|
|
||||||
#define __DATA_RETRIEVAL_EXPERIMENT_HPP__
|
|
||||||
|
|
||||||
#include "../controller/ExperimentFlow.hpp"
|
|
||||||
|
|
||||||
class DataRetrievalExperiment : public fail::ExperimentFlow
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DataRetrievalExperiment() { }
|
|
||||||
|
|
||||||
bool run();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __DATA_RETRIEVAL_EXPERIMENT_HPP__
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
## Setup desired protobuf descriptions HERE ##
|
|
||||||
set(MY_PROTOS
|
|
||||||
FaultCoverageExperiment.proto
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SRCS
|
|
||||||
example.cc
|
|
||||||
)
|
|
||||||
|
|
||||||
#### PROTOBUFS ####
|
|
||||||
find_package(Protobuf REQUIRED)
|
|
||||||
include_directories(${PROTOBUF_INCLUDE_DIRS})
|
|
||||||
include_directories(${CMAKE_CURRNET_BINARY_DIR})
|
|
||||||
|
|
||||||
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS} )
|
|
||||||
|
|
||||||
## Build library
|
|
||||||
add_library(fcexperimentmessage ${PROTO_SRCS} ${SRCS} )
|
|
||||||
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
message FaultCoverageExperimentData{
|
|
||||||
|
|
||||||
optional string data_name = 1;
|
|
||||||
required int64 m_InstrPtr1 = 2;
|
|
||||||
required int64 m_InstrPtr2 = 3;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
cd $(dirname $0)
|
|
||||||
g++ ../../controller/JobServer.cc ../../controller/ExperimentDataQueue.cc example.cc FaultCoverageExperiment.pb.cc -o ./ExperimentData_example -l protobuf -pthread
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
#include "controller/ExperimentData.hpp"
|
|
||||||
#include "controller/ExperimentDataQueue.hpp"
|
|
||||||
#include "jobserver/JobServer.hpp"
|
|
||||||
#include "FaultCoverageExperiment.pb.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
|
||||||
{
|
|
||||||
// FIXME: Translation missing.
|
|
||||||
|
|
||||||
ExperimentDataQueue exDaQu;
|
|
||||||
ExperimentData* readFromQueue;
|
|
||||||
|
|
||||||
// Daten in Struktur schreiben und in Datei speichern
|
|
||||||
ofstream fileWrite;
|
|
||||||
fileWrite.open("test.txt");
|
|
||||||
|
|
||||||
FaultCoverageExperimentData faultCovExWrite;
|
|
||||||
// Namen setzen
|
|
||||||
faultCovExWrite.set_data_name("Testfall 42");
|
|
||||||
// Instruktionpointer 1
|
|
||||||
faultCovExWrite.set_m_instrptr1(0x4711);
|
|
||||||
// Instruktionpointer 2
|
|
||||||
faultCovExWrite.set_m_instrptr2(0x1122);
|
|
||||||
|
|
||||||
// In ExperimentData verpacken
|
|
||||||
ExperimentData exDaWrite(&faultCovExWrite);
|
|
||||||
// In Queue einbinden
|
|
||||||
exDaQu.addData(&exDaWrite);
|
|
||||||
// Aus Queue holen
|
|
||||||
if (exDaQu.size() != 0)
|
|
||||||
readFromQueue = exDaQu.getData();
|
|
||||||
|
|
||||||
// Serialisierung ueber Wrapper-Methode in ExperimentData
|
|
||||||
readFromQueue->serialize(&fileWrite);
|
|
||||||
// cout << "Ausgabe: " << out << endl;
|
|
||||||
fileWrite.close();
|
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
|
||||||
|
|
||||||
// Daten aus Datei lesen und in Struktur schreiben
|
|
||||||
ifstream fileRead;
|
|
||||||
fileRead.open("test.txt");
|
|
||||||
FaultCoverageExperimentData faultCovExRead;
|
|
||||||
ExperimentData exDaRead(&faultCovExRead);
|
|
||||||
exDaRead.unserialize( &fileRead);
|
|
||||||
|
|
||||||
// Wenn Name, dann ausgeben
|
|
||||||
if(faultCovExRead.has_data_name()){
|
|
||||||
cout << "Name: "<< faultCovExRead.data_name() << endl;
|
|
||||||
}
|
|
||||||
// m_instrptr1 augeben
|
|
||||||
cout << "m_instrptr1: " << faultCovExRead.m_instrptr1() << endl;
|
|
||||||
// m_instrptr2 augeben
|
|
||||||
cout << "m_instrptr2: " << faultCovExRead.m_instrptr2() << endl;
|
|
||||||
fileRead.close();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
#ifndef __JUMP_AND_RUN_EXPERIMENT_HPP__
|
|
||||||
#define __JUMP_AND_RUN_EXPERIMENT_HPP__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "../controller/ExperimentFlow.hpp"
|
|
||||||
#include "../SAL/SALInst.hpp"
|
|
||||||
#include "../SAL/bochs/BochsRegister.hpp"
|
|
||||||
#include "config/FailConfig.hpp"
|
|
||||||
|
|
||||||
// Check if aspect dependencies are satisfied:
|
|
||||||
#if !defined(CONFIG_EVENT_CPULOOP) || !defined(CONFIG_EVENT_JUMP)
|
|
||||||
#error Breakpoint- and jump-events needed! Enable aspects first (see FailConfig.hpp)!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace fail;
|
|
||||||
|
|
||||||
class JumpAndRunExperiment : public fail::ExperimentFlow {
|
|
||||||
public:
|
|
||||||
bool run()
|
|
||||||
{
|
|
||||||
/************************************
|
|
||||||
* Description of experiment flow. *
|
|
||||||
************************************/
|
|
||||||
// Wait for function entry adresss:
|
|
||||||
cout << "[JumpAndRunExperiment] Setting up experiment. Allowing to "
|
|
||||||
<< "start now." << endl;
|
|
||||||
BPEvent mainFuncEntry(0x3c1f);
|
|
||||||
simulator.addEvent(&mainFuncEntry);
|
|
||||||
if (&mainFuncEntry != simulator.waitAny()) {
|
|
||||||
cerr << "[JumpAndRunExperiment] Now, we are completely lost! "
|
|
||||||
<< "It's time to cry! :-(" << endl;
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "[JumpAndRunExperiment] Entry of main function reached! "
|
|
||||||
<< " Let's see who's jumping around here..." << endl;
|
|
||||||
|
|
||||||
const unsigned COUNTER = 20000;
|
|
||||||
unsigned i = 0;
|
|
||||||
BxFlagsReg* pFlags = dynamic_cast<BxFlagsReg*>(simulator.
|
|
||||||
getRegisterManager().getSetOfType(RT_ST).snatch());
|
|
||||||
assert(pFlags != NULL && "FATAL ERROR: NULL ptr not expected!");
|
|
||||||
JumpEvent ev;
|
|
||||||
// Catch the next "counter" jumps:
|
|
||||||
while (++i <= COUNTER) {
|
|
||||||
ev.setWatchInstructionPointer(ANY_INSTR);
|
|
||||||
simulator.addEvent(&ev);
|
|
||||||
if (simulator.waitAny() != &ev) {
|
|
||||||
cerr << "[JumpAndRunExperiment] Damn! Something went "
|
|
||||||
<< "terribly wrong! Who added that event?! :-(" << endl;
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "[JumpAndRunExperiment] Jump detected. Instruction: "
|
|
||||||
<< "0x" hex << ev.getTriggerInstructionPointer()
|
|
||||||
<< " -- FLAGS [CF, ZF, OF, PF, SF] = ["
|
|
||||||
<< pFlags->getCarryFlag() << ", "
|
|
||||||
<< pFlags->getZeroFlag() << ", "
|
|
||||||
<< pFlags->getOverflowFlag() << ", "
|
|
||||||
<< pFlags->getParityFlag() << ", "
|
|
||||||
<< pFlags->getSignFlag() << "]." << endl;
|
|
||||||
}
|
|
||||||
cout << "[JumpAndRunExperiment] " << dec << counter
|
|
||||||
<< " jump(s) detected -- enough for today...exiting! :-)"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __JUMP_AND_RUN_EXPERIMENT_HPP__
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
#ifndef __MEM_WRITE_EXPERIMENT_HPP__
|
|
||||||
#define __MEM_WRITE_EXPERIMENT_HPP__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "../controller/ExperimentFlow.hpp"
|
|
||||||
#include "../SAL/SALInst.hpp"
|
|
||||||
#include "config/FailConfig.hpp"
|
|
||||||
|
|
||||||
// Check aspect dependencies:
|
|
||||||
#if !defined(CONFIG_EVENT_CPULOOP) || !defined(CONFIG_EVENT_MEMACCESS) || !defined(CONFIG_SR_SAVE) || !defined(CONFIG_FI_MEM_ACCESS_BITFLIP)
|
|
||||||
#error Event dependecies not satisfied! Enabled needed aspects in FailConfig.hpp!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace fail;
|
|
||||||
|
|
||||||
class MemWriteExperiment : public fail::ExperimentFlow {
|
|
||||||
public:
|
|
||||||
bool run() // Example experiment (defines "what we wanna do")
|
|
||||||
{
|
|
||||||
/************************************
|
|
||||||
* Description of experiment flow. *
|
|
||||||
************************************/
|
|
||||||
|
|
||||||
// 1. Add some events (set up the experiment):
|
|
||||||
cout << "[MemWriteExperiment] Setting up experiment. Allowing to"
|
|
||||||
<< " start now." << endl;
|
|
||||||
MemWriteEvent mem1(0x000904F0), mem2(0x02ff0916), mem3(0x0050C8E8);
|
|
||||||
BPEvent breakpt(0x4ae6);
|
|
||||||
simulator.addEvent(&mem1);
|
|
||||||
simulator.addEvent(&mem2);
|
|
||||||
simulator.addEvent(&mem3);
|
|
||||||
simulator.addEvent(&breakpt);
|
|
||||||
|
|
||||||
// 2. Wait for event condition "(id1 && id2) || id3" to become true:
|
|
||||||
cout << "[MemWriteExperiment] Waiting for condition (1) (\"(id1 &&"
|
|
||||||
<< " id2) || id3\") to become true..." << endl;
|
|
||||||
bool f1 = false, f2 = false, f3 = false, f4 = false;
|
|
||||||
while (!(f1 || f2 || f3 || f4)) {
|
|
||||||
BPEvent* pev = simulator.waitAny();
|
|
||||||
cout << "[MemWriteExperiment] Received event id=" << id
|
|
||||||
<< "." << endl;
|
|
||||||
if(pev == &mem4)
|
|
||||||
f4 = true;
|
|
||||||
if(pev == &mem3)
|
|
||||||
f3 = true;
|
|
||||||
if(pev == &mem2)
|
|
||||||
f2 = true;
|
|
||||||
if(pev == &mem1)
|
|
||||||
f1 = true;
|
|
||||||
}
|
|
||||||
cout << "[MemWriteExperiment] Condition (1) satisfied! Ready to "
|
|
||||||
<< "add next event..." << endl;
|
|
||||||
// 3. Add a new event now:
|
|
||||||
cout << "[MemWriteExperiment] Adding new Event..."; cout.flush();
|
|
||||||
simulator.clearEvents(); // remove residual events in the buffer
|
|
||||||
// (we're just interested in the new event)
|
|
||||||
simulator.save("./bochs_save_point");
|
|
||||||
cout << "done!" << endl;
|
|
||||||
|
|
||||||
// 4. Continue simulation (waitAny) and inject bitflip:
|
|
||||||
// ...
|
|
||||||
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __MEM_WRITE_EXPERIMENT_HPP__
|
|
||||||
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
#ifndef __MY_EXPERIMENT_HPP__
|
|
||||||
#define __MY_EXPERIMENT_HPP__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "../controller/ExperimentFlow.hpp"
|
|
||||||
#include "../SAL/SALInst.hpp"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace fail;
|
|
||||||
|
|
||||||
class MyExperiment : public fail::ExperimentFlow {
|
|
||||||
public:
|
|
||||||
bool run() // Example experiment (defines "what we wanna do")
|
|
||||||
{
|
|
||||||
/************************************
|
|
||||||
* Description of experiment flow. *
|
|
||||||
************************************/
|
|
||||||
|
|
||||||
// 1. Add some events (set up the experiment):
|
|
||||||
cout << "[MyExperiment] Setting up experiment. Allowing to start"
|
|
||||||
<< " now." << endl;
|
|
||||||
BPEvent ev1(0x8048A00), ev2(0x8048F01), ev3(0x3c1f);
|
|
||||||
simulator.addEvent(&ev1);
|
|
||||||
simulator.addEvent(&ev2);
|
|
||||||
simulator.addEvent(&ev3);
|
|
||||||
|
|
||||||
// 2. Wait for event condition "(id1 && id2) || id3" to become true:
|
|
||||||
BPEvent* pev;
|
|
||||||
cout << "[MyExperiment] Waiting for condition (1) (\"(id1 && id2)"
|
|
||||||
<< " || id3\") to become true..." << endl;
|
|
||||||
bool f1 = false, f2 = false, f3 = false;
|
|
||||||
while (!((f1 && f2) || f3)) {
|
|
||||||
pev = simulator.waitAny();
|
|
||||||
cout << "[MyExperiment] Received event id=" << pev->getId()
|
|
||||||
<< "." << endl;
|
|
||||||
if(pev == &ev3)
|
|
||||||
f3 = true;
|
|
||||||
if(pev == &ev2)
|
|
||||||
f2 = true;
|
|
||||||
if(pev == &ev1)
|
|
||||||
f1 = true;
|
|
||||||
}
|
|
||||||
cout << "[MyExperiment] Condition (1) satisfied! Ready..." << endl;
|
|
||||||
// Remove residual (for all active experiments!)
|
|
||||||
// events in the buffer:
|
|
||||||
simulator.clearEvents();
|
|
||||||
BPEvent foobar(ANY_ADDR);
|
|
||||||
foobar.setCounter(400);
|
|
||||||
cout << "[MyExperiment] Adding breakpoint-event, firing after the"
|
|
||||||
<< " next 400 instructions..."; cout.flush();
|
|
||||||
simulator.addEventAndWait(&foobar);
|
|
||||||
cout << "cought! Exiting now." << endl;
|
|
||||||
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __MY_EXPERIMENT_HPP__
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
#ifndef __SINGLE_STEPPING_EXPERIMENT_HPP__
|
|
||||||
#define __SINGLE_STEPPING_EXPERIMENT_HPP__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "../controller/ExperimentFlow.hpp"
|
|
||||||
#include "../SAL/SALInst.hpp"
|
|
||||||
#include "config/FailConfig.hpp"
|
|
||||||
#include "../SAL/bochs/BochsRegister.hpp"
|
|
||||||
|
|
||||||
// Check if aspect dependency is satisfied:
|
|
||||||
#ifndef CONFIG_EVENT_CPULOOP
|
|
||||||
#error Breakpoint-events needed! Enable aspect first (see FailConfig.hpp)!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace fail;
|
|
||||||
|
|
||||||
#define FUNCTION_ENTRY_ADDRESS 0x3c1f
|
|
||||||
|
|
||||||
class SingleSteppingExperiment : public fail::ExperimentFlow {
|
|
||||||
public:
|
|
||||||
bool run()
|
|
||||||
{
|
|
||||||
/************************************
|
|
||||||
* Description of experiment flow. *
|
|
||||||
************************************/
|
|
||||||
// Wait for function entry adresss:
|
|
||||||
cout << "[SingleSteppingExperiment] Setting up experiment. Allowing"
|
|
||||||
<< " to start now." << endl;
|
|
||||||
BPEvent mainFuncEntry(FUNCTION_ENTRY_ADDRESS);
|
|
||||||
simulator.addEvent(&mainFuncEntry);
|
|
||||||
if (&mainFuncEntry != simulator.waitAny()) {
|
|
||||||
cerr << "[SingleSteppingExperiment] Now, we are completely lost!"
|
|
||||||
<< " It's time to cry! :-(" << endl;
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
cout << "[SingleSteppingExperiment] Entry of main function reached!"
|
|
||||||
<< " Beginning single-stepping..." << endl;
|
|
||||||
char action;
|
|
||||||
while (true) {
|
|
||||||
BPEvent bp(ANY_ADDR);
|
|
||||||
simulator.addEvent(&bp);
|
|
||||||
simulator.waitAny();
|
|
||||||
cout << "0x" << hex
|
|
||||||
<< simulator.getRegisterManager().getInstructionPointer()
|
|
||||||
<< endl;
|
|
||||||
cout << "Continue (y/n)? ";
|
|
||||||
cin >> action; cin.sync(); cin.clear();
|
|
||||||
if (action != 'y')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
simulator.clearEvents(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __SINGLE_STEPPING_EXPERIMENT_HPP__
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
#ifndef __INSTANTIATE_EXPERIMENT_AH__
|
|
||||||
#define __INSTANTIATE_EXPERIMENT_AH__
|
|
||||||
|
|
||||||
// copy this file to a .ah file and instantiate the experiment(s) you need
|
|
||||||
|
|
||||||
#include "hscsimple.hpp"
|
|
||||||
#include "../SAL/SALInst.hpp"
|
|
||||||
|
|
||||||
aspect hscsimple {
|
|
||||||
hscsimpleExperiment experiment;
|
|
||||||
advice execution ("void fail::SimulatorController::initExperiments()") : after () {
|
|
||||||
fail::simulator.addFlow(&experiment);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __INSTANTIATE_EXPERIMENT_AH__
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
## Setup desired protobuf descriptions HERE ##
|
|
||||||
#set(MY_PROTOS
|
|
||||||
# TestData.proto
|
|
||||||
#)
|
|
||||||
|
|
||||||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
|
|
||||||
|
|
||||||
#find_package (LibElf REQUIRED)
|
|
||||||
#find_package (LibDwarf REQUIRED)
|
|
||||||
|
|
||||||
#### PROTOBUFS ####
|
|
||||||
#find_package(Protobuf REQUIRED)
|
|
||||||
#include_directories(${PROTOBUF_INCLUDE_DIRS})
|
|
||||||
include_directories(${CMAKE_BINARY_DIR})
|
|
||||||
include_directories(${CMAKE_CURERNT_BINARY_DIR})
|
|
||||||
|
|
||||||
#PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS} )
|
|
||||||
|
|
||||||
## Build library
|
|
||||||
#add_library(testmessages ${PROTO_SRCS})
|
|
||||||
|
|
||||||
## Add some tests
|
|
||||||
#add_executable(testclient client.cc )
|
|
||||||
#add_executable(testclient testjc.cc )
|
|
||||||
#add_executable(testserver server.cc)
|
|
||||||
#target_link_libraries(testclient fail ${PROTOBUF_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} anexperimentmessage protomessages)
|
|
||||||
#target_link_libraries(testserver fail ${PROTOBUF_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} anexperimentmessage protomessages)
|
|
||||||
|
|
||||||
|
|
||||||
#add_executable(dwarf dwarf.cc)
|
|
||||||
#target_link_libraries(dwarf ${LIBDWARF_LIBRARIES} ${LIBELF_LIBRARIES} )
|
|
||||||
#include_directories(${CMAKE_BINARY_DIR}/core/experiments/MHTestCampaign)
|
|
||||||
#add_executable(mhcampaign mhcampaign.cc)
|
|
||||||
#target_link_libraries(mhcampaign mhtestcampaign fail ${PROTOBUF_LIBRARY} ${Boost_THREAD_LIBRARY})
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
message TestData {
|
|
||||||
optional string foo = 1;
|
|
||||||
optional int64 input = 2;
|
|
||||||
|
|
||||||
optional int64 output = 3;
|
|
||||||
}
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "jobserver/messagedefs/FailControlMessage.pb.h"
|
|
||||||
#include "jobserver/SocketComm.hpp"
|
|
||||||
|
|
||||||
#include "experiments/AnExperiment/AnExperiment.pb.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
void error(const char *s)
|
|
||||||
{
|
|
||||||
perror(s);
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <typename Message>
|
|
||||||
Message *get_job(int sockfd)
|
|
||||||
{
|
|
||||||
Message *msg = new Message;
|
|
||||||
FailControlMessage ctrlmsg;
|
|
||||||
|
|
||||||
ctrlmsg.set_command(FailControlMessage_Command_NEED_WORK);
|
|
||||||
ctrlmsg.set_build_id(42);
|
|
||||||
|
|
||||||
cout << "Sending need work msg: " << ctrlmsg.build_id() << ", Command: " << ctrlmsg.command() << endl;
|
|
||||||
fail::SocketComm::send_msg(sockfd, ctrlmsg);
|
|
||||||
cout << "sent ctrl message." << endl;
|
|
||||||
fail::SocketComm::rcv_msg(sockfd, ctrlmsg);
|
|
||||||
cout << "Received ctrl message: " << ctrlmsg.command() << endl;
|
|
||||||
switch(ctrlmsg.command()){
|
|
||||||
case FailControlMessage_Command_DIE: return 0;
|
|
||||||
case FailControlMessage_Command_WORK_FOLLOWS:
|
|
||||||
fail::SocketComm::rcv_msg(sockfd, *msg);
|
|
||||||
return msg;
|
|
||||||
default:
|
|
||||||
cerr << "wtf?" << endl;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Message>
|
|
||||||
void return_result(int sockfd, Message *msg)
|
|
||||||
{
|
|
||||||
FailControlMessage ctrlmsg;
|
|
||||||
|
|
||||||
ctrlmsg.set_command(FailControlMessage_Command_RESULT_FOLLOWS);
|
|
||||||
ctrlmsg.set_build_id(42);
|
|
||||||
cout << "Sending Result msg: " << ctrlmsg.build_id() << ", Command: " << ctrlmsg.command() << endl;
|
|
||||||
fail::SocketComm::send_msg(sockfd, ctrlmsg);
|
|
||||||
fail::SocketComm::send_msg(sockfd, *msg);
|
|
||||||
delete msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv){
|
|
||||||
int portno;
|
|
||||||
struct hostent *server;
|
|
||||||
|
|
||||||
cout << "JobClient" << endl;
|
|
||||||
|
|
||||||
if (argc < 3) {
|
|
||||||
cerr << "usage: " << argv[0] << " hostname port" << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
portno = atoi(argv[2]);
|
|
||||||
server = gethostbyname(argv[1]);
|
|
||||||
if (server == NULL) {
|
|
||||||
cerr << "cannot resolve host " << argv[1] << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int i = 1;
|
|
||||||
while (1) {
|
|
||||||
int sockfd;
|
|
||||||
struct sockaddr_in serv_addr;
|
|
||||||
cout << ">>>>>>>>>Durchgang " << i++ << endl;
|
|
||||||
sockfd = socket(AF_INET, SOCK_STREAM, 0);
|
|
||||||
if (sockfd < 0) {
|
|
||||||
error("socket()");
|
|
||||||
}
|
|
||||||
memset(&serv_addr, 0, sizeof(serv_addr));
|
|
||||||
serv_addr.sin_family = AF_INET;
|
|
||||||
memcpy(&serv_addr.sin_addr.s_addr, server->h_addr, server->h_length);
|
|
||||||
serv_addr.sin_port = htons(portno);
|
|
||||||
|
|
||||||
if (connect(sockfd, (sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
|
|
||||||
error("connect()");
|
|
||||||
}
|
|
||||||
|
|
||||||
MHTestData *msg = get_job<MHTestData>(sockfd);
|
|
||||||
if(!msg){
|
|
||||||
break;
|
|
||||||
close(sockfd);
|
|
||||||
}
|
|
||||||
cout << "[Minion] received job input: " << msg->input() << endl;
|
|
||||||
cout << "[Minion] Calculating " << msg->input() << "^2 = " << msg->input() * msg->input() << endl;
|
|
||||||
msg->set_output(msg->input() * msg->input());
|
|
||||||
sleep(1);
|
|
||||||
cout << "[Minion] returning result: " << msg->output() << endl;
|
|
||||||
|
|
||||||
return_result<MHTestData>(sockfd, msg);
|
|
||||||
|
|
||||||
close(sockfd);
|
|
||||||
}
|
|
||||||
cout << "ByeBye" << endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,163 +0,0 @@
|
|||||||
/* Code sample: Using libdwarf for getting the address of a function
|
|
||||||
** from DWARF in an ELF executable.
|
|
||||||
** Not much error-handling or resource-freeing is done here...
|
|
||||||
**
|
|
||||||
** Eli Bendersky (http://eli.thegreenplace.net)
|
|
||||||
** This code is in the public domain.
|
|
||||||
*/
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <dwarf.h>
|
|
||||||
#include <libdwarf.h>
|
|
||||||
|
|
||||||
|
|
||||||
void die(char* fmt, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start(args, fmt);
|
|
||||||
vfprintf(stderr, fmt, args);
|
|
||||||
va_end(args);
|
|
||||||
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* List a function if it's in the given DIE.
|
|
||||||
*/
|
|
||||||
void list_func_in_die(Dwarf_Debug dgb, Dwarf_Die the_die)
|
|
||||||
{
|
|
||||||
char* die_name = 0;
|
|
||||||
const char* tag_name = 0;
|
|
||||||
Dwarf_Error err;
|
|
||||||
Dwarf_Half tag;
|
|
||||||
Dwarf_Attribute* attrs;
|
|
||||||
Dwarf_Addr lowpc, highpc;
|
|
||||||
Dwarf_Signed attrcount, i;
|
|
||||||
int rc = dwarf_diename(the_die, &die_name, &err);
|
|
||||||
|
|
||||||
if (rc == DW_DLV_ERROR)
|
|
||||||
die("Error in dwarf_diename\n");
|
|
||||||
else if (rc == DW_DLV_NO_ENTRY)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (dwarf_tag(the_die, &tag, &err) != DW_DLV_OK)
|
|
||||||
die("Error in dwarf_tag\n");
|
|
||||||
|
|
||||||
/* Only interested in subprogram DIEs here */
|
|
||||||
if (tag != DW_TAG_subprogram)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (dwarf_get_TAG_name(tag, &tag_name) != DW_DLV_OK)
|
|
||||||
die("Error in dwarf_get_TAG_name\n");
|
|
||||||
|
|
||||||
printf("DW_TAG_subprogram: '%s'\n", die_name);
|
|
||||||
|
|
||||||
/* Grab the DIEs attributes for display */
|
|
||||||
if (dwarf_attrlist(the_die, &attrs, &attrcount, &err) != DW_DLV_OK)
|
|
||||||
die("Error in dwarf_attlist\n");
|
|
||||||
|
|
||||||
for (i = 0; i < attrcount; ++i) {
|
|
||||||
Dwarf_Half attrcode;
|
|
||||||
if (dwarf_whatattr(attrs[i], &attrcode, &err) != DW_DLV_OK)
|
|
||||||
die("Error in dwarf_whatattr\n");
|
|
||||||
|
|
||||||
/* We only take some of the attributes for display here.
|
|
||||||
** More can be picked with appropriate tag constants.
|
|
||||||
*/
|
|
||||||
if (attrcode == DW_AT_low_pc)
|
|
||||||
dwarf_formaddr(attrs[i], &lowpc, 0);
|
|
||||||
else if (attrcode == DW_AT_high_pc)
|
|
||||||
dwarf_formaddr(attrs[i], &highpc, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("low pc : 0x%08llx\n", lowpc);
|
|
||||||
printf("high pc : 0x%08llx\n", highpc);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* List all the functions from the file represented by the given descriptor.
|
|
||||||
*/
|
|
||||||
void list_funcs_in_file(Dwarf_Debug dbg)
|
|
||||||
{
|
|
||||||
Dwarf_Unsigned cu_header_length, abbrev_offset, next_cu_header;
|
|
||||||
Dwarf_Half version_stamp, address_size;
|
|
||||||
Dwarf_Error err;
|
|
||||||
Dwarf_Die no_die = 0, cu_die, child_die;
|
|
||||||
|
|
||||||
/* Find compilation unit header */
|
|
||||||
while (dwarf_next_cu_header(
|
|
||||||
dbg,
|
|
||||||
&cu_header_length,
|
|
||||||
&version_stamp,
|
|
||||||
&abbrev_offset,
|
|
||||||
&address_size,
|
|
||||||
&next_cu_header,
|
|
||||||
&err) != DW_DLV_ERROR) {
|
|
||||||
|
|
||||||
/* Expect the CU to have a single sibling - a DIE */
|
|
||||||
if (dwarf_siblingof(dbg, no_die, &cu_die, &err) == DW_DLV_ERROR)
|
|
||||||
die("Error getting sibling of CU\n");
|
|
||||||
|
|
||||||
/* Expect the CU DIE to have children */
|
|
||||||
if (dwarf_child(cu_die, &child_die, &err) == DW_DLV_ERROR)
|
|
||||||
die("Error getting child of CU DIE\n");
|
|
||||||
|
|
||||||
/* Now go over all children DIEs */
|
|
||||||
while (1) {
|
|
||||||
int rc;
|
|
||||||
list_func_in_die(dbg, child_die);
|
|
||||||
|
|
||||||
rc = dwarf_siblingof(dbg, child_die, &child_die, &err);
|
|
||||||
|
|
||||||
if (rc == DW_DLV_ERROR)
|
|
||||||
die("Error getting sibling of DIE\n");
|
|
||||||
else if (rc == DW_DLV_NO_ENTRY)
|
|
||||||
break; /* done */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
Dwarf_Debug dbg = 0;
|
|
||||||
Dwarf_Error err;
|
|
||||||
const char* progname;
|
|
||||||
int fd = -1;
|
|
||||||
|
|
||||||
if (argc < 2) {
|
|
||||||
fprintf(stderr, "Expected a program name as argument\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
progname = argv[1];
|
|
||||||
if ((fd = open(progname, O_RDONLY)) < 0) {
|
|
||||||
perror("open");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dwarf_init(fd, DW_DLC_READ, 0, 0, &dbg, &err) != DW_DLV_OK) {
|
|
||||||
fprintf(stderr, "Failed DWARF initialization\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
list_funcs_in_file(dbg);
|
|
||||||
|
|
||||||
if (dwarf_finish(dbg, &err) != DW_DLV_OK) {
|
|
||||||
fprintf(stderr, "Failed DWARF finalization\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
@ -1,62 +0,0 @@
|
|||||||
#include "jobserver/JobServer.hpp"
|
|
||||||
#include <iostream>
|
|
||||||
#include "experiments/AnExperiment.hpp"
|
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
fail::JobServer js;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
static const int nums = 30;
|
|
||||||
|
|
||||||
void exec_js(){
|
|
||||||
js.waitForConnections();
|
|
||||||
cout << "That's it.." << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char**argv){
|
|
||||||
|
|
||||||
|
|
||||||
cout << "Testing Jobserver" << endl;
|
|
||||||
boost::thread th(exec_js);
|
|
||||||
|
|
||||||
AnExperimentData* datas[nums];
|
|
||||||
|
|
||||||
for(int i = 1; i <= nums; i++){
|
|
||||||
datas[i] = new AnExperimentData;
|
|
||||||
datas[i]->setInput(i);
|
|
||||||
js.addExperiment(datas[i]);
|
|
||||||
usleep(100 * 1000); // 100 ms
|
|
||||||
}
|
|
||||||
js.setNoMoreExperiments();
|
|
||||||
|
|
||||||
// test results.
|
|
||||||
int f;
|
|
||||||
int res = 0;
|
|
||||||
int res2 = 0;
|
|
||||||
AnExperimentData * exp;
|
|
||||||
for(int i = 1; i <= nums; i++){
|
|
||||||
exp = static_cast<AnExperimentData*>( js.m_doneJobs.Dequeue() );
|
|
||||||
f = exp->getOutput();
|
|
||||||
// cout << ">>>>>>>>>>>>>>> Output: " << i << "^2 = " << f << endl;
|
|
||||||
res += f;
|
|
||||||
res2 += (i*i);
|
|
||||||
delete exp;
|
|
||||||
}
|
|
||||||
if (res == res2) {
|
|
||||||
cout << "TEST SUCCESSFUL FINISHED! " << "[" << res << "==" << res2 << "]" << endl;
|
|
||||||
}else{
|
|
||||||
cout << "TEST FAILED!" << " [" << res << "!=" << res2 << "]" << endl;
|
|
||||||
}
|
|
||||||
cout << "thats all, waiting for server thread. " << endl;
|
|
||||||
js.done();
|
|
||||||
|
|
||||||
th.join();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
#include "jobserver/JobClient.hpp"
|
|
||||||
|
|
||||||
#include "experiments/AnExperiment.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace fail;
|
|
||||||
int main(int argc, char** argv){
|
|
||||||
|
|
||||||
int portno;
|
|
||||||
JobClient* jc;
|
|
||||||
cout << "JobClient" << endl;
|
|
||||||
if(argc == 1){
|
|
||||||
jc = new JobClient();
|
|
||||||
}else if(argc == 3){
|
|
||||||
portno = atoi(argv[2]);
|
|
||||||
jc = new JobClient(argv[1], portno);
|
|
||||||
}else{
|
|
||||||
cerr << "usage: " << argv[0] << " hostname port" << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AnExperimentData exp;
|
|
||||||
|
|
||||||
while(1){
|
|
||||||
if(jc->getExperimentData(exp)){
|
|
||||||
/// Do some work.
|
|
||||||
cout << "Got data: " << exp.getInput() << endl;
|
|
||||||
int result = exp.getInput() * exp.getInput();
|
|
||||||
usleep(500 * 1000); // 500 ms
|
|
||||||
/// Send back.
|
|
||||||
exp.setOutput(result);
|
|
||||||
jc->sendResult(exp);
|
|
||||||
}else{
|
|
||||||
cout << "No (more) data for me :(" << endl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete jc;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
#include "ExperimentDataQueue.hpp"
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
// FIXME: This is deprecated stuff. Remove it.
|
|
||||||
|
|
||||||
namespace fi
|
|
||||||
{
|
|
||||||
|
|
||||||
void ExperimentDataQueue::addData(ExperimentData* exp)
|
|
||||||
{
|
|
||||||
assert(exp != 0);
|
|
||||||
m_queue.push_front(exp);
|
|
||||||
}
|
|
||||||
|
|
||||||
ExperimentData* ExperimentDataQueue::getData()
|
|
||||||
{
|
|
||||||
ExperimentData* ret = m_queue.back();
|
|
||||||
m_queue.pop_back();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/**
|
|
||||||
* \brief A queue for experiment data.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* \author Martin Hoffmann, Richard Hellwig
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// FIXME: This is deprecated stuff. Remove it.
|
|
||||||
|
|
||||||
#ifndef __EXPERIMENT_DATA_QUEUE_H__
|
|
||||||
#define __EXPERIMENT_DATA_QUEUE_H__
|
|
||||||
|
|
||||||
|
|
||||||
#include <deque>
|
|
||||||
#include "ExperimentData.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
namespace fi{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \class ExperimentDataQueue
|
|
||||||
* Class which manage ExperimentData in a queue.
|
|
||||||
*/
|
|
||||||
class ExperimentDataQueue
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
std::deque<ExperimentData*> m_queue;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ExperimentDataQueue() {}
|
|
||||||
~ExperimentDataQueue() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds ExperimentData to the queue.
|
|
||||||
* @param exp ExperimentData that is to be added to the queue.
|
|
||||||
*/
|
|
||||||
void addData(ExperimentData* exp);
|
|
||||||
/**
|
|
||||||
* Returns an item from the queue
|
|
||||||
* @return the next element of the queue
|
|
||||||
*/
|
|
||||||
ExperimentData* getData();
|
|
||||||
/**
|
|
||||||
* Returns the number of elements in the queue
|
|
||||||
* @return the size of teh queue
|
|
||||||
*/
|
|
||||||
size_t size() const { return m_queue.size(); };
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //__EXPERIMENT_DATA_QUEUE_H__
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
// Author: Adrian Böckenkamp
|
|
||||||
// Date: 15.06.2011
|
|
||||||
|
|
||||||
// FIXME: This is deprecated stuff. Delete it.
|
|
||||||
|
|
||||||
#include "Signal.hpp"
|
|
||||||
|
|
||||||
namespace fi
|
|
||||||
{
|
|
||||||
|
|
||||||
std::auto_ptr<Signal> Signal::m_This;
|
|
||||||
Mutex Signal::m_InstanceMutex;
|
|
||||||
|
|
||||||
|
|
||||||
} // end-of-namespace: fi
|
|
||||||
@ -1,135 +0,0 @@
|
|||||||
#ifndef __SIGNAL_HPP__
|
|
||||||
#define __SIGNAL_HPP__
|
|
||||||
|
|
||||||
// FIXME: This is deprecated stuff. Delete it.
|
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
#include <memory>
|
|
||||||
#include <iostream>
|
|
||||||
#ifndef __puma
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
#include <boost/interprocess/sync/named_semaphore.hpp>
|
|
||||||
|
|
||||||
#include <boost/thread/condition.hpp>
|
|
||||||
#include <boost/thread/mutex.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace fi
|
|
||||||
{
|
|
||||||
|
|
||||||
#ifndef __puma
|
|
||||||
typedef boost::mutex Mutex; // lock/unlock
|
|
||||||
typedef boost::mutex::scoped_lock ScopeLock; // use RAII with lock/unlock mechanism
|
|
||||||
typedef boost::condition_variable ConditionVariable; // wait/notify_one
|
|
||||||
#else
|
|
||||||
typedef int Mutex;
|
|
||||||
typedef int ScopeLock;
|
|
||||||
typedef int ConditionVariable;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Simulate a "private" semaphore using boost-mechanisms:
|
|
||||||
class Semaphore
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
Mutex m_Mutex;
|
|
||||||
ConditionVariable m_CondVar;
|
|
||||||
unsigned long m_Value;
|
|
||||||
public:
|
|
||||||
// Create a semaphore object based on a mutex and a condition variable
|
|
||||||
// and initialize it to value "init".
|
|
||||||
Semaphore(unsigned long init = 0) : m_Value(init) { }
|
|
||||||
|
|
||||||
void post()
|
|
||||||
{
|
|
||||||
ScopeLock lock(m_Mutex);
|
|
||||||
++m_Value; // increase semaphore value:
|
|
||||||
#ifndef __puma
|
|
||||||
m_CondVar.notify_one(); // wake up other thread, currently waiting on condition var.
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void wait()
|
|
||||||
{
|
|
||||||
ScopeLock lock(m_Mutex);
|
|
||||||
#ifndef __puma
|
|
||||||
while(!m_Value) // "wait-if-zero"
|
|
||||||
m_CondVar.wait(lock);
|
|
||||||
#endif
|
|
||||||
--m_Value; // decrease semaphore value
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class Signal
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
static Mutex m_InstanceMutex; // used to sync calls to getInst()
|
|
||||||
static std::auto_ptr<Signal> m_This; // the one and only instance
|
|
||||||
|
|
||||||
Semaphore m_semBochs;
|
|
||||||
Semaphore m_semContr;
|
|
||||||
Semaphore m_semSimCtrl;
|
|
||||||
bool m_Locked; // prevent misuse of thread-sync
|
|
||||||
|
|
||||||
// Singleton class (forbid creation, copying and assignment):
|
|
||||||
Signal()
|
|
||||||
: m_semBochs(0), m_semContr(0),
|
|
||||||
m_semSimCtrl(0), m_Locked(false) { }
|
|
||||||
Signal(Signal const& s)
|
|
||||||
: m_semBochs(), m_semContr(),
|
|
||||||
m_semSimCtrl(), m_Locked(false) { } // never called.
|
|
||||||
Signal& operator=(Signal const&) { return *this; } // dito.
|
|
||||||
~Signal() { }
|
|
||||||
friend class std::auto_ptr<Signal>;
|
|
||||||
public:
|
|
||||||
static Signal& getInst()
|
|
||||||
{
|
|
||||||
ScopeLock lock(m_InstanceMutex); // lock/unlock handled by RAII principle
|
|
||||||
if(!m_This.get())
|
|
||||||
m_This.reset(new Signal());
|
|
||||||
return (*m_This);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called from Experiment-Controller class ("beyond Bochs"):
|
|
||||||
void lockExperiment()
|
|
||||||
{
|
|
||||||
assert(!m_Locked &&
|
|
||||||
"[Signal::lockExperiment]: lockExperiment called twice without calling unlockExperiment() in between.");
|
|
||||||
m_Locked = true;
|
|
||||||
m_semContr.wait(); // suspend experiment process
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called from Experiment-Controller class ("beyond Bochs"):
|
|
||||||
void unlockExperiment()
|
|
||||||
{
|
|
||||||
assert(m_Locked &&
|
|
||||||
"[Signal::unlockExperiment]: unlockExperiment called twice without calling lockExperiment() in between.");
|
|
||||||
m_Locked = false;
|
|
||||||
m_semBochs.post(); // resume experiment (continue bochs simulation)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called from Advice-Code ("within Bochs") to trigger event occurrence:
|
|
||||||
void signalEvent()
|
|
||||||
{
|
|
||||||
m_semContr.post(); // Signal event (to Experiment-Controller)
|
|
||||||
m_semBochs.wait(); // Wait upon handling to finish
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called from Experiment-Controller to allow simulation start:
|
|
||||||
void startSimulation()
|
|
||||||
{
|
|
||||||
m_semSimCtrl.post();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called from Bochs, directly after thread creation for Experiment-Controller:
|
|
||||||
// (This ensures that Bochs waits until the experiment has been set up in the
|
|
||||||
// Experiment-Controller.)
|
|
||||||
void waitForStartup()
|
|
||||||
{
|
|
||||||
m_semSimCtrl.wait();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // end-of-namespace: fi
|
|
||||||
|
|
||||||
#endif /* __SIGNAL_HPP__ */
|
|
||||||
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
#include "SynchronizedExperimentDataQueue.hpp"
|
|
||||||
|
|
||||||
// FIXME: This file is not used. Delete it either.
|
|
||||||
|
|
||||||
namespace fi {
|
|
||||||
|
|
||||||
void SynchronizedExperimentDataQueue::addData(ExperimentData* exp){
|
|
||||||
//
|
|
||||||
m_sema_full.wait();
|
|
||||||
ExperimentDataQueue::addData(exp);
|
|
||||||
m_sema_empty.post();
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ExperimentData* SynchronizedExperimentDataQueue::getData(){
|
|
||||||
//
|
|
||||||
m_sema_empty.wait();
|
|
||||||
return ExperimentDataQueue::getData();
|
|
||||||
m_sema_full.post();
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
/**
|
|
||||||
* \brief A queue for experiment data.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* \author Martin Hoffmann, Richard Hellwig
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// FIXME: This file is not used. Delete it.
|
|
||||||
|
|
||||||
#ifndef __SYNC_EXPERIMENT_DATA_QUEUE_H__
|
|
||||||
#define __SYNC_EXPERIMENT_DATA_QUEUE_H__
|
|
||||||
|
|
||||||
#include "ExperimentDataQueue.hpp"
|
|
||||||
#include "Signal.hpp"
|
|
||||||
|
|
||||||
namespace fi{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \class SynchronizedExperimentDataQueue
|
|
||||||
* Class which manage ExperimentData in a queue.
|
|
||||||
* Thread safe using semphores.
|
|
||||||
*/
|
|
||||||
class SynchronizedExperimentDataQueue : public ExperimentDataQueue
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/// There are maxSize elements in at a time
|
|
||||||
/// Or do we allow a really possibly huge queue?
|
|
||||||
Semaphore m_sema_full;
|
|
||||||
Semaphore m_sema_empty;
|
|
||||||
|
|
||||||
public:
|
|
||||||
SynchronizedExperimentDataQueue(int maxSize = 1024) : m_sema_full(maxSize), m_sema_empty(0) {}
|
|
||||||
~SynchronizedExperimentDataQueue() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds ExperimentData to the queue.
|
|
||||||
* @param exp ExperimentData that is to be added to the queue.
|
|
||||||
*/
|
|
||||||
void addData(ExperimentData* exp);
|
|
||||||
/**
|
|
||||||
* Returns an item from the queue
|
|
||||||
* @return the next element of the queue
|
|
||||||
*/
|
|
||||||
ExperimentData* getData();
|
|
||||||
/**
|
|
||||||
* Returns the number of elements in the queue
|
|
||||||
* @return the size of the queue
|
|
||||||
*/
|
|
||||||
size_t size() const { return m_queue.size(); };
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //__EXPERIMENT_DATA_QUEUE_H__
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
Coding Style for Fail*
|
Coding Style for FAIL*
|
||||||
======================
|
======================
|
||||||
|
|
||||||
You may violate/break any of the following rules if you have a good reason to
|
You may violate/break any of the following rules if you have a good reason to
|
||||||
|
|||||||
@ -4,21 +4,20 @@ Directory structure:
|
|||||||
|
|
||||||
The folders are nested as follow:
|
The folders are nested as follow:
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
fail: Fail* parent directory, containing all source & configuration files (${FAIL_DIR})
|
fail: FAIL* parent directory, containing all source & configuration files (${FAIL_DIR})
|
||||||
|-cmake: CMake-related configuration files (e.g. compiler-flags, dependencies, ...)
|
|-cmake: CMake-related configuration files (e.g. compiler-flags, dependencies, ...)
|
||||||
|-doc: Fail*-Framework documentation (e.g., diagrams, howtos, ...)
|
|-doc: FAIL*-Framework documentation (e.g., diagrams, howtos, ...)
|
||||||
|-deprecated: temporal and old (source) files, which will probably be deleted
|
|-scripts: python/shell scripts for FAIL*-compilation and experiment distribution
|
||||||
|-scripts: python/shell scripts for Fail*-compilation and experiment distribution
|
|-simulators: parent directory of simulators supported by FAIL* (may still be WIP)
|
||||||
|-simulators: parent directory of simulators supported by Fail* (may still be WIP)
|
|
||||||
|-bochs: source files of the (modified) Bochs x86 simulator backend
|
|-bochs: source files of the (modified) Bochs x86 simulator backend
|
||||||
|-gem5: source files of the gem5 simulator backend
|
|-gem5: source files of the gem5 simulator backend
|
||||||
|-debuggers: parent directory of debuggers supported by Fail* (may still be WIP)
|
|-debuggers: parent directory of debuggers supported by FAIL* (may still be WIP)
|
||||||
|-gdb: source files related to the GNU gdb debugger
|
|-gdb: source files related to the GNU gdb debugger
|
||||||
|-t32: source files related to the Lauterbach T32 debugger
|
|-t32: source files related to the Lauterbach T32 debugger
|
||||||
|-src: C/C++/AspectC++ source files related to Fail*, experiments and plugins
|
|-src: C/C++/AspectC++ source files related to FAIL*, experiments and plugins
|
||||||
|-core: core source files forming the Fail* framework
|
|-core: core source files forming the FAIL* framework
|
||||||
|-util: utility classes and miscellaneous helper functions
|
|-util: utility classes and miscellaneous helper functions
|
||||||
|-config: CMake configuration files, defining the Fail* components and variant
|
|-config: CMake configuration files, defining the FAIL* components and variant
|
||||||
|-sal: source file forming the Simulator Abstraction Layer (backend-interface)
|
|-sal: source file forming the Simulator Abstraction Layer (backend-interface)
|
||||||
|-bochs: backend source files of the Bochs simulator
|
|-bochs: backend source files of the Bochs simulator
|
||||||
|-gem5: backend source files of the gem5 simulator
|
|-gem5: backend source files of the gem5 simulator
|
||||||
@ -27,14 +26,14 @@ fail: Fail* parent directory, containing all source & configuration files (${FA
|
|||||||
|-arm: ARM-specific platform source files
|
|-arm: ARM-specific platform source files
|
||||||
|-x86: x86-specific platform source files
|
|-x86: x86-specific platform source files
|
||||||
|-perf: performance-related source files (extensions); speeds up
|
|-perf: performance-related source files (extensions); speeds up
|
||||||
Fail* <-> simulator interaction (e.g., when using breakpoints)
|
FAIL* <-> simulator interaction (e.g., when using breakpoints)
|
||||||
|-cpn: campaign- (and therefore server-)related source files
|
|-cpn: campaign- (and therefore server-)related source files
|
||||||
|-efw: experiment-framework- (and therefore client-)related source files
|
|-efw: experiment-framework- (and therefore client-)related source files
|
||||||
|-comm: communication related source files (these files are used by cpn and efw), incl.
|
|-comm: communication related source files (these files are used by cpn and efw), incl.
|
||||||
protobuf message definitions used for communication purposes
|
protobuf message definitions used for communication purposes
|
||||||
|-experiments: experiment code files (within a new dir) need to be located here
|
|-experiments: experiment code files (within a new dir) need to be located here
|
||||||
|-plugins: plugin code files (within a new dir) need to be located here
|
|-plugins: plugin code files (within a new dir) need to be located here
|
||||||
|-tools: Fail*-related tools, e.g., for tracing or fault-space pruning
|
|-tools: FAIL*-related tools, e.g., for tracing or fault-space pruning
|
||||||
|-[build]: recommended location of your build-tree, generated files will be placed here
|
|-[build]: recommended location of your build-tree, generated files will be placed here
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,41 +1,58 @@
|
|||||||
=========================================================================================
|
=========================================================================================
|
||||||
Additional libraries/packages/tools needed for Fail*:
|
Additional libraries/packages/tools needed for FAIL*:
|
||||||
=========================================================================================
|
=========================================================================================
|
||||||
|
|
||||||
Required for Fail*:
|
Required for FAIL*:
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
|
- build-essential (e.g. g++)
|
||||||
- libmysqlclient-dev or libmariadbclient-dev
|
- libmysqlclient-dev or libmariadbclient-dev
|
||||||
- libprotobuf-dev
|
- protobuf-compiler libprotobuf-dev
|
||||||
- libpcl1-dev
|
- libpcl1-dev
|
||||||
- libboost-thread-dev libboost-system-dev libboost-regex-dev
|
- libboost-thread-dev libboost-system-dev libboost-regex-dev libboost-coroutine-dev libboost-context-dev
|
||||||
- libdwarf-dev
|
- libdwarf-dev libelf-dev
|
||||||
- libelf-dev
|
- cmake >=2.8.2
|
||||||
- protobuf-compiler
|
- libfontconfig1-dev
|
||||||
- cmake 2.8.2 (2.8.11 preferred)
|
|
||||||
- fontconfig1-dev
|
|
||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
- binutils-dev, on newer systems libiberty-dev
|
- binutils-dev libiberty-dev
|
||||||
- AspectC++ (ag++, ac++): AspectC++ 1.1 or newer is known to work and can be
|
- AspectC++ (ag++, ac++):
|
||||||
obtained from <http://www.aspectc.org>; nightlies can be downloaded from
|
* AspectC++ 1.1 or 1.2 as well as the clang-based >1.2 versions are known to
|
||||||
<http://akut.aspectc.org>. Make sure you use the 64-bit version if running
|
work and can be obtained from <http://www.aspectc.org>. Make sure you use
|
||||||
in a 64-bit environment.
|
the 64-bit version if running in a 64-bit environment.
|
||||||
|
* In some environments, some AspectC++ versions have issues ingesting
|
||||||
|
specific system headers. Workaround: build with CMAKE_AGPP_FLAGS
|
||||||
|
"-D__NO_MATH_INLINES -D__STRICT_ANSI__" or "--c_compiler clang++" (the
|
||||||
|
latter requires the clang++ compiler).
|
||||||
- optional:
|
- optional:
|
||||||
* LLVM 3.3 or 3.4 (needed for several importers in tools/import-trace)
|
* the Capstone disassembler library, version 4.0 or newer
|
||||||
(compiles/links with 3.1 or 3.2, but fails to properly import information
|
- Capstone is highly recommended over using LLVM, which provides
|
||||||
from ELF binaries not compiled with -ffunction-sections)
|
incomplete def/use information for many opcodes.
|
||||||
|
- Note that Debian's/Ubuntu's libcapstone-dev 4.0.1+really+3.0.5 does not
|
||||||
|
suffice. As of this writing, you need to build/install the Capstone
|
||||||
|
library yourself on these distributions.
|
||||||
|
- If the build system cannot automatically locate the Capstone library,
|
||||||
|
manually set CAPSTONE_INCLUDE_DIR and CAPSTONE_LIBRARY in the cmake
|
||||||
|
configuration. Consider using the static libcapstone.a library instead
|
||||||
|
of the .so variant.
|
||||||
|
* LLVM 3.9, 4.0, 5.0, or 6.0 (needed for several importers in
|
||||||
|
tools/import-trace): llvm-3.9-dev, llvm-4.0-dev, llvm-5.0-dev or
|
||||||
|
llvm-6.0-dev
|
||||||
- built with "make REQUIRES_RTTI=1" (the Debian/Ubuntu packages already
|
- built with "make REQUIRES_RTTI=1" (the Debian/Ubuntu packages already
|
||||||
come built this way)
|
come built this way)
|
||||||
- details below
|
- details below
|
||||||
* a MySQL 5.0+ or MariaDB 5.1+ (MariaDB 5.5 recommended) server
|
* a MySQL 5.0+ or MariaDB 5.1+ (MariaDB 5.5 recommended) server
|
||||||
- optional: cmake-curses-gui
|
* doxygen
|
||||||
|
* cmake-curses-gui
|
||||||
|
* python-numpy and python-matplotlib for the faultspaceplot tool
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Required for the Bochs simulator backend:
|
Required for the Bochs simulator backend:
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
- libpthread
|
- libpthread
|
||||||
- Probably more, depending on, e.g., the GUI you configure (X11 ->
|
- Probably more, depending on, e.g., the GUI you configure
|
||||||
libsvga1-dev, libxrandr-dev)
|
(bochs_configure_params in the cmake configuration):
|
||||||
|
SDL/X11 (--with-sdl;--with-x11) -> libsdl1.2-dev
|
||||||
|
wx (--with-wx) -> libgtk2.0-dev libwxgtk3.0-dev libwxbase3.0-dev
|
||||||
|
|
||||||
Required for the gem5 simulator backend:
|
Required for the gem5 simulator backend:
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
@ -73,10 +90,10 @@ For distribution/parallelization:
|
|||||||
it exists.
|
it exists.
|
||||||
|
|
||||||
=========================================================================================
|
=========================================================================================
|
||||||
Compiling, building and modifying: Simulators and Fail*
|
Compiling, building and modifying: Simulators and FAIL*
|
||||||
=========================================================================================
|
=========================================================================================
|
||||||
|
|
||||||
Building Fail*:
|
Building FAIL*:
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
|
|
||||||
For the first time:
|
For the first time:
|
||||||
@ -95,7 +112,7 @@ For the first time:
|
|||||||
$ ccmake .
|
$ ccmake .
|
||||||
Select "BUILD_BOCHS" or "BUILD_GEM5". Select an experiment to enable by
|
Select "BUILD_BOCHS" or "BUILD_GEM5". Select an experiment to enable by
|
||||||
naming its "experiments/" subdirectory under "EXPERIMENTS_ACTIVATED".
|
naming its "experiments/" subdirectory under "EXPERIMENTS_ACTIVATED".
|
||||||
Configure Fail* features you need for this experiment by enabling
|
Configure FAIL* features you need for this experiment by enabling
|
||||||
"CONFIG_*" options. Press 'c', 'g' to regenerate the build system.
|
"CONFIG_*" options. Press 'c', 'g' to regenerate the build system.
|
||||||
(Alternatively use
|
(Alternatively use
|
||||||
$ cmake-gui .
|
$ cmake-gui .
|
||||||
@ -105,18 +122,18 @@ For the first time:
|
|||||||
for your need.
|
for your need.
|
||||||
|
|
||||||
|
|
||||||
After changes to Fail* code:
|
After changes to FAIL* code:
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
Compile (in ${BUILD_DIR}, optionally "add -jN" for parallel building):
|
Compile (in ${BUILD_DIR}, optionally "add -jN" for parallel building):
|
||||||
$ make
|
$ make
|
||||||
CMake will build all Fail* libraries and link them with the simulator backend
|
CMake will build all FAIL* libraries and link them with the simulator backend
|
||||||
library to a binary called "fail-client". You may use the shell script
|
library to a binary called "fail-client". You may use the shell script
|
||||||
$ ${FAIL_DIR}/scripts/rebuild-bochs.sh [-]
|
$ ${FAIL_DIR}/scripts/rebuild-bochs.sh [-]
|
||||||
to speed up repetitive tasks regarding Fail/Bochs builds. This script contains
|
to speed up repetitive tasks regarding Fail/Bochs builds. This script contains
|
||||||
a concise documentation on itself.
|
a concise documentation on itself.
|
||||||
|
|
||||||
|
|
||||||
Add new Fail* sources to build chain:
|
Add new FAIL* sources to build chain:
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
To add new source files to the build, see CMakeLists.txt in the subdirectory of the
|
To add new source files to the build, see CMakeLists.txt in the subdirectory of the
|
||||||
corresponding component in "${FAIL_DIR}/src/core/", and probably consultate the
|
corresponding component in "${FAIL_DIR}/src/core/", and probably consultate the
|
||||||
@ -130,7 +147,7 @@ new subdirectory in "experiments/", activate it in the CMake configuration step
|
|||||||
above).
|
above).
|
||||||
|
|
||||||
|
|
||||||
Generating the Doxygen documentation for Fail*:
|
Generating the Doxygen documentation for FAIL*:
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
To generate the Doxygen documentation, type:
|
To generate the Doxygen documentation, type:
|
||||||
$ make doc
|
$ make doc
|
||||||
@ -145,17 +162,18 @@ to be compiled previously:
|
|||||||
FailBochs: Bochs configuration features
|
FailBochs: Bochs configuration features
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
|
|
||||||
The autotools-based bochs is configured within the Fail* build run.
|
The autotools-based bochs is configured within the FAIL* build run.
|
||||||
The configuration flags can be set within the ccmake configuration (ccmake ${FAIL_DIR}/build)
|
The configuration flags can be set within the ccmake configuration (ccmake ${FAIL_DIR}/build)
|
||||||
- Sufficient:
|
- Sufficient:
|
||||||
--enable-cpu-level=6;--enable-ne2000;--enable-trace-cache;--enable-gdb-stub;--disable-docbook
|
--enable-cpu-level=6;--enable-ne2000;--enable-trace-cache;--enable-gdb-stub;--disable-docbook;--with-nogui
|
||||||
- More simulator features (FailBochs default configuration):
|
- More simulator features and GUIs (FailBochs default configuration):
|
||||||
--enable-a20-pin;--enable-x86-64;--enable-cpu-level=6;--enable-ne2000;--enable-acpi;--enable-pci;--enable-usb;--enable-trace-cache;--enable-fast-function-calls;--enable-host-specific-asms;--enable-disasm;--enable-readline;--enable-clgd54xx;--enable-fpu;--enable-vmx=2;--enable-monitor-mwait;--enable-cdrom;--enable-sb16=linux;--enable-gdb-stub;--disable-docbook;--with-all-libs
|
--enable-a20-pin;--enable-x86-64;--enable-cpu-level=6;--enable-ne2000;--enable-acpi;--enable-pci;--enable-usb;--enable-trace-cache;--enable-fast-function-calls;--enable-host-specific-asms;--enable-disasm;--enable-readline;--enable-clgd54xx;--enable-fpu;--enable-vmx=2;--enable-monitor-mwait;--enable-cdrom;--enable-sb16=linux;--enable-gdb-stub;--disable-docbook;--with-nogui;--with-x11;--with-wx;--with-sdl
|
||||||
Instead of --with-all-libs, you could use --with-nogui for "headless" experiments,
|
The --with-nogui flag suffices for for "headless" experiments, with the
|
||||||
additionally removing lots of library dependencies (thus reducing startup overhead).
|
advantage of removing lots of library dependencies (thus reducing startup
|
||||||
--with-x11 enables only the "x" (X11), --with-wx only the "wx" (wxWidgets) GUI.
|
overhead). --with-x11 enables only the "x" (X11), --with-wx only the "wx"
|
||||||
Note that "wx" does not play well together with Fail*'s "restore" feature (FailBochs
|
(wxWidgets) GUI. Note that "wx" does not play well together with FAIL*'s
|
||||||
will fall back to "x" if available, or die trying.)
|
"restore" feature (FailBochs will fall back to "x" if available, or die
|
||||||
|
trying.)
|
||||||
Once you know everything works as it should, you may want to add the
|
Once you know everything works as it should, you may want to add the
|
||||||
following flags before running larger campaigns:
|
following flags before running larger campaigns:
|
||||||
--disable-logging --disable-assert-checks
|
--disable-logging --disable-assert-checks
|
||||||
@ -182,7 +200,7 @@ Debug build:
|
|||||||
Configure Bochs to use debugging-related compiler flags (expects to be in ${BUILD_DIR}):
|
Configure Bochs to use debugging-related compiler flags (expects to be in ${BUILD_DIR}):
|
||||||
$ cd ../simulator/bochs
|
$ cd ../simulator/bochs
|
||||||
$ CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure --prefix=... ... (see above)
|
$ CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure --prefix=... ... (see above)
|
||||||
You might additionally want to configure the rest of Fail* into debug mode by
|
You might additionally want to configure the rest of FAIL* into debug mode by
|
||||||
setting CMAKE_BUILD_TYPE to "Debug" (ccmake, see above).
|
setting CMAKE_BUILD_TYPE to "Debug" (ccmake, see above).
|
||||||
FIXME: Does this still work?
|
FIXME: Does this still work?
|
||||||
|
|
||||||
@ -213,19 +231,20 @@ Building gem5:
|
|||||||
|
|
||||||
For the first time (incl. selecting an experiment):
|
For the first time (incl. selecting an experiment):
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
1. Change to the Fail* directory (expects to be in ${FAIL_DIR}) and
|
1. Change to the FAIL* directory (expects to be in ${FAIL_DIR}) and
|
||||||
create a new build directory.
|
create a new build directory.
|
||||||
$ cd ${FAIL_DIR}; mkdir build; cd build
|
$ cd ${FAIL_DIR}; mkdir build; cd build
|
||||||
3. Start the configuration by typing
|
3. Start the configuration by typing
|
||||||
$ cmake ..
|
$ cmake ..
|
||||||
4. Modify the generated configuration according to your needs using
|
4. Modify the generated configuration according to your needs using
|
||||||
$ ccmake .
|
$ ccmake .
|
||||||
At least, you should set an experiment and turn on the following
|
At least, you should set an experiment and turn on the configuration flags
|
||||||
flags: BUILD_GEM5 = BUILD_ARM = ON. Additionally, all config
|
BUILD_GEM5 and BUILD_ARM. Additionally, all config options specific for
|
||||||
options specific for other simulator should be turned OFF.
|
other back-ends and architectures should be turned OFF, especially
|
||||||
|
BUILD_BOCHS and BUILD_X86.
|
||||||
5. Typing
|
5. Typing
|
||||||
$ make (or nice make -jN)
|
$ make (or nice make -jN)
|
||||||
will start the build process of Fail* and gem5. This automatically
|
will start the build process of FAIL* and gem5. This automatically
|
||||||
builds the debug variant for ARM targets. (Note that this build will
|
builds the debug variant for ARM targets. (Note that this build will
|
||||||
automatically include the ${FAIL_DIR}/src/core/sal/gem5 as an
|
automatically include the ${FAIL_DIR}/src/core/sal/gem5 as an
|
||||||
"EXTRAS" feature, see gem5/scons build system documentation for
|
"EXTRAS" feature, see gem5/scons build system documentation for
|
||||||
@ -237,13 +256,16 @@ For the first time (incl. selecting an experiment):
|
|||||||
(e.g. a release build, i.e. using "gem5.fast" instead of "gem5.debug")
|
(e.g. a release build, i.e. using "gem5.fast" instead of "gem5.debug")
|
||||||
can be changed in the aforementioned gem5.cmake file.
|
can be changed in the aforementioned gem5.cmake file.
|
||||||
|
|
||||||
After changes to Fail*/gem5 code (incl. aspect headers):
|
NOTE: gem5 currently does not compile with the newer clang-based daily builds
|
||||||
|
of AspectC++ (ac++). You may need to use the ac++ 1.2 release instead.
|
||||||
|
|
||||||
|
After changes to FAIL*/gem5 code (incl. aspect headers):
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
1. Clean the current build by typing
|
1. Clean the current build by typing
|
||||||
$ make gem5-allclean
|
$ make gem5-allclean
|
||||||
(in your build dir ${FAIL_DIR}/build). This cleans the current
|
(in your build dir ${FAIL_DIR}/build). This cleans the current
|
||||||
Fail* and gem5 build directories. Note that "make clean" only cleans
|
FAIL* and gem5 build directories. Note that "make clean" only cleans
|
||||||
the Fail* build directory. Furthermore, all remaining CMake remnants
|
the FAIL* build directory. Furthermore, all remaining CMake remnants
|
||||||
should be deleted:
|
should be deleted:
|
||||||
$ find -name CMakeCache.txt | xargs rm
|
$ find -name CMakeCache.txt | xargs rm
|
||||||
2. Rebuild by typing
|
2. Rebuild by typing
|
||||||
@ -278,12 +300,13 @@ Database backend setup: MySQL / MariaDB
|
|||||||
=========================================================================================
|
=========================================================================================
|
||||||
Building LLVM from sources
|
Building LLVM from sources
|
||||||
=========================================================================================
|
=========================================================================================
|
||||||
If your Linux distribution does not provide a library package for LLVM 3.3 or
|
If your Linux distribution does not provide a library package for LLVM 3.9 or
|
||||||
newer, and you need LLVM support in Fail*, you may need to build LLVM from the
|
newer (the following steps work for LLVM 3.9), and you need LLVM support in
|
||||||
sources and install it, e.g., locally in your home.
|
FAIL*, you may need to build LLVM from the sources and install it, e.g.,
|
||||||
|
locally in your home.
|
||||||
|
|
||||||
1. Download the source tarball of LLVM 3.4 from http://llvm.org (or use the git
|
1. Download the source tarball of LLVM 3.9 from http://llvm.org (or use the git
|
||||||
repository http://llvm.org/git/llvm.git and checkout release_34)
|
repository http://llvm.org/git/llvm.git and checkout release_39)
|
||||||
2. Configure as needed. On mixed 32/64-bit systems (userland/kernel),
|
2. Configure as needed. On mixed 32/64-bit systems (userland/kernel),
|
||||||
prefixing with "linux32" may be necessary:
|
prefixing with "linux32" may be necessary:
|
||||||
$ linux32 ./configure --prefix=$(echo ~/localroot/usr) --enable-optimized --disable-assertions --disable-werror
|
$ linux32 ./configure --prefix=$(echo ~/localroot/usr) --enable-optimized --disable-assertions --disable-werror
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
=========================================================================================
|
=========================================================================================
|
||||||
Steps to run a boot image in Fail* using the Bochs simulator backend:
|
Steps to run a boot image in FAIL* using the Bochs simulator backend:
|
||||||
=========================================================================================
|
=========================================================================================
|
||||||
Follow the Bochs documentation, and start your own "bochsrc" configuration file
|
Follow the Bochs documentation, and start your own "bochsrc" configuration file
|
||||||
based on the "${PREFIX}/share/doc/bochs/bochsrc-sample.txt" template (or
|
based on the "${PREFIX}/share/doc/bochs/bochsrc-sample.txt" template (or
|
||||||
@ -15,17 +15,17 @@ based on the "${PREFIX}/share/doc/bochs/bochsrc-sample.txt" template (or
|
|||||||
- For an X11 GUI:
|
- For an X11 GUI:
|
||||||
config_interface: textconfig
|
config_interface: textconfig
|
||||||
display_library: x
|
display_library: x
|
||||||
- For a wxWidgets GUI (does not play well with Fail*'s "restore" feature):
|
- For a wxWidgets GUI (does not play well with FAIL*'s "restore" feature):
|
||||||
config_interface: wx
|
config_interface: wx
|
||||||
display_library: wx
|
display_library: wx
|
||||||
- Reduce the guest system's RAM to a minimum to reduce Fail*'s memory footprint
|
- Reduce the guest system's RAM to a minimum to reduce FAIL*'s memory footprint
|
||||||
and save/restore overhead, e.g.:
|
and save/restore overhead, e.g.:
|
||||||
memory: guest=16, host=16
|
memory: guest=16, host=16
|
||||||
- If you want to redirect FailBochs's output to a file using the shell's
|
- If you want to redirect FailBochs's output to a file using the shell's
|
||||||
redirection operator '>', make sure "/dev/stdout" is not used as a target
|
redirection operator '>', make sure "/dev/stdout" is not used as a target
|
||||||
file for logging. (The Debian "bochsrc" template unfortunately does this
|
file for logging. (The Debian "bochsrc" template unfortunately does this
|
||||||
in two places. It suffices to comment out these entries.)
|
in two places. It suffices to comment out these entries.)
|
||||||
- To make Fail* terminate if something unexpected happens in a larger
|
- To make FAIL* terminate if something unexpected happens in a larger
|
||||||
campaign, be sure it doesn't "ask" in these cases, e.g.:
|
campaign, be sure it doesn't "ask" in these cases, e.g.:
|
||||||
panic: action=fatal
|
panic: action=fatal
|
||||||
error: action=fatal
|
error: action=fatal
|
||||||
@ -63,7 +63,7 @@ An example of a DatabaseCampaign with separate experiment.
|
|||||||
CONFIG_EVENT_MEMWRITE, CONFIG_EVENT_TRAP, CONFIG_SR_RESTORE and CONFIG_SR_SAVE
|
CONFIG_EVENT_MEMWRITE, CONFIG_EVENT_TRAP, CONFIG_SR_RESTORE and CONFIG_SR_SAVE
|
||||||
The options BUILD_BOCHS, BUILD_X86 are needed as well, but are defaults.
|
The options BUILD_BOCHS, BUILD_X86 are needed as well, but are defaults.
|
||||||
3. In weather-monitor/experimentInfo.hpp set "PREREQUISITES" to 1 and build
|
3. In weather-monitor/experimentInfo.hpp set "PREREQUISITES" to 1 and build
|
||||||
Fail*/Bochs using e.g. fail/scripts/rebuild-bochs.sh (-> how-to-build.txt).
|
FAIL*/Bochs using e.g. fail/scripts/rebuild-bochs.sh (-> how-to-build.txt).
|
||||||
Upon minor changes (i.e. not e.g. to aspects), append " -" to the call to
|
Upon minor changes (i.e. not e.g. to aspects), append " -" to the call to
|
||||||
the script. This will rebuild only parts that changed.
|
the script. This will rebuild only parts that changed.
|
||||||
4. Enter experiment_targets/weathermonitor and run:
|
4. Enter experiment_targets/weathermonitor and run:
|
||||||
@ -76,7 +76,7 @@ An example of a DatabaseCampaign with separate experiment.
|
|||||||
being VARIANT.trace
|
being VARIANT.trace
|
||||||
6. Use "import-trace" (using correct -b & -v, -t is VARIANT.trace) to get the
|
6. Use "import-trace" (using correct -b & -v, -t is VARIANT.trace) to get the
|
||||||
trace into the database and "prune-trace" to (obviously) prune the data.
|
trace into the database and "prune-trace" to (obviously) prune the data.
|
||||||
7. Change PREREQUISITES (see 5) back to "0" and rebuild Fail*/Bochs.
|
7. Change PREREQUISITES (see 5) back to "0" and rebuild FAIL*/Bochs.
|
||||||
8. Run the "weather-monitor-server" (Don't forget -v & -b!) and "fail-client -q"
|
8. Run the "weather-monitor-server" (Don't forget -v & -b!) and "fail-client -q"
|
||||||
from within experiment_targets/weathermonitor/.
|
from within experiment_targets/weathermonitor/.
|
||||||
You'll need several clients to finish the campaign.
|
You'll need several clients to finish the campaign.
|
||||||
@ -87,7 +87,7 @@ A simple standalone experiment (without a separate campaign). To compile this
|
|||||||
experiment, the following steps are required:
|
experiment, the following steps are required:
|
||||||
1. Add "hsc-simple" to ccmake's EXPERIMENTS_ACTIVATED.
|
1. Add "hsc-simple" to ccmake's EXPERIMENTS_ACTIVATED.
|
||||||
2. Enable CONFIG_EVENT_BREAKPOINTS, CONFIG_SR_RESTORE and CONFIG_SR_SAVE.
|
2. Enable CONFIG_EVENT_BREAKPOINTS, CONFIG_SR_RESTORE and CONFIG_SR_SAVE.
|
||||||
3. Build Fail* and Bochs, see "how-to-build.txt" for details.
|
3. Build FAIL* and Bochs, see "how-to-build.txt" for details.
|
||||||
4. Enter experiment_targets/hscsimple/, bunzip2 -k *.bz2
|
4. Enter experiment_targets/hscsimple/, bunzip2 -k *.bz2
|
||||||
5. Start the Bochs simulator by typing
|
5. Start the Bochs simulator by typing
|
||||||
$ fail-client -q
|
$ fail-client -q
|
||||||
@ -130,7 +130,7 @@ fail-client for the next 2k experiments.
|
|||||||
|
|
||||||
The experiments can be significantly sped up by
|
The experiments can be significantly sped up by
|
||||||
a) parallelization (run more FailBochs clients and
|
a) parallelization (run more FailBochs clients and
|
||||||
b) a headless (and more optimized) Fail* configuration (see above).
|
b) a headless (and more optimized) FAIL* configuration (see above).
|
||||||
|
|
||||||
|
|
||||||
Experiment "MHTestCampaign":
|
Experiment "MHTestCampaign":
|
||||||
@ -211,7 +211,7 @@ To compile this experiment, the following steps are required:
|
|||||||
CONFIG_EVENT_MEMREAD, CONFIG_EVENT_MEMWRITE, CONFIG_EVENT_TRAP, CONFIG_SR_RESTORE
|
CONFIG_EVENT_MEMREAD, CONFIG_EVENT_MEMWRITE, CONFIG_EVENT_TRAP, CONFIG_SR_RESTORE
|
||||||
and CONFIG_SR_SAVE.
|
and CONFIG_SR_SAVE.
|
||||||
6. Enable STEP1 in fail/src/experiments/weather-monitor/experiment.cc
|
6. Enable STEP1 in fail/src/experiments/weather-monitor/experiment.cc
|
||||||
7. Build Fail* and gem5, see "how-to-build.txt" for details.
|
7. Build FAIL* and gem5, see "how-to-build.txt" for details.
|
||||||
8. Start the gem5-fail-client by typing
|
8. Start the gem5-fail-client by typing
|
||||||
"../scripts/run-gem5.sh ../../experiment_targets/weathermonitor_arm/weather.elf
|
"../scripts/run-gem5.sh ../../experiment_targets/weathermonitor_arm/weather.elf
|
||||||
weathermonitor_arm/weather.elf"
|
weathermonitor_arm/weather.elf"
|
||||||
@ -222,7 +222,7 @@ To compile this experiment, the following steps are required:
|
|||||||
10. Prune the trace with
|
10. Prune the trace with
|
||||||
"prune-trace -d YOUR_DB -v baseline -b weather"
|
"prune-trace -d YOUR_DB -v baseline -b weather"
|
||||||
11. Enable STEP3 in fail/src/experiments/weather-monitor/experiment.cc
|
11. Enable STEP3 in fail/src/experiments/weather-monitor/experiment.cc
|
||||||
12. Build Fail* and gem5, see "how-to-build.txt" for details.
|
12. Build FAIL* and gem5, see "how-to-build.txt" for details.
|
||||||
13. Start the campaign-server
|
13. Start the campaign-server
|
||||||
"bin/weather-monitor-server -v baseline -b weather"
|
"bin/weather-monitor-server -v baseline -b weather"
|
||||||
14. Start the gem5-fail-client by typing
|
14. Start the gem5-fail-client by typing
|
||||||
@ -231,18 +231,18 @@ To compile this experiment, the following steps are required:
|
|||||||
=========================================================================================
|
=========================================================================================
|
||||||
Parallelization
|
Parallelization
|
||||||
=========================================================================================
|
=========================================================================================
|
||||||
Fail* is designed to allow parallelization of experiment execution allowing to reduce
|
FAIL* is designed to allow parallelization of experiment execution allowing to reduce
|
||||||
the time needed to execute the experiments on a (larger) set of experiment data (aka
|
the time needed to execute the experiments on a (larger) set of experiment data (aka
|
||||||
input parameters for the experiment execution, e.g. instruction pointer, registers, bit
|
input parameters for the experiment execution, e.g. instruction pointer, registers, bit
|
||||||
numbers, ...). We call such "experiment data" the parameter sets. The so called "campaign"
|
numbers, ...). We call such "experiment data" the parameter sets. The so called "campaign"
|
||||||
is responsible for managing the parameter sets (i.e., the data to be used by the experiment
|
is responsible for managing the parameter sets (i.e., the data to be used by the experiment
|
||||||
flows), inquired by the clients. As a consequence, the campaign is running on the server-
|
flows), inquired by the clients. As a consequence, the campaign is running on the server-
|
||||||
side and the experiment flows are running on the (distributed) clients.
|
side and the experiment flows are running on the (distributed) clients.
|
||||||
First of all, the Fail* instances (and other required files, e.g. saved state) are
|
First of all, the FAIL* instances (and other required files, e.g. saved state) are
|
||||||
distributed to the clients. In the second step the campaign(-server) is started, preparing
|
distributed to the clients. In the second step the campaign(-server) is started, preparing
|
||||||
its parameter sets in order to be able to answer the requests from the clients. (Once
|
its parameter sets in order to be able to answer the requests from the clients. (Once
|
||||||
there are available parameter sets, the clients can request them.) In the final step,
|
there are available parameter sets, the clients can request them.) In the final step,
|
||||||
the distributed Fail* clients have to be started. As soon as this setup is finished,
|
the distributed FAIL* clients have to be started. As soon as this setup is finished,
|
||||||
the clients request new parameter sets, execute their experiment code and return their
|
the clients request new parameter sets, execute their experiment code and return their
|
||||||
results to the server (aka campaign) in an iterative way, until all paremeter sets have
|
results to the server (aka campaign) in an iterative way, until all paremeter sets have
|
||||||
been processed successfully. If all (new) parameter sets have been distributed, the
|
been processed successfully. If all (new) parameter sets have been distributed, the
|
||||||
|
|||||||
@ -211,7 +211,7 @@ Erledigt:
|
|||||||
-> benenne Events um ("Listener")
|
-> benenne Events um ("Listener")
|
||||||
-> Erstelle neue Klassenhierarchie, die den "Informationsanteil" der "Events"
|
-> Erstelle neue Klassenhierarchie, die den "Informationsanteil" der "Events"
|
||||||
repräsentiert. Diese kapseln dann die Informationen in den Events und
|
repräsentiert. Diese kapseln dann die Informationen in den Events und
|
||||||
werden zudem intern im Fail*-Framework verwendet (genauer: kommuniziert).
|
werden zudem intern im FAIL*-Framework verwendet (genauer: kommuniziert).
|
||||||
|
|
||||||
==========================================================================================
|
==========================================================================================
|
||||||
Theorie TODO
|
Theorie TODO
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
This file documents ideas/wishes especially from a Fail* *user* perspective.
|
This file documents ideas/wishes especially from a FAIL* *user* perspective.
|
||||||
|
|
||||||
- Recurring Fail* API usage patterns in experiment/campaign implementations
|
- Recurring FAIL* API usage patterns in experiment/campaign implementations
|
||||||
(that could be implemented in a reusable way, e.g. in a library that sits
|
(that could be implemented in a reusable way, e.g. in a library that sits
|
||||||
between the Fail* API and the experiment)
|
between the FAIL* API and the experiment)
|
||||||
* Fault-space pruning (FIXME elaborate)
|
* Fault-space pruning (FIXME elaborate)
|
||||||
* Preparation vs. final experiment steps -> cmake-driven, automatically
|
* Preparation vs. final experiment steps -> cmake-driven, automatically
|
||||||
build 2 fail-client binaries? (FIXME elaborate)
|
build 2 fail-client binaries? (FIXME elaborate)
|
||||||
|
|||||||
@ -43,7 +43,7 @@ do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# only start a client if at least 500 MiB is available
|
# only start a client if at least 500 MiB is available
|
||||||
FREE_MEM=$(free -m | grep "buffers/cache:" | awk '{print $4}')
|
FREE_MEM=$(LC_ALL=C free -m | grep "buffers/cache:" | awk '{print $4}')
|
||||||
if [ $FREE_MEM -lt "500" ]; then
|
if [ $FREE_MEM -lt "500" ]; then
|
||||||
# waiting for free memory. sleep 1-60s and retry.
|
# waiting for free memory. sleep 1-60s and retry.
|
||||||
sleep $(($RANDOM / (32768 / 60) + 1))
|
sleep $(($RANDOM / (32768 / 60) + 1))
|
||||||
@ -51,7 +51,7 @@ do
|
|||||||
#nice -n 19 ./bochs -q 2>&1 | tee log.$$.txt | fgrep Result
|
#nice -n 19 ./bochs -q 2>&1 | tee log.$$.txt | fgrep Result
|
||||||
#nice -n 18 ./bochs -q 2>&1 | fgrep Result
|
#nice -n 18 ./bochs -q 2>&1 | fgrep Result
|
||||||
nice -n 18 ./fail-client -q >/dev/null 2>&1
|
nice -n 18 ./fail-client -q >/dev/null 2>&1
|
||||||
if [ $? -eq 1 ]
|
if [ $? -gt 0 ] # exit on any error
|
||||||
then
|
then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -39,7 +39,7 @@ fi
|
|||||||
for h in $FAIL_DISTRIBUTE_HOSTS
|
for h in $FAIL_DISTRIBUTE_HOSTS
|
||||||
do
|
do
|
||||||
echo Distributing to $h ...
|
echo Distributing to $h ...
|
||||||
rsync -az --partial --delete-before --delete-excluded --exclude=core --exclude=*.tc . $h:"$FAIL_EXPERIMENT_TARGETDIR" &
|
rsync -az --partial --delete-before --delete-excluded --exclude=core --exclude=*.tc --exclude=*.pb . $h:"$FAIL_EXPERIMENT_TARGETDIR" &
|
||||||
done
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|||||||
@ -1,19 +1,12 @@
|
|||||||
all:
|
build-all:
|
||||||
docker build -t danceos/fail-base fail-base
|
docker build -t fail-base fail-base --build-arg CACHE_DATE="$(shell date)"
|
||||||
docker build -t danceos/fail-generic-tracing fail-generic-tracing
|
docker build -t fail-generic-tracing fail-generic-tracing
|
||||||
docker build -t danceos/fail-demo fail-demo
|
docker build -t fail-demo fail-demo --build-arg CACHE_DATE="$(shell date)"
|
||||||
|
|
||||||
|
run-all: .compose ssh
|
||||||
|
|
||||||
run-fail-db:
|
.compose:
|
||||||
docker run --name fail-db \
|
docker compose up -d --force-recreate --renew-anon-volumes -y
|
||||||
-e MYSQL_ROOT_PASSWORD=fail \
|
|
||||||
-e MYSQL_USER=fail \
|
|
||||||
-e MYSQL_PASSWORD=fail \
|
|
||||||
-e MYSQL_DATABASE=fail \
|
|
||||||
-d mysql
|
|
||||||
|
|
||||||
run-fail-demo:
|
ssh:
|
||||||
docker run --name fail-demo -p 127.0.0.1:5000:5000 --link fail-db:mysql -d danceos/fail-demo
|
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 5022 fail@127.0.0.1
|
||||||
|
|
||||||
ssh-fail-demo:
|
|
||||||
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no fail@$$(docker inspect --format "{{ .NetworkSettings.IPAddress }}" fail-demo)
|
|
||||||
|
|||||||
26
scripts/docker/docker-compose.yaml
Normal file
26
scripts/docker/docker-compose.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
services:
|
||||||
|
fail-db:
|
||||||
|
image: mysql
|
||||||
|
container_name: fail-db
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: fail
|
||||||
|
MYSQL_USER: fail
|
||||||
|
MYSQL_PASSWORD: fail
|
||||||
|
MYSQL_DATABASE: fail
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
networks:
|
||||||
|
- fail-network
|
||||||
|
|
||||||
|
fail-demo:
|
||||||
|
image: fail-demo
|
||||||
|
container_name: fail-demo
|
||||||
|
ports:
|
||||||
|
- "5000:5000" # Result Browser
|
||||||
|
- "5022:22" # SSH
|
||||||
|
networks:
|
||||||
|
- fail-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
fail-network:
|
||||||
|
driver: bridge
|
||||||
@ -1,59 +1,132 @@
|
|||||||
# Set the base image to Ubuntu Utopic (14.10)
|
# Set the base image to Ubuntu Jammy. Jammy includes the correct dependency versions except for LLVM.
|
||||||
FROM ubuntu:utopic
|
FROM ubuntu:jammy
|
||||||
|
|
||||||
MAINTAINER Christian Dietrich <stettberger@dokucode.de>
|
LABEL org.opencontainers.image.authors="Christian Dietrich <stettberger@dokucode.de>"
|
||||||
|
|
||||||
# Install Packages required to build FAIL*
|
# TODO: Can shrink the image size down by a LOT:
|
||||||
RUN apt-get update
|
# - A lot of dependencies are unnecessary, I just need to figure out which
|
||||||
RUN apt-get install -y \
|
# - Separate build-time / runtime dependencies, then do 2 stages
|
||||||
binutils-dev \
|
# - Combine multiple RUNs into a single one
|
||||||
build-essential \
|
# - Use apt-get --no-install-recommends during package install and apt-get clean afterwards
|
||||||
cmake \
|
|
||||||
git \
|
# Install basic packages
|
||||||
libboost-regex-dev \
|
RUN apt-get update \
|
||||||
libboost-system-dev \
|
&& DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \
|
||||||
|
build-essential \
|
||||||
|
ca-certificates \
|
||||||
|
cmake \
|
||||||
|
cmake-curses-gui \
|
||||||
|
wget \
|
||||||
|
git \
|
||||||
|
doxygen \
|
||||||
|
screen \
|
||||||
|
openssh-server \
|
||||||
|
neovim \
|
||||||
|
ranger
|
||||||
|
|
||||||
|
# NOTE: Only required if the base image is not Jammy
|
||||||
|
# Install Boost 1.74 (focal includes 1.71)
|
||||||
|
# Jammy includes the correct version but its llvm is too old
|
||||||
|
# RUN wget https://archives.boost.io/release/1.74.0/source/boost_1_74_0.tar.gz \
|
||||||
|
# && tar xvzf boost_1_74_0.tar.gz && cd boost_1_74_0 \
|
||||||
|
# && chmod +x ./bootstrap.sh \
|
||||||
|
# && ./bootstrap.sh --prefix=/usr/local \
|
||||||
|
# && ./b2 && ./b2 install
|
||||||
|
# && cd / && rm -rf boost_1_74_0.tar.gz && rm -rf boost_1_74_0
|
||||||
|
# ENV BOOST_ROOT=/usr/local
|
||||||
|
|
||||||
|
# NOTE: Only required if the base image is not Focal
|
||||||
|
# Install LLVM 6.0 from source
|
||||||
|
RUN git clone https://github.com/llvm/llvm-project.git && cd llvm-project \
|
||||||
|
&& git checkout llvmorg-6.0.0 \
|
||||||
|
&& mkdir build && cd build \
|
||||||
|
&& cmake -G "Unix Makefiles" ../llvm \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DLLVM_ENABLE_TERMINFO=OFF \
|
||||||
|
-DLLVM_ENABLE_CURSES=OFF \
|
||||||
|
-DLLVM_ENABLE_PROJECTS="clang;lld" \
|
||||||
|
&& make -j$(nproc) && make install \
|
||||||
|
&& cd / && rm -rf ./llvm-project
|
||||||
|
|
||||||
|
# Install packages required to build FAIL*
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \
|
||||||
|
# binutils-dev \
|
||||||
|
libmysqlclient-dev \
|
||||||
|
libprotobuf-dev \
|
||||||
|
libtinfo-dev \
|
||||||
|
libpcl1-dev \
|
||||||
|
libdwarf-dev \
|
||||||
|
libelf-dev \
|
||||||
|
libiberty-dev \
|
||||||
libboost-thread-dev \
|
libboost-thread-dev \
|
||||||
libdwarf-dev \
|
libboost-system-dev \
|
||||||
libelf-dev \
|
libboost-regex-dev \
|
||||||
libfontconfig1-dev \
|
libboost-coroutine-dev \
|
||||||
libiberty-dev \
|
libboost-context-dev \
|
||||||
libmysqlclient-dev \
|
libfontconfig1-dev \
|
||||||
libpcl1-dev \
|
zlib1g-dev \
|
||||||
libprotobuf-dev \
|
libz3-dev \
|
||||||
libsvga1-dev \
|
libsdl1.2-dev \
|
||||||
llvm-3.4-dev \
|
# libsdl2-dev \
|
||||||
screen \
|
libgtk2.0-dev \
|
||||||
protobuf-compiler \
|
# libgtk-3-dev \
|
||||||
wget \
|
# libwxbase3.0-dev \
|
||||||
openssh-server \
|
libwxgtk3.0-gtk3-dev \
|
||||||
vim \
|
libncurses-dev \
|
||||||
zlib1g-dev
|
# libncurses5-dev \
|
||||||
|
libx11-dev \
|
||||||
|
xorg-dev \
|
||||||
|
libasound2-dev
|
||||||
|
|
||||||
|
# Install packages required to run FAIL*
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \
|
||||||
|
protobuf-compiler \
|
||||||
|
libtinfo6 \
|
||||||
|
# libtinfo5 \
|
||||||
|
libmariadb3 \
|
||||||
|
libprotobuf23 \
|
||||||
|
libncurses6 \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
|
# NOTE: Only required if we install llvm from apt
|
||||||
|
# Symlink clang++/llvm-config to match docs
|
||||||
|
# RUN ln -sf /usr/bin/clang++-6.0 /usr/bin/clang++ \
|
||||||
|
# && ln -sf /usr/bin/llvm-config-6.0 /usr/bin/llvm-config
|
||||||
|
|
||||||
# Add a user for compiling FAIL*
|
# Add a user for compiling FAIL*
|
||||||
RUN useradd fail; mkdir /home/fail; chown fail /home/fail
|
RUN useradd fail \
|
||||||
RUN echo 'fail:fail' | chpasswd; chsh fail --shell /bin/bash
|
&& mkdir /home/fail && chown fail /home/fail \
|
||||||
RUN adduser fail sudo
|
&& echo 'fail:fail' | chpasswd && chsh fail --shell /bin/bash \
|
||||||
|
&& adduser fail sudo
|
||||||
|
|
||||||
# SSH login fix. Otherwise user is kicked off after login
|
# SSH login fix. Otherwise user is kicked off after login
|
||||||
RUN mkdir /var/run/sshd
|
RUN mkdir /var/run/sshd \
|
||||||
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
|
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
|
||||||
|
|
||||||
ENV NOTVISIBLE "in users profile"
|
ENV NOTVISIBLE="in users profile"
|
||||||
RUN echo "export VISIBLE=now" >> /etc/profile
|
RUN echo "export VISIBLE=now" >> /etc/profile
|
||||||
|
|
||||||
USER fail
|
USER fail
|
||||||
ENV HOME /home/fail
|
ENV HOME=/home/fail
|
||||||
WORKDIR /home/fail
|
WORKDIR /home/fail
|
||||||
|
|
||||||
# Get the latest version of AspectC++ for 64 Bit
|
# Get AspectC++ (originally v1.2) for 64 Bit
|
||||||
RUN wget http://aspectc.org:8080/job/Build_Binaries/Platform=linux_x86_64/lastBuild/artifact/binaries.tar.bz2
|
ARG acversion="2.5"
|
||||||
RUN tar xvjf binaries.tar.bz2; mv AspectC++/bin/linux-release bin; rm -rf 'AspectC++'
|
RUN wget http://www.aspectc.org/releases/"$acversion"/ac-bin-linux-x86-64bit-"$acversion".tar.gz \
|
||||||
ENV PATH /home/fail/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
&& tar xvzf ac-bin-linux-x86-64bit-"$acversion".tar.gz \
|
||||||
|
&& mkdir bin && mv aspectc++/ac++ aspectc++/ag++ bin/ \
|
||||||
|
&& rm -rf aspectc++ && rm -rf ac-bin-linux-x86-64bit-"$acversion".tar.gz
|
||||||
|
ENV PATH=/home/fail/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
# Clone FAIL*
|
# Clone FAIL*
|
||||||
RUN git clone https://github.com/danceos/fail.git
|
# Break docker layer cache
|
||||||
|
ARG CACHE_DATE=1970-01-01
|
||||||
|
# RUN git clone https://github.com/danceos/fail.git
|
||||||
|
RUN git clone https://gitea.vps.chriphost.de/christoph/fail
|
||||||
WORKDIR fail
|
WORKDIR fail
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
# Accept SSH connections
|
||||||
EXPOSE 22
|
EXPOSE 22
|
||||||
CMD ["/usr/sbin/sshd", "-D"]
|
CMD ["/usr/sbin/sshd", "-D"]
|
||||||
|
|||||||
@ -3,20 +3,9 @@
|
|||||||
# generic-tracing experiment was already built and the binaries are in
|
# generic-tracing experiment was already built and the binaries are in
|
||||||
# place (~fail/bin/*)
|
# place (~fail/bin/*)
|
||||||
|
|
||||||
FROM danceos/fail-generic-tracing
|
FROM fail-generic-tracing
|
||||||
MAINTAINER Christian Dietrich <stettberger@dokucode.de>
|
|
||||||
|
|
||||||
# Install Additional Packages
|
|
||||||
RUN apt-get install -y \
|
|
||||||
python-minimal \
|
|
||||||
grub-common \
|
|
||||||
xorriso \
|
|
||||||
grub-pc-bin \
|
|
||||||
mysql-client \
|
|
||||||
python-flask \
|
|
||||||
python-mysqldb \
|
|
||||||
python-yaml
|
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.authors="Christian Dietrich <stettberger@dokucode.de>"
|
||||||
|
|
||||||
# Passwort for MySQL Daemon
|
# Passwort for MySQL Daemon
|
||||||
ADD my.cnf /home/fail/.my.cnf
|
ADD my.cnf /home/fail/.my.cnf
|
||||||
@ -24,22 +13,144 @@ RUN chown fail /home/fail/.my.cnf
|
|||||||
|
|
||||||
USER fail
|
USER fail
|
||||||
WORKDIR /home/fail
|
WORKDIR /home/fail
|
||||||
RUN echo 'export PATH=$HOME/bin:$PATH' >> ~/.profile;\
|
RUN echo 'export PATH=$HOME/bin:$PATH' >> ~/.profile \
|
||||||
echo 'cd $HOME/fail-targets' >> ~/.profile
|
&& echo 'cd $HOME/fail-targets' >> ~/.profile
|
||||||
|
|
||||||
RUN git clone https://github.com/danceos/fail-targets.git
|
|
||||||
|
|
||||||
WORKDIR fail
|
WORKDIR fail
|
||||||
RUN mkdir build; cd build; ../configurations/x86_pruning.sh generic-experiment
|
RUN mkdir build; cd build
|
||||||
WORKDIR build
|
WORKDIR build
|
||||||
|
|
||||||
# Make FAIL*
|
RUN cmake \
|
||||||
RUN make -j$(getconf _NPROCESSORS_ONLN) || make -j$(getconf _NPROCESSORS_ONLN)
|
-DAGXX=/home/fail/bin/ag++ \
|
||||||
RUN ln -s /home/fail/fail/build/bin/fail-client /home/fail/bin/generic-experiment-client; \
|
-DBOOST_THREAD_LIBRARY=/usr/lib/x86_64-linux-gnu/libpthread.so \
|
||||||
ln -s /home/fail/fail/build/bin/generic-experiment-server /home/fail/bin/; \
|
# Enable / Disable features \
|
||||||
ln -s /home/fail/fail/tools/analysis/resultbrowser/run.py /home/fail/bin/resultbrowser
|
-DBUILD_ARM=OFF \
|
||||||
|
-DBUILD_BOCHS=ON \
|
||||||
|
-DBUILD_CAPSTONE_DISASSEMBLER=OFF \
|
||||||
|
-DBUILD_COMPUTE_HOPS=OFF \
|
||||||
|
-DBUILD_CONVERT_TRACE=OFF \
|
||||||
|
-DBUILD_DATA_AGGREGATOR=OFF \
|
||||||
|
-DBUILD_DUMP_HOPS=OFF \
|
||||||
|
-DBUILD_DUMP_TRACE=OFF \
|
||||||
|
-DBUILD_FAULTSPACEPLOT=OFF \
|
||||||
|
-DBUILD_GEM5=OFF \
|
||||||
|
-DBUILD_IMPORT_TRACE=OFF \
|
||||||
|
-DBUILD_LLVM_DISASSEMBLER=ON \
|
||||||
|
-DBUILD_PANDA=OFF \
|
||||||
|
-DBUILD_PRUNE_TRACE=OFF \
|
||||||
|
-DBUILD_QEMU=OFF \
|
||||||
|
-DBUILD_T32=OFF \
|
||||||
|
-DBUILD_X86=ON \
|
||||||
|
# \
|
||||||
|
-DCLIENT_JOB_INITIAL=1 \
|
||||||
|
-DCLIENT_JOB_LIMIT=1000 \
|
||||||
|
-DCLIENT_JOB_REQUEST_SEC=30 \
|
||||||
|
-DCLIENT_RAND_BACKOFF_TEND=8 \
|
||||||
|
-DCLIENT_RAND_BACKOFF_TSTART=3 \
|
||||||
|
-DCLIENT_RETRY_COUNT=3 \
|
||||||
|
# ;-separated list \
|
||||||
|
-DCMAKE_AGPP_FLAGS="-D__NO_MATH_INLINES" \
|
||||||
|
# \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||||
|
-DCONFIG_BOCHS_COMPRESS_STATE=ON \
|
||||||
|
-DCONFIG_BOCHS_NON_VERBOSE=OFF \
|
||||||
|
-DCONFIG_BOCHS_NO_ABORT=ON \
|
||||||
|
-DCONFIG_DISABLE_KEYB_INTERRUPTS=OFF \
|
||||||
|
-DCONFIG_EVENT_BREAKPOINTS=ON \
|
||||||
|
-DCONFIG_EVENT_BREAKPOINTS_RANGE=ON \
|
||||||
|
-DCONFIG_EVENT_GUESTSYS=ON \
|
||||||
|
-DCONFIG_EVENT_INTERRUPT=ON \
|
||||||
|
-DCONFIG_EVENT_IOPORT=ON \
|
||||||
|
-DCONFIG_EVENT_JUMP=OFF \
|
||||||
|
-DCONFIG_EVENT_MEMREAD=ON \
|
||||||
|
-DCONFIG_EVENT_MEMWRITE=ON \
|
||||||
|
-DCONFIG_EVENT_TRAP=ON \
|
||||||
|
-DCONFIG_FAST_BREAKPOINTS=ON \
|
||||||
|
-DCONFIG_FAST_WATCHPOINTS=ON \
|
||||||
|
-DCONFIG_FIRE_INTERRUPTS=ON \
|
||||||
|
-DCONFIG_INJECTIONPOINT_HOPS=OFF \
|
||||||
|
-DCONFIG_SR_REBOOT=ON \
|
||||||
|
-DCONFIG_SR_RESTORE=ON \
|
||||||
|
-DCONFIG_SR_SAVE=ON \
|
||||||
|
-DCONFIG_SUPPRESS_INTERRUPTS=ON \
|
||||||
|
-DENABLE_DATABASE_TESTS=OFF \
|
||||||
|
# ;-separated list \
|
||||||
|
-DEXPERIMENTS_ACTIVATED="generic-experiment" \
|
||||||
|
# \
|
||||||
|
-DLibIberty_INCLUDE_DIRS=/usr/include/libiberty \
|
||||||
|
-DLibIberty_LIBRARIES=/usr/lib/x86_64-linux-gnu/libiberty.a \
|
||||||
|
-DMYSQL_CONFIG=/usr/bin/mysql_config \
|
||||||
|
-DMYSQL_CONFIG_PREFER_PATH=/bin \
|
||||||
|
# ;-separated list \
|
||||||
|
-DPLUGINS_ACTIVATED="serialoutput" \
|
||||||
|
# \
|
||||||
|
-DSERVER_COMM_HOSTNAME=localhost \
|
||||||
|
-DSERVER_COMM_TCP_PORT=1111 \
|
||||||
|
-DSERVER_OUT_QUEUE_SIZE=0 \
|
||||||
|
-DSERVER_PERFORMANCE_MEASURE=OFF \
|
||||||
|
-DSERVER_PERF_LOG_PATH=perf.log \
|
||||||
|
-DSERVER_PERF_STEPPING_SEC=1 \
|
||||||
|
-DTEST_MYSQL_DATABASE=fail_test \
|
||||||
|
-DTEST_MYSQL_HOST=localhost \
|
||||||
|
-DTEST_MYSQL_PASSWORD=fail_test \
|
||||||
|
-DTEST_MYSQL_PORT=3306 \
|
||||||
|
-DTEST_MYSQL_USER=fail_test \
|
||||||
|
-DVERBOSE_MAKE=OFF \
|
||||||
|
-D_filename=/usr/include/wx-3.0/wx/version.h \
|
||||||
|
# ;-separated list \
|
||||||
|
-Dbochs_configure_params="--enable-a20-pin;--enable-x86-64;--enable-cpu-level=6;--enable-ne2000;--enable-acpi;--enable-pci;--enable-usb;--enable-trace-cache;--enable-fast-function-calls;--enable-host-specific-asms;--enable-disasm;--enable-readline;--enable-clgd54xx;--enable-fpu;--enable-vmx=2;--enable-monitor-mwait;--enable-cdrom;--enable-sb16=linux;--enable-gdb-stub;--disable-docbook;--with-nogui;--with-x11;--with-wx;--with-sdl" \
|
||||||
|
# \
|
||||||
|
-Dbochs_install_prefix=/home/fail/fail/simulators/bochs/install \
|
||||||
|
..
|
||||||
|
|
||||||
# For the resultbrowser, we expose port 5000 to the outside world.
|
# We need to manually build Bochs first to generate the bochs/config.h - the external_project configure step
|
||||||
EXPOSE 5000
|
# (where this file is generated) is run at build time (not configure time), but the build order is not defined correctly.
|
||||||
|
# RUN cmake --build . --target libfailbochs_external-configure \
|
||||||
|
# && cmake --build .
|
||||||
|
RUN cmake --build . --target libfailbochs_external-configure -- -j$(nproc) \
|
||||||
|
&& cmake --build . -- -j$(nproc)
|
||||||
|
|
||||||
|
RUN ln -s /home/fail/fail/build/bin/fail-client /home/fail/bin/generic-experiment-client \
|
||||||
|
&& ln -s /home/fail/fail/build/bin/generic-experiment-server /home/fail/bin/ \
|
||||||
|
&& ln -s /home/fail/fail/tools/analysis/resultbrowser/run.py /home/fail/bin/resultbrowser.py
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
# Install additional packages
|
||||||
|
RUN apt-get update \
|
||||||
|
&& DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \
|
||||||
|
grub-common \
|
||||||
|
xorriso \
|
||||||
|
grub-pc-bin \
|
||||||
|
mysql-client \
|
||||||
|
python2-minimal \
|
||||||
|
python2-dev \
|
||||||
|
# python2-flask \
|
||||||
|
# python2-mysqldb \
|
||||||
|
# python2-yaml \
|
||||||
|
unzip \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
|
# Fix old shebangs
|
||||||
|
RUN ln -sf /usr/bin/python2 /usr/bin/python
|
||||||
|
|
||||||
|
# Install python packages
|
||||||
|
RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py \
|
||||||
|
&& python2 get-pip.py \
|
||||||
|
&& wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -O /usr/include/mysql/my_config.h \
|
||||||
|
&& pip2 install flask pyyaml MySQL-python
|
||||||
|
|
||||||
|
USER fail
|
||||||
|
|
||||||
|
# Clone FAIL* targets
|
||||||
|
# Break docker layer cache
|
||||||
|
ARG CACHE_DATE=1970-01-01
|
||||||
|
WORKDIR /home/fail
|
||||||
|
# RUN git clone https://github.com/danceos/fail-targets.git
|
||||||
|
RUN git clone https://gitea.vps.chriphost.de/christoph/fail-targets
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Resultbrowser
|
||||||
|
EXPOSE 5000
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
[client]
|
[client]
|
||||||
host=mysql
|
host=fail-db
|
||||||
user=fail
|
user=fail
|
||||||
password=fail
|
password=fail
|
||||||
database=fail
|
database=fail
|
||||||
|
|||||||
@ -1,25 +1,114 @@
|
|||||||
# Inherit from docker container that has the fail source code prepared,
|
# Inherit from docker container that has the fail source code prepared,
|
||||||
# including all tools which are needed to build FAIL*
|
# including all tools which are needed to build FAIL*
|
||||||
FROM danceos/fail-base
|
FROM fail-base
|
||||||
MAINTAINER Christian Dietrich <stettberger@dokucode.de>
|
|
||||||
|
LABEL org.opencontainers.image.authors="Christian Dietrich <stettberger@dokucode.de>"
|
||||||
|
|
||||||
USER fail
|
USER fail
|
||||||
|
|
||||||
# Configure the Weather Monitor Experiment
|
# Configure the Weather Monitor Experiment
|
||||||
ENV PATH /home/fail/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
ENV PATH=/home/fail/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
WORKDIR /home/fail/fail
|
WORKDIR /home/fail/fail
|
||||||
RUN mkdir build-tracer; cd build-tracer; ../configurations/x86_pruning.sh generic-tracing
|
RUN mkdir build-tracer && cd build-tracer
|
||||||
WORKDIR build-tracer
|
WORKDIR build-tracer
|
||||||
|
|
||||||
# Make FAIL*
|
RUN cmake \
|
||||||
RUN make -j$(getconf _NPROCESSORS_ONLN) || make -j$(getconf _NPROCESSORS_ONLN)
|
-DAGXX=/home/fail/bin/ag++ \
|
||||||
|
-DBOOST_THREAD_LIBRARY=/usr/lib/x86_64-linux-gnu/libpthread.so \
|
||||||
|
# Enable / Disable features \
|
||||||
|
-DBUILD_ARM=OFF \
|
||||||
|
-DBUILD_BOCHS=ON \
|
||||||
|
-DBUILD_CAPSTONE_DISASSEMBLER=OFF \
|
||||||
|
-DBUILD_COMPUTE_HOPS=OFF \
|
||||||
|
-DBUILD_CONVERT_TRACE=OFF \
|
||||||
|
-DBUILD_DATA_AGGREGATOR=OFF \
|
||||||
|
-DBUILD_DUMP_HOPS=OFF \
|
||||||
|
-DBUILD_DUMP_TRACE=ON \
|
||||||
|
-DBUILD_FAULTSPACEPLOT=OFF \
|
||||||
|
-DBUILD_GEM5=OFF \
|
||||||
|
-DBUILD_IMPORT_TRACE=ON \
|
||||||
|
-DBUILD_LLVM_DISASSEMBLER=ON \
|
||||||
|
-DBUILD_PANDA=OFF \
|
||||||
|
-DBUILD_PRUNE_TRACE=ON \
|
||||||
|
-DBUILD_QEMU=OFF \
|
||||||
|
-DBUILD_T32=OFF \
|
||||||
|
-DBUILD_X86=ON \
|
||||||
|
# \
|
||||||
|
-DCLIENT_JOB_INITIAL=1 \
|
||||||
|
-DCLIENT_JOB_LIMIT=1000 \
|
||||||
|
-DCLIENT_JOB_REQUEST_SEC=30 \
|
||||||
|
-DCLIENT_RAND_BACKOFF_TEND=8 \
|
||||||
|
-DCLIENT_RAND_BACKOFF_TSTART=3 \
|
||||||
|
-DCLIENT_RETRY_COUNT=3 \
|
||||||
|
# ;-separated list \
|
||||||
|
-DCMAKE_AGPP_FLAGS="-D__NO_MATH_INLINES" \
|
||||||
|
# \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||||
|
-DCONFIG_BOCHS_COMPRESS_STATE=ON \
|
||||||
|
-DCONFIG_BOCHS_NON_VERBOSE=OFF \
|
||||||
|
-DCONFIG_BOCHS_NO_ABORT=ON \
|
||||||
|
-DCONFIG_DISABLE_KEYB_INTERRUPTS=OFF \
|
||||||
|
-DCONFIG_EVENT_BREAKPOINTS=ON \
|
||||||
|
-DCONFIG_EVENT_BREAKPOINTS_RANGE=ON \
|
||||||
|
-DCONFIG_EVENT_GUESTSYS=ON \
|
||||||
|
-DCONFIG_EVENT_INTERRUPT=ON \
|
||||||
|
-DCONFIG_EVENT_IOPORT=ON \
|
||||||
|
-DCONFIG_EVENT_JUMP=OFF \
|
||||||
|
-DCONFIG_EVENT_MEMREAD=ON \
|
||||||
|
-DCONFIG_EVENT_MEMWRITE=ON \
|
||||||
|
-DCONFIG_EVENT_TRAP=ON \
|
||||||
|
-DCONFIG_FAST_BREAKPOINTS=ON \
|
||||||
|
-DCONFIG_FAST_WATCHPOINTS=ON \
|
||||||
|
-DCONFIG_FIRE_INTERRUPTS=ON \
|
||||||
|
-DCONFIG_INJECTIONPOINT_HOPS=OFF \
|
||||||
|
-DCONFIG_SR_REBOOT=ON \
|
||||||
|
-DCONFIG_SR_RESTORE=ON \
|
||||||
|
-DCONFIG_SR_SAVE=ON \
|
||||||
|
-DCONFIG_SUPPRESS_INTERRUPTS=ON \
|
||||||
|
-DENABLE_DATABASE_TESTS=OFF \
|
||||||
|
# ;-separated list \
|
||||||
|
-DEXPERIMENTS_ACTIVATED="generic-tracing" \
|
||||||
|
# \
|
||||||
|
-DLibIberty_INCLUDE_DIRS=/usr/include/libiberty \
|
||||||
|
-DLibIberty_LIBRARIES=/usr/lib/x86_64-linux-gnu/libiberty.a \
|
||||||
|
-DMYSQL_CONFIG=/usr/bin/mysql_config \
|
||||||
|
-DMYSQL_CONFIG_PREFER_PATH=/bin \
|
||||||
|
# ;-separated list \
|
||||||
|
-DPLUGINS_ACTIVATED="tracing;serialoutput" \
|
||||||
|
# \
|
||||||
|
-DSERVER_COMM_HOSTNAME=localhost \
|
||||||
|
-DSERVER_COMM_TCP_PORT=1111 \
|
||||||
|
-DSERVER_OUT_QUEUE_SIZE=0 \
|
||||||
|
-DSERVER_PERFORMANCE_MEASURE=OFF \
|
||||||
|
-DSERVER_PERF_LOG_PATH=perf.log \
|
||||||
|
-DSERVER_PERF_STEPPING_SEC=1 \
|
||||||
|
-DTEST_MYSQL_DATABASE=fail_test \
|
||||||
|
-DTEST_MYSQL_HOST=localhost \
|
||||||
|
-DTEST_MYSQL_PASSWORD=fail_test \
|
||||||
|
-DTEST_MYSQL_PORT=3306 \
|
||||||
|
-DTEST_MYSQL_USER=fail_test \
|
||||||
|
-DVERBOSE_MAKE=OFF \
|
||||||
|
-D_filename=/usr/include/wx-3.0/wx/version.h \
|
||||||
|
# ;-separated list \
|
||||||
|
-Dbochs_configure_params="--enable-a20-pin;--enable-x86-64;--enable-cpu-level=6;--enable-ne2000;--enable-acpi;--enable-pci;--enable-usb;--enable-trace-cache;--enable-fast-function-calls;--enable-host-specific-asms;--enable-disasm;--enable-readline;--enable-clgd54xx;--enable-fpu;--enable-vmx=2;--enable-monitor-mwait;--enable-cdrom;--enable-sb16=linux;--enable-gdb-stub;--disable-docbook;--with-nogui;--with-x11;--with-wx;--with-sdl" \
|
||||||
|
# \
|
||||||
|
-Dbochs_install_prefix=/home/fail/fail/simulators/bochs/install \
|
||||||
|
..
|
||||||
|
|
||||||
RUN ln -s /home/fail/fail/build-tracer/bin/fail-client /home/fail/bin/fail-x86-tracing; \
|
# We need to manually build Bochs first to generate the bochs/config.h - the external_project configure step
|
||||||
ln -s /home/fail/fail/build-tracer/bin/import-trace /home/fail/bin/; \
|
# (where this file is generated) is run at build time (not configure time), but the build order is not defined correctly.
|
||||||
ln -s /home/fail/fail/build-tracer/bin/prune-trace /home/fail/bin/; \
|
# RUN cmake --build . --target libfailbochs_external-configure \
|
||||||
ln -s /home/fail/fail/build-tracer/bin/dump-trace /home/fail/bin/; \
|
# && cmake --build .
|
||||||
ln -s /home/fail/fail/build-tracer/bin/convert-trace /home/fail/bin/; \
|
RUN cmake --build . --target libfailbochs_external-configure -- -j$(nproc) \
|
||||||
cp /home/fail/fail/tools/bochs-experiment-runner/bochs-experiment-runner.py /home/fail/bin/bochs-experiment-runner.py; \
|
&& cmake --build . -- -j$(nproc)
|
||||||
chmod a+x /home/fail/bin/bochs-experiment-runner.py;
|
|
||||||
|
RUN ln -s /home/fail/fail/build-tracer/bin/fail-client /home/fail/bin/generic-tracing-client \
|
||||||
|
&& ln -s /home/fail/fail/build-tracer/bin/import-trace /home/fail/bin/ \
|
||||||
|
&& ln -s /home/fail/fail/build-tracer/bin/prune-trace /home/fail/bin/ \
|
||||||
|
&& ln -s /home/fail/fail/build-tracer/bin/dump-trace /home/fail/bin/ \
|
||||||
|
&& ln -s /home/fail/fail/build-tracer/bin/convert-trace /home/fail/bin/ \
|
||||||
|
&& ln -s /home/fail/fail/tools/bochs-experiment-runner/bochs-experiment-runner.py /home/fail/bin/ \
|
||||||
|
&& chmod a+x /home/fail/bin/bochs-experiment-runner.py
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|||||||
162
scripts/fail-cleanup-db.sh
Executable file
162
scripts/fail-cleanup-db.sh
Executable file
@ -0,0 +1,162 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# This script removes dangling rows from the database, for example 'trace'
|
||||||
|
# entries with a variant_id not mentioned in the 'variants' table, or result
|
||||||
|
# rows referencing a nonexistent 'fsppilot' entry. IOW, this script enforces
|
||||||
|
# referential integrity as it would be maintained by foreign key constraints
|
||||||
|
# (that can only be used with InnoDB tables).
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ -z "$1" -o -z "$2" ]
|
||||||
|
then
|
||||||
|
echo "usage: $0 dbname resulttable" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
DB=$1
|
||||||
|
RESULT=$2
|
||||||
|
MYSQL=mysql
|
||||||
|
|
||||||
|
function table_exists()
|
||||||
|
{
|
||||||
|
N=$(echo "SHOW TABLES LIKE '$1'" | $MYSQL $DB | wc -l)
|
||||||
|
[ $N -gt 0 ]
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if table_exists trace
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in trace ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE FROM trace
|
||||||
|
WHERE variant_id NOT IN
|
||||||
|
(SELECT id FROM variant);
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists fsppilot
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in fsppilot ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE p FROM fsppilot p
|
||||||
|
LEFT JOIN trace t
|
||||||
|
ON p.variant_id = t.variant_id
|
||||||
|
AND p.instr2 = t.instr2
|
||||||
|
AND p.data_address = t.data_address
|
||||||
|
WHERE t.variant_id IS NULL;
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists fspgroup
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in fspgroup ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE g FROM fspgroup g
|
||||||
|
LEFT JOIN fsppilot p
|
||||||
|
ON g.pilot_id = p.id
|
||||||
|
WHERE p.id IS NULL;
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists $RESULT
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in $RESULT ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE r FROM $RESULT r
|
||||||
|
LEFT JOIN fsppilot p
|
||||||
|
ON r.pilot_id = p.id
|
||||||
|
WHERE p.id IS NULL;
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists objdump
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in objdump ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE FROM objdump
|
||||||
|
WHERE variant_id NOT IN
|
||||||
|
(SELECT id FROM variant);
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists fulltrace
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in fulltrace ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE FROM fulltrace
|
||||||
|
WHERE variant_id NOT IN
|
||||||
|
(SELECT id FROM variant);
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists dbg_source
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in dbg_source ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE FROM dbg_source
|
||||||
|
WHERE variant_id NOT IN
|
||||||
|
(SELECT id FROM variant);
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists dbg_filename
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in dbg_filename ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE FROM dbg_filename
|
||||||
|
WHERE variant_id NOT IN
|
||||||
|
(SELECT id FROM variant);
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists dbg_mapping
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in dbg_mapping ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE FROM dbg_mapping
|
||||||
|
WHERE variant_id NOT IN
|
||||||
|
(SELECT id FROM variant);
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if table_exists symbol
|
||||||
|
then
|
||||||
|
echo -n "removing widowed entries in symbol ..."
|
||||||
|
echo " "$(
|
||||||
|
$MYSQL $DB <<EOT
|
||||||
|
DELETE FROM symbol
|
||||||
|
WHERE variant_id NOT IN
|
||||||
|
(SELECT id FROM variant);
|
||||||
|
SELECT ROW_COUNT() AS "deleted rows:";
|
||||||
|
EOT
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "done. Consider running \`mysqloptimize $DB' now."
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# fail-env.sh
|
# fail-env.sh
|
||||||
# default values for several Fail* environment variables
|
# default values for several FAIL* environment variables
|
||||||
# If you want to set your own defaults, or need a script to source from, e.g.,
|
# If you want to set your own defaults, or need a script to source from, e.g.,
|
||||||
# your ~/.bashrc, please copy this file and do not edit it in-place.
|
# your ~/.bashrc, please copy this file and do not edit it in-place.
|
||||||
#
|
#
|
||||||
@ -9,16 +9,16 @@
|
|||||||
# A whitespace-separated list of hosts to rsync the experiment data to. This
|
# A whitespace-separated list of hosts to rsync the experiment data to. This
|
||||||
# is not necessarily the same list as FAIL_EXPERIMENT_HOSTS (see below), as
|
# is not necessarily the same list as FAIL_EXPERIMENT_HOSTS (see below), as
|
||||||
# many hosts may share their homes via NFS.
|
# many hosts may share their homes via NFS.
|
||||||
export FAIL_DISTRIBUTE_HOSTS=${FAIL_DISTRIBUTE_HOSTS:="ios kos virtuos plutonium bigbox.informatik.uni-erlangen.de ls12sp $(for hostnr in $(seq 39 58); do echo -n cloudhost$hostnr\ ; done)"}
|
export FAIL_DISTRIBUTE_HOSTS=${FAIL_DISTRIBUTE_HOSTS:-"ios kos virtuos plutonium bigbox.informatik.uni-erlangen.de ls12sp $(for hostnr in $(seq 39 58); do echo -n cloudhost$hostnr\ ; done)"}
|
||||||
|
|
||||||
# A whitespace-separated list of hosts to run experiments on. If the host name
|
# A whitespace-separated list of hosts to run experiments on. If the host name
|
||||||
# is followed by a ':' and a number, this specifies the number of clients to
|
# is followed by a ':' and a number, this specifies the number of clients to
|
||||||
# run on that host (defaults to #CPUs).
|
# run on that host (defaults to #CPUs).
|
||||||
export FAIL_EXPERIMENT_HOSTS=${FAIL_EXPERIMENT_HOSTS:="bigbox.informatik.uni-erlangen.de plutonium:4 uran:4 virtuos ios:32 kos:16 bohrium:12 polonium:12 radon $(for hostnr in $(seq 100 254); do echo -n fiws$hostnr\ ; done) $(for hostnr in $(seq 39 58); do echo -n cloudhost$hostnr\ ; done)"}
|
export FAIL_EXPERIMENT_HOSTS=${FAIL_EXPERIMENT_HOSTS:-"bigbox.informatik.uni-erlangen.de plutonium:4 uran:4 virtuos ios:32 kos:16 bohrium:12 polonium:12 radon $(for hostnr in $(seq 100 254); do echo -n fiws$hostnr\ ; done) $(for hostnr in $(seq 39 58); do echo -n cloudhost$hostnr\ ; done)"}
|
||||||
|
|
||||||
# A homedir-relative directory on the distribution hosts where all necessary
|
# A homedir-relative directory on the distribution hosts where all necessary
|
||||||
# Fail* ingredients reside (see multiple-clients.sh).
|
# FAIL* ingredients reside (see multiple-clients.sh).
|
||||||
export FAIL_EXPERIMENT_TARGETDIR=${FAIL_EXPERIMENT_TARGETDIR:=.fail-experiment}
|
export FAIL_EXPERIMENT_TARGETDIR=${FAIL_EXPERIMENT_TARGETDIR:-.fail-experiment}
|
||||||
|
|
||||||
# Number of parallel build processes. If unset, #CPUs+1.
|
# Number of parallel build processes. If unset, #CPUs+1.
|
||||||
if [ -z "$FAIL_BUILD_PARALLEL" ]; then
|
if [ -z "$FAIL_BUILD_PARALLEL" ]; then
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# ab-fail-env.sh (Adrian Böckenkamp)
|
# ab-fail-env.sh (Adrian Böckenkamp)
|
||||||
# default values for several Fail* environment variables
|
# default values for several FAIL* environment variables
|
||||||
#
|
#
|
||||||
|
|
||||||
# A whitespace-separated list of hosts to rsync the experiment data to. This
|
# A whitespace-separated list of hosts to rsync the experiment data to. This
|
||||||
@ -15,5 +15,5 @@ export FAIL_DISTRIBUTE_HOSTS=${FAIL_DISTRIBUTE_HOSTS:='kos plutonium'}
|
|||||||
export FAIL_EXPERIMENT_HOSTS=${FAIL_EXPERIMENT_HOSTS:="plutonium uran kos:6 bohrium polonium radon $(for hostnr in $(seq 100 254); do echo fiws$hostnr; done)"}
|
export FAIL_EXPERIMENT_HOSTS=${FAIL_EXPERIMENT_HOSTS:="plutonium uran kos:6 bohrium polonium radon $(for hostnr in $(seq 100 254); do echo fiws$hostnr; done)"}
|
||||||
|
|
||||||
# A homedir-relative directory on the distribution hosts where all necessary
|
# A homedir-relative directory on the distribution hosts where all necessary
|
||||||
# Fail* ingredients reside (see multiple-clients.sh).
|
# FAIL* ingredients reside (see multiple-clients.sh).
|
||||||
export FAIL_EXPERIMENT_TARGETDIR=.fail-experiment
|
export FAIL_EXPERIMENT_TARGETDIR=.fail-experiment
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# - needs to be called from within your build directory
|
# - needs to be called from within your build directory
|
||||||
# - "rebuild-bochs.sh": rebuild all of both Fail* and Bochs
|
# - "rebuild-bochs.sh": rebuild all of both FAIL* and Bochs
|
||||||
# (e.g., possibly necessary if you don't understand what was changed by others)
|
# (e.g., possibly necessary if you don't understand what was changed by others)
|
||||||
# - "rebuild-bochs.sh fail": rebuild all of Fail* and link fail-client
|
# - "rebuild-bochs.sh fail": rebuild all of FAIL* and link fail-client
|
||||||
# (e.g., possibly necessary if you changed Fail-affecting aspects or the
|
# (e.g., possibly necessary if you changed Fail-affecting aspects or the
|
||||||
# build system)
|
# build system)
|
||||||
# - "rebuild-bochs.sh bochs": rebuild all of Bochs and link fail-client
|
# - "rebuild-bochs.sh bochs": rebuild all of Bochs and link fail-client
|
||||||
# (e.g., necessary if you changed Bochs-affecting aspects/code that must be
|
# (e.g., necessary if you changed Bochs-affecting aspects/code that must be
|
||||||
# inlined in Bochs)
|
# inlined in Bochs)
|
||||||
# - "rebuild-bochs.sh -": rebuild only changed parts of Fail* and Bochs
|
# - "rebuild-bochs.sh -": rebuild only changed parts of FAIL* and Bochs
|
||||||
# (e.g., sufficient if you only changed experiment code)
|
# (e.g., sufficient if you only changed experiment code)
|
||||||
#
|
#
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
if(EXISTS $ENV{T32SYS})
|
if(EXISTS $ENV{T32SYS})
|
||||||
SET(T32_SYS $ENV{T32SYS})
|
SET(T32_SYS $ENV{T32SYS})
|
||||||
message(STATUS "[Fail*] T32 base directory: T32SYS=${T32_SYS}")
|
message(STATUS "[FAIL*] T32 base directory: T32SYS=${T32_SYS}")
|
||||||
else()
|
else()
|
||||||
SET(T32_SYS "/proj/i4ciao/tools/t32-20130226-qt") ## defaulting to I4 installation
|
SET(T32_SYS "/proj/i4ciao/tools/t32-20130226-qt") ## defaulting to I4 installation
|
||||||
#message(FATAL_ERROR "Please set env variable T32SYS to a valid T32 installation base directory.")
|
#message(FATAL_ERROR "Please set env variable T32SYS to a valid T32 installation base directory.")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "[Fail*] T32 base directory: T32SYS=${T32_SYS}")
|
message(STATUS "[FAIL*] T32 base directory: T32SYS=${T32_SYS}")
|
||||||
|
|
||||||
if(EXISTS $ENV{FAIL_ELF_PATH})
|
if(EXISTS $ENV{FAIL_ELF_PATH})
|
||||||
SET(T32_ELF_PATH $ENV{FAIL_ELF_PATH})
|
SET(T32_ELF_PATH $ENV{FAIL_ELF_PATH})
|
||||||
message(STATUS "[Fail*] T32 ELF under test: ${T32_ELF_PATH}")
|
message(STATUS "[FAIL*] T32 ELF under test: ${T32_ELF_PATH}")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Please set the FAIL_ELF_PATH enviroment variable to the binary under test.")
|
message(FATAL_ERROR "Please set the FAIL_ELF_PATH enviroment variable to the binary under test.")
|
||||||
endif()
|
endif()
|
||||||
@ -34,9 +34,9 @@ set(T32_EXE "${T32_SYS}/bin/pc_linux64/" CACHE INTERNAL "") # TODO: set pc_linux
|
|||||||
add_subdirectory(${T32_ARCHITECTURE})
|
add_subdirectory(${T32_ARCHITECTURE})
|
||||||
|
|
||||||
|
|
||||||
message(STATUS "[Fail*] T32 Architecture: ${T32_ARCHITECTURE}")
|
message(STATUS "[FAIL*] T32 Architecture: ${T32_ARCHITECTURE}")
|
||||||
message(STATUS "[Fail*] T32 CPU name: ${T32_CPUNAME}")
|
message(STATUS "[FAIL*] T32 CPU name: ${T32_CPUNAME}")
|
||||||
message(STATUS "[Fail*] T32 Executable: ${T32_EXE}")
|
message(STATUS "[FAIL*] T32 Executable: ${T32_EXE}")
|
||||||
|
|
||||||
add_custom_target(runt32
|
add_custom_target(runt32
|
||||||
COMMAND T32CONFIG=${PROJECT_BINARY_DIR}/cmm/config.t32 T32SYS=${T32_SYS} ${T32_EXE} &
|
COMMAND T32CONFIG=${PROJECT_BINARY_DIR}/cmm/config.t32 T32SYS=${T32_SYS} ${T32_EXE} &
|
||||||
|
|||||||
@ -908,11 +908,11 @@ void bx_dbg_info_segment_regs_command(void)
|
|||||||
(unsigned) sreg.des_l, (unsigned) sreg.valid);
|
(unsigned) sreg.des_l, (unsigned) sreg.valid);
|
||||||
|
|
||||||
BX_CPU(dbg_cpu)->dbg_get_gdtr(&global_sreg);
|
BX_CPU(dbg_cpu)->dbg_get_gdtr(&global_sreg);
|
||||||
dbg_printf("gdtr:base=0x"FMT_ADDRX", limit=0x%x\n",
|
dbg_printf("gdtr:base=0x" FMT_ADDRX ", limit=0x%x\n",
|
||||||
global_sreg.base, (unsigned) global_sreg.limit);
|
global_sreg.base, (unsigned) global_sreg.limit);
|
||||||
|
|
||||||
BX_CPU(dbg_cpu)->dbg_get_idtr(&global_sreg);
|
BX_CPU(dbg_cpu)->dbg_get_idtr(&global_sreg);
|
||||||
dbg_printf("idtr:base=0x"FMT_ADDRX", limit=0x%x\n",
|
dbg_printf("idtr:base=0x" FMT_ADDRX ", limit=0x%x\n",
|
||||||
global_sreg.base, (unsigned) global_sreg.limit);
|
global_sreg.base, (unsigned) global_sreg.limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1610,18 +1610,18 @@ void bx_dbg_print_watchpoints(void)
|
|||||||
// print watch point info
|
// print watch point info
|
||||||
for (i = 0; i < num_read_watchpoints; i++) {
|
for (i = 0; i < num_read_watchpoints; i++) {
|
||||||
if (BX_MEM(0)->dbg_fetch_mem(BX_CPU(dbg_cpu), read_watchpoint[i].addr, 2, buf))
|
if (BX_MEM(0)->dbg_fetch_mem(BX_CPU(dbg_cpu), read_watchpoint[i].addr, 2, buf))
|
||||||
dbg_printf("rd 0x"FMT_PHY_ADDRX" len=%d\t\t(%04x)\n",
|
dbg_printf("rd 0x" FMT_PHY_ADDRX " len=%d\t\t(%04x)\n",
|
||||||
read_watchpoint[i].addr, read_watchpoint[i].len, (int)buf[0] | ((int)buf[1] << 8));
|
read_watchpoint[i].addr, read_watchpoint[i].len, (int)buf[0] | ((int)buf[1] << 8));
|
||||||
else
|
else
|
||||||
dbg_printf("rd 0x"FMT_PHY_ADDRX" len=%d\t\t(read error)\n",
|
dbg_printf("rd 0x" FMT_PHY_ADDRX " len=%d\t\t(read error)\n",
|
||||||
read_watchpoint[i].addr, read_watchpoint[i].len);
|
read_watchpoint[i].addr, read_watchpoint[i].len);
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_write_watchpoints; i++) {
|
for (i = 0; i < num_write_watchpoints; i++) {
|
||||||
if (BX_MEM(0)->dbg_fetch_mem(BX_CPU(dbg_cpu), write_watchpoint[i].addr, 2, buf))
|
if (BX_MEM(0)->dbg_fetch_mem(BX_CPU(dbg_cpu), write_watchpoint[i].addr, 2, buf))
|
||||||
dbg_printf("wr 0x"FMT_PHY_ADDRX" len=%d\t\t(%04x)\n",
|
dbg_printf("wr 0x" FMT_PHY_ADDRX " len=%d\t\t(%04x)\n",
|
||||||
write_watchpoint[i].addr, write_watchpoint[i].len, (int)buf[0] | ((int)buf[1] << 8));
|
write_watchpoint[i].addr, write_watchpoint[i].len, (int)buf[0] | ((int)buf[1] << 8));
|
||||||
else
|
else
|
||||||
dbg_printf("rd 0x"FMT_PHY_ADDRX" len=%d\t\t(read error)\n",
|
dbg_printf("rd 0x" FMT_PHY_ADDRX " len=%d\t\t(read error)\n",
|
||||||
write_watchpoint[i].addr, write_watchpoint[i].len);
|
write_watchpoint[i].addr, write_watchpoint[i].len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1861,7 +1861,7 @@ void bx_dbg_disassemble_current(int which_cpu, int print_time)
|
|||||||
dbg_printf("(%u) ", which_cpu);
|
dbg_printf("(%u) ", which_cpu);
|
||||||
|
|
||||||
if (BX_CPU(which_cpu)->protected_mode()) {
|
if (BX_CPU(which_cpu)->protected_mode()) {
|
||||||
dbg_printf("[0x"FMT_PHY_ADDRX"] %04x:" FMT_ADDRX " (%s): ",
|
dbg_printf("[0x" FMT_PHY_ADDRX "] %04x:" FMT_ADDRX " (%s): ",
|
||||||
phy, BX_CPU(which_cpu)->guard_found.cs,
|
phy, BX_CPU(which_cpu)->guard_found.cs,
|
||||||
BX_CPU(which_cpu)->guard_found.eip,
|
BX_CPU(which_cpu)->guard_found.eip,
|
||||||
bx_dbg_symbolic_address(BX_CPU(which_cpu)->cr3 >> 12,
|
bx_dbg_symbolic_address(BX_CPU(which_cpu)->cr3 >> 12,
|
||||||
@ -1869,7 +1869,7 @@ void bx_dbg_disassemble_current(int which_cpu, int print_time)
|
|||||||
BX_CPU(which_cpu)->get_segment_base(BX_SEG_REG_CS)));
|
BX_CPU(which_cpu)->get_segment_base(BX_SEG_REG_CS)));
|
||||||
}
|
}
|
||||||
else { // Real & V86 mode
|
else { // Real & V86 mode
|
||||||
dbg_printf("[0x"FMT_PHY_ADDRX"] %04x:%04x (%s): ",
|
dbg_printf("[0x" FMT_PHY_ADDRX "] %04x:%04x (%s): ",
|
||||||
phy, BX_CPU(which_cpu)->guard_found.cs,
|
phy, BX_CPU(which_cpu)->guard_found.cs,
|
||||||
(unsigned) BX_CPU(which_cpu)->guard_found.eip,
|
(unsigned) BX_CPU(which_cpu)->guard_found.eip,
|
||||||
bx_dbg_symbolic_address_16bit(BX_CPU(which_cpu)->guard_found.eip,
|
bx_dbg_symbolic_address_16bit(BX_CPU(which_cpu)->guard_found.eip,
|
||||||
@ -2250,7 +2250,7 @@ void bx_dbg_info_bpoints_command(void)
|
|||||||
dbg_printf("pbreakpoint ");
|
dbg_printf("pbreakpoint ");
|
||||||
dbg_printf("keep ");
|
dbg_printf("keep ");
|
||||||
dbg_printf(bx_guard.iaddr.phy[i].enabled?"y ":"n ");
|
dbg_printf(bx_guard.iaddr.phy[i].enabled?"y ":"n ");
|
||||||
dbg_printf("0x"FMT_PHY_ADDRX"\n", bx_guard.iaddr.phy[i].addr);
|
dbg_printf("0x" FMT_PHY_ADDRX "\n", bx_guard.iaddr.phy[i].addr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -2973,7 +2973,7 @@ void bx_dbg_print_descriptor64(Bit32u lo1, Bit32u hi1, Bit32u lo2, Bit32u hi2)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// task, int, trap, or call gate.
|
// task, int, trap, or call gate.
|
||||||
dbg_printf("target=0x%04x:"FMT_ADDRX", DPL=%d", segment, offset, dpl);
|
dbg_printf("target=0x%04x:" FMT_ADDRX ", DPL=%d", segment, offset, dpl);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3464,7 +3464,7 @@ void bx_dbg_dump_table(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("cr3: 0x"FMT_PHY_ADDRX"\n", BX_CPU(dbg_cpu)->cr3);
|
printf("cr3: 0x" FMT_PHY_ADDRX "\n", BX_CPU(dbg_cpu)->cr3);
|
||||||
|
|
||||||
lin = 0;
|
lin = 0;
|
||||||
phy = 0;
|
phy = 0;
|
||||||
@ -3476,14 +3476,14 @@ void bx_dbg_dump_table(void)
|
|||||||
if(valid) {
|
if(valid) {
|
||||||
if((lin - start_lin) != (phy - start_phy)) {
|
if((lin - start_lin) != (phy - start_phy)) {
|
||||||
if(start_lin != 1)
|
if(start_lin != 1)
|
||||||
dbg_printf("0x%08x-0x%08x -> 0x"FMT_PHY_ADDRX"-0x"FMT_PHY_ADDRX"\n",
|
dbg_printf("0x%08x-0x%08x -> 0x" FMT_PHY_ADDRX "-0x" FMT_PHY_ADDRX "\n",
|
||||||
start_lin, lin - 1, start_phy, start_phy + (lin-1-start_lin));
|
start_lin, lin - 1, start_phy, start_phy + (lin-1-start_lin));
|
||||||
start_lin = lin;
|
start_lin = lin;
|
||||||
start_phy = phy;
|
start_phy = phy;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(start_lin != 1)
|
if(start_lin != 1)
|
||||||
dbg_printf("0x%08x-0x%08x -> 0x"FMT_PHY_ADDRX"-0x"FMT_PHY_ADDRX"\n",
|
dbg_printf("0x%08x-0x%08x -> 0x" FMT_PHY_ADDRX "-0x" FMT_PHY_ADDRX "\n",
|
||||||
start_lin, lin - 1, start_phy, start_phy + (lin-1-start_lin));
|
start_lin, lin - 1, start_phy, start_phy + (lin-1-start_lin));
|
||||||
start_lin = 1;
|
start_lin = 1;
|
||||||
start_phy = 2;
|
start_phy = 2;
|
||||||
@ -3493,7 +3493,7 @@ void bx_dbg_dump_table(void)
|
|||||||
lin += 0x1000;
|
lin += 0x1000;
|
||||||
}
|
}
|
||||||
if(start_lin != 1)
|
if(start_lin != 1)
|
||||||
dbg_printf("0x%08x-0x%08x -> 0x"FMT_PHY_ADDRX"-0x"FMT_PHY_ADDRX"\n",
|
dbg_printf("0x%08x-0x%08x -> 0x" FMT_PHY_ADDRX "-0x" FMT_PHY_ADDRX "\n",
|
||||||
start_lin, 0xffffffff, start_phy, start_phy + (0xffffffff-start_lin));
|
start_lin, 0xffffffff, start_phy, start_phy + (0xffffffff-start_lin));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3477,7 +3477,7 @@ int bx_write_atadevice_options(FILE *fp, Bit8u channel, Bit8u drive, bx_list_c *
|
|||||||
|
|
||||||
fprintf(fp, ", biosdetect=%s", SIM->get_param_enum("biosdetect", base)->get_selected());
|
fprintf(fp, ", biosdetect=%s", SIM->get_param_enum("biosdetect", base)->get_selected());
|
||||||
|
|
||||||
if (SIM->get_param_string("model", base)->getptr()>0) {
|
if (SIM->get_param_string("model", base)->getptr()) {
|
||||||
fprintf(fp, ", model=\"%s\"", SIM->get_param_string("model", base)->getptr());
|
fprintf(fp, ", model=\"%s\"", SIM->get_param_string("model", base)->getptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1019
simulators/bochs/configure
vendored
1019
simulators/bochs/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1915,9 +1915,16 @@ if test x$WX_CONFIG != xnot_found; then
|
|||||||
case x$WX_BASENAME in
|
case x$WX_BASENAME in
|
||||||
xwx_gtk2|xwx_gtk2u) wx_needs_gtk2=1 ;;
|
xwx_gtk2|xwx_gtk2u) wx_needs_gtk2=1 ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
|
x3*) # version 3
|
||||||
|
ok_wx_version=1
|
||||||
|
wx_multi_lib=1
|
||||||
|
case x$WX_BASENAME in
|
||||||
|
xwx_gtk2|xwx_gtk2u) wx_needs_gtk2=1 ;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
x[3-9]*) ok_wx_version=1 ;; # version 3 or greater
|
|
||||||
*) ;; # who knows?
|
*) ;; # who knows?
|
||||||
esac
|
esac
|
||||||
]
|
]
|
||||||
|
|||||||
@ -151,16 +151,22 @@ void BX_CPU_C::cpu_loop(Bit32u max_instr_count)
|
|||||||
debug_disasm_instruction(BX_CPU_THIS_PTR prev_rip);
|
debug_disasm_instruction(BX_CPU_THIS_PTR prev_rip);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if 0
|
||||||
// DanceOS: Save original instruction length in case we modify the instruction.
|
// DanceOS: Save original instruction length in case we modify the instruction.
|
||||||
unsigned orig_len = i->ilen();
|
unsigned orig_len = i->ilen();
|
||||||
|
#endif
|
||||||
// DanceOS: Aspect "hook"
|
// DanceOS: Aspect "hook"
|
||||||
defineCPULoopJoinPoint(BX_CPU_THIS, i);
|
defineCPULoopJoinPoint(BX_CPU_THIS, i);
|
||||||
|
|
||||||
// instruction decoding completed -> continue with execution
|
// instruction decoding completed -> continue with execution
|
||||||
// want to allow changing of the instruction inside instrumentation callback
|
// want to allow changing of the instruction inside instrumentation callback
|
||||||
BX_INSTR_BEFORE_EXECUTION(BX_CPU_ID, i);
|
BX_INSTR_BEFORE_EXECUTION(BX_CPU_ID, i);
|
||||||
|
#if 0
|
||||||
// DanceOS: Use original length (see above).
|
// DanceOS: Use original length (see above).
|
||||||
RIP += orig_len;
|
RIP += orig_len;
|
||||||
|
#else
|
||||||
|
RIP += i->ilen();
|
||||||
|
#endif
|
||||||
BX_CPU_CALL_METHOD(i->execute, (i)); // might iterate repeat instruction
|
BX_CPU_CALL_METHOD(i->execute, (i)); // might iterate repeat instruction
|
||||||
BX_CPU_THIS_PTR prev_rip = RIP; // commit new RIP
|
BX_CPU_THIS_PTR prev_rip = RIP; // commit new RIP
|
||||||
BX_INSTR_AFTER_EXECUTION(BX_CPU_ID, i);
|
BX_INSTR_AFTER_EXECUTION(BX_CPU_ID, i);
|
||||||
@ -645,6 +651,29 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
|
|||||||
// Code page fault (priority 7 on 486/Pentium)
|
// Code page fault (priority 7 on 486/Pentium)
|
||||||
// (handled in main decode loop)
|
// (handled in main decode loop)
|
||||||
|
|
||||||
|
// Now we can handle things which are synchronous to instruction
|
||||||
|
// execution.
|
||||||
|
if (BX_CPU_THIS_PTR get_RF()) {
|
||||||
|
BX_CPU_THIS_PTR clear_RF();
|
||||||
|
}
|
||||||
|
#if BX_X86_DEBUGGER
|
||||||
|
else {
|
||||||
|
// only bother comparing if any breakpoints enabled and
|
||||||
|
// debug events are not inhibited on this boundary.
|
||||||
|
if (! (BX_CPU_THIS_PTR inhibit_mask & BX_INHIBIT_DEBUG_SHADOW) && ! BX_CPU_THIS_PTR in_repeat) {
|
||||||
|
code_breakpoint_match(get_laddr(BX_SEG_REG_CS, BX_CPU_THIS_PTR prev_rip));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (BX_CPU_THIS_PTR get_TF())
|
||||||
|
{
|
||||||
|
// TF is set before execution of next instruction. Schedule
|
||||||
|
// a debug trap (#DB) after execution. After completion of
|
||||||
|
// next instruction, the code above will invoke the trap.
|
||||||
|
BX_CPU_THIS_PTR debug_trap |= BX_DEBUG_SINGLE_STEP_BIT;
|
||||||
|
}
|
||||||
|
|
||||||
// Priority 7: Faults from decoding next instruction
|
// Priority 7: Faults from decoding next instruction
|
||||||
// Instruction length > 15 bytes
|
// Instruction length > 15 bytes
|
||||||
// Illegal opcode
|
// Illegal opcode
|
||||||
@ -663,38 +692,6 @@ unsigned BX_CPU_C::handleAsyncEvent(void)
|
|||||||
// Alignment check
|
// Alignment check
|
||||||
// (handled by rest of the code)
|
// (handled by rest of the code)
|
||||||
|
|
||||||
// Now we can handle things which are synchronous to instruction
|
|
||||||
// execution.
|
|
||||||
if (BX_CPU_THIS_PTR get_RF()) {
|
|
||||||
BX_CPU_THIS_PTR clear_RF();
|
|
||||||
}
|
|
||||||
#if BX_X86_DEBUGGER
|
|
||||||
else {
|
|
||||||
// only bother comparing if any breakpoints enabled and
|
|
||||||
// debug events are not inhibited on this boundary.
|
|
||||||
if (! (BX_CPU_THIS_PTR inhibit_mask & BX_INHIBIT_DEBUG_SHADOW) && ! BX_CPU_THIS_PTR in_repeat) {
|
|
||||||
if (BX_CPU_THIS_PTR dr7 & 0x000000ff) {
|
|
||||||
bx_address iaddr = get_laddr(BX_SEG_REG_CS, BX_CPU_THIS_PTR prev_rip);
|
|
||||||
Bit32u dr6_bits = hwdebug_compare(iaddr, 1, BX_HWDebugInstruction, BX_HWDebugInstruction);
|
|
||||||
if (dr6_bits) {
|
|
||||||
// Add to the list of debug events thus far.
|
|
||||||
BX_CPU_THIS_PTR debug_trap |= dr6_bits;
|
|
||||||
BX_ERROR(("#DB: x86 code breakpoint catched"));
|
|
||||||
exception(BX_DB_EXCEPTION, 0); // no error, not interrupt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (BX_CPU_THIS_PTR get_TF())
|
|
||||||
{
|
|
||||||
// TF is set before execution of next instruction. Schedule
|
|
||||||
// a debug trap (#DB) after execution. After completion of
|
|
||||||
// next instruction, the code above will invoke the trap.
|
|
||||||
BX_CPU_THIS_PTR debug_trap |= BX_DEBUG_SINGLE_STEP_BIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((BX_CPU_INTR && BX_CPU_THIS_PTR get_IF()) ||
|
if (!((BX_CPU_INTR && BX_CPU_THIS_PTR get_IF()) ||
|
||||||
BX_CPU_THIS_PTR debug_trap ||
|
BX_CPU_THIS_PTR debug_trap ||
|
||||||
// BX_CPU_THIS_PTR get_TF() // implies debug_trap is set
|
// BX_CPU_THIS_PTR get_TF() // implies debug_trap is set
|
||||||
|
|||||||
@ -3267,6 +3267,7 @@ public: // for now...
|
|||||||
// x86 hardware debug support
|
// x86 hardware debug support
|
||||||
BX_SMF bx_bool hwbreakpoint_check(bx_address laddr);
|
BX_SMF bx_bool hwbreakpoint_check(bx_address laddr);
|
||||||
BX_SMF void iobreakpoint_match(unsigned port, unsigned len);
|
BX_SMF void iobreakpoint_match(unsigned port, unsigned len);
|
||||||
|
BX_SMF void code_breakpoint_match(bx_address laddr);
|
||||||
BX_SMF void hwbreakpoint_match(bx_address laddr, unsigned len, unsigned rw);
|
BX_SMF void hwbreakpoint_match(bx_address laddr, unsigned len, unsigned rw);
|
||||||
BX_SMF Bit32u hwdebug_compare(bx_address laddr, unsigned len,
|
BX_SMF Bit32u hwdebug_compare(bx_address laddr, unsigned len,
|
||||||
unsigned opa, unsigned opb);
|
unsigned opa, unsigned opb);
|
||||||
|
|||||||
@ -1192,6 +1192,19 @@ bx_bool BX_CPU_C::hwbreakpoint_check(bx_address laddr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BX_CPU_C::code_breakpoint_match(bx_address laddr)
|
||||||
|
{
|
||||||
|
if (BX_CPU_THIS_PTR dr7 & 0x000000ff) {
|
||||||
|
Bit32u dr6_bits = hwdebug_compare(iaddr, 1, BX_HWDebugInstruction, BX_HWDebugInstruction);
|
||||||
|
if (dr6_bits) {
|
||||||
|
// Add to the list of debug events thus far.
|
||||||
|
BX_CPU_THIS_PTR debug_trap |= dr6_bits;
|
||||||
|
BX_ERROR(("#DB: x86 code breakpoint catched"));
|
||||||
|
exception(BX_DB_EXCEPTION, 0); // no error, not interrupt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BX_CPU_C::hwbreakpoint_match(bx_address laddr, unsigned len, unsigned rw)
|
void BX_CPU_C::hwbreakpoint_match(bx_address laddr, unsigned len, unsigned rw)
|
||||||
{
|
{
|
||||||
if (BX_CPU_THIS_PTR dr7 & 0x000000ff) {
|
if (BX_CPU_THIS_PTR dr7 & 0x000000ff) {
|
||||||
|
|||||||
@ -2012,7 +2012,7 @@ modrm_done:
|
|||||||
OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[b3]);
|
OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[b3]);
|
||||||
break;
|
break;
|
||||||
case BxOSizeGrp:
|
case BxOSizeGrp:
|
||||||
OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[offset >> 8]);
|
OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[offset >> 9]);
|
||||||
break;
|
break;
|
||||||
case BxPrefixSSE:
|
case BxPrefixSSE:
|
||||||
/* For SSE opcodes look into another table
|
/* For SSE opcodes look into another table
|
||||||
|
|||||||
@ -424,7 +424,7 @@ void BX_CPU_C::TLB_invlpg(bx_address laddr)
|
|||||||
{
|
{
|
||||||
invalidate_prefetch_q();
|
invalidate_prefetch_q();
|
||||||
|
|
||||||
BX_DEBUG(("TLB_invlpg(0x"FMT_ADDRX"): invalidate TLB entry", laddr));
|
BX_DEBUG(("TLB_invlpg(0x" FMT_ADDRX "): invalidate TLB entry", laddr));
|
||||||
|
|
||||||
#if BX_CPU_LEVEL >= 5
|
#if BX_CPU_LEVEL >= 5
|
||||||
bx_bool large = 0;
|
bx_bool large = 0;
|
||||||
|
|||||||
@ -292,7 +292,7 @@ bx_shadow_num_c::bx_shadow_num_c(bx_param_c *parent,
|
|||||||
val.p64bit = ptr_to_real_val;
|
val.p64bit = ptr_to_real_val;
|
||||||
if (base == BASE_HEX) {
|
if (base == BASE_HEX) {
|
||||||
this->base = base;
|
this->base = base;
|
||||||
this->text_format = "0x"FMT_LL"x";
|
this->text_format = "0x" FMT_LL "x";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ bx_shadow_num_c::bx_shadow_num_c(bx_param_c *parent,
|
|||||||
val.p64bit = (Bit64s*) ptr_to_real_val;
|
val.p64bit = (Bit64s*) ptr_to_real_val;
|
||||||
if (base == BASE_HEX) {
|
if (base == BASE_HEX) {
|
||||||
this->base = base;
|
this->base = base;
|
||||||
this->text_format = "0x"FMT_LL"x";
|
this->text_format = "0x" FMT_LL "x";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1200,7 +1200,7 @@ bx_bool bx_real_sim_c::save_sr_param(FILE *fp, bx_param_c *node, const char *sr_
|
|||||||
fprintf(fp, node->get_format(), value);
|
fprintf(fp, node->get_format(), value);
|
||||||
} else {
|
} else {
|
||||||
if ((Bit64u)((bx_param_num_c*)node)->get_max() > BX_MAX_BIT32U) {
|
if ((Bit64u)((bx_param_num_c*)node)->get_max() > BX_MAX_BIT32U) {
|
||||||
fprintf(fp, "0x"FMT_LL"x", (Bit64u) value);
|
fprintf(fp, "0x" FMT_LL "x", (Bit64u) value);
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, "0x%x", (Bit32u) value);
|
fprintf(fp, "0x%x", (Bit32u) value);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1706,3 +1706,5 @@ static Bit32u convertStringToGDKKey (const char *string)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* if BX_WITH_WX */
|
#endif /* if BX_WITH_WX */
|
||||||
|
|
||||||
|
#undef Status
|
||||||
|
|||||||
@ -2624,3 +2624,5 @@ BxEvent *x11_notify_callback (void *unused, BxEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* if BX_WITH_X11 */
|
#endif /* if BX_WITH_X11 */
|
||||||
|
|
||||||
|
#undef Status
|
||||||
|
|||||||
@ -699,6 +699,10 @@ void bx_dma_c::raise_HLDA(void)
|
|||||||
// wait till they're unmasked
|
// wait till they're unmasked
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!BX_DMA_THIS s[ma_sl].chan[channel].used) {
|
||||||
|
//BX_PANIC(("hlda: channel %d not connected to device", channel));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//BX_DEBUG(("hlda: OK in response to DRQ(%u)", (unsigned) channel));
|
//BX_DEBUG(("hlda: OK in response to DRQ(%u)", (unsigned) channel));
|
||||||
phy_addr = (BX_DMA_THIS s[ma_sl].chan[channel].page_reg << 16) |
|
phy_addr = (BX_DMA_THIS s[ma_sl].chan[channel].page_reg << 16) |
|
||||||
|
|||||||
@ -1245,8 +1245,10 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xa0: // PACKET
|
case 0xa0: // PACKET
|
||||||
if (BX_SELECTED_CONTROLLER(channel).buffer_index >= PACKET_SIZE)
|
if (BX_SELECTED_CONTROLLER(channel).buffer_index >= PACKET_SIZE) {
|
||||||
BX_PANIC(("IO write(0x%04x): buffer_index >= PACKET_SIZE", address));
|
BX_PANIC(("IO write(0x%04x): buffer_index >= PACKET_SIZE", address));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (io_len) {
|
switch (io_len) {
|
||||||
case 4:
|
case 4:
|
||||||
@ -1403,24 +1405,24 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
|||||||
init_mode_sense_single(channel, &BX_SELECTED_CONTROLLER(channel).buffer[8], 28);
|
init_mode_sense_single(channel, &BX_SELECTED_CONTROLLER(channel).buffer[8], 28);
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[8] = 0x2a;
|
BX_SELECTED_CONTROLLER(channel).buffer[8] = 0x2a;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[9] = 0x12;
|
BX_SELECTED_CONTROLLER(channel).buffer[9] = 0x12;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[10] = 0x00;
|
BX_SELECTED_CONTROLLER(channel).buffer[10] = 0x03;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[11] = 0x00;
|
BX_SELECTED_CONTROLLER(channel).buffer[11] = 0x00;
|
||||||
// Multisession, Mode 2 Form 2, Mode 2 Form 1
|
// Multisession, Mode 2 Form 2, Mode 2 Form 1, Audio
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[12] = 0x70;
|
BX_SELECTED_CONTROLLER(channel).buffer[12] = 0x71;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[13] = (3 << 5);
|
BX_SELECTED_CONTROLLER(channel).buffer[13] = (3 << 5);
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[14] = (unsigned char) (1 |
|
BX_SELECTED_CONTROLLER(channel).buffer[14] = (unsigned char) (1 |
|
||||||
(BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) |
|
(BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) |
|
||||||
(1 << 3) |
|
(1 << 3) |
|
||||||
(1 << 5));
|
(1 << 5));
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[15] = 0x00;
|
BX_SELECTED_CONTROLLER(channel).buffer[15] = 0x00;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[16] = (706 >> 8) & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[16] = ((16 * 176) >> 8) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[17] = 706 & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[17] = (16 * 176) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[18] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[18] = 0;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[19] = 2;
|
BX_SELECTED_CONTROLLER(channel).buffer[19] = 2;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[20] = (512 >> 8) & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[20] = (512 >> 8) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[21] = 512 & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[21] = 512 & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[22] = (706 >> 8) & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[22] = ((16 * 176) >> 8) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[23] = 706 & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[23] = (16 * 176) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[24] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[24] = 0;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[25] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[25] = 0;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[26] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[26] = 0;
|
||||||
@ -1481,24 +1483,24 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
|||||||
init_mode_sense_single(channel, &BX_SELECTED_CONTROLLER(channel).buffer[8], 28);
|
init_mode_sense_single(channel, &BX_SELECTED_CONTROLLER(channel).buffer[8], 28);
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[8] = 0x2a;
|
BX_SELECTED_CONTROLLER(channel).buffer[8] = 0x2a;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[9] = 0x12;
|
BX_SELECTED_CONTROLLER(channel).buffer[9] = 0x12;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[10] = 0x00;
|
BX_SELECTED_CONTROLLER(channel).buffer[10] = 0x03;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[11] = 0x00;
|
BX_SELECTED_CONTROLLER(channel).buffer[11] = 0x00;
|
||||||
// Multisession, Mode 2 Form 2, Mode 2 Form 1
|
// Multisession, Mode 2 Form 2, Mode 2 Form 1, Audio
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[12] = 0x70;
|
BX_SELECTED_CONTROLLER(channel).buffer[12] = 0x71;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[13] = (3 << 5);
|
BX_SELECTED_CONTROLLER(channel).buffer[13] = (3 << 5);
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[14] = (unsigned char) (1 |
|
BX_SELECTED_CONTROLLER(channel).buffer[14] = (unsigned char) (1 |
|
||||||
(BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) |
|
(BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) |
|
||||||
(1 << 3) |
|
(1 << 3) |
|
||||||
(1 << 5));
|
(1 << 5));
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[15] = 0x00;
|
BX_SELECTED_CONTROLLER(channel).buffer[15] = 0x00;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[16] = (706 >> 8) & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[16] = ((16 * 176) >> 8) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[17] = 706 & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[17] = (16 * 176) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[18] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[18] = 0;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[19] = 2;
|
BX_SELECTED_CONTROLLER(channel).buffer[19] = 2;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[20] = (512 >> 8) & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[20] = (512 >> 8) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[21] = 512 & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[21] = 512 & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[22] = (706 >> 8) & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[22] = ((16 * 176) >> 8) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[23] = 706 & 0xff;
|
BX_SELECTED_CONTROLLER(channel).buffer[23] = (16 * 176) & 0xff;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[24] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[24] = 0;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[25] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[25] = 0;
|
||||||
BX_SELECTED_CONTROLLER(channel).buffer[26] = 0;
|
BX_SELECTED_CONTROLLER(channel).buffer[26] = 0;
|
||||||
@ -1527,14 +1529,11 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
case 0x3: // saved values not implemented
|
case 0x3: // saved values not implemented
|
||||||
atapi_cmd_error(channel, SENSE_ILLEGAL_REQUEST, ASC_SAVING_PARAMETERS_NOT_SUPPORTED, 1);
|
atapi_cmd_error(channel, SENSE_ILLEGAL_REQUEST, ASC_SAVING_PARAMETERS_NOT_SUPPORTED, 1);
|
||||||
raise_interrupt(channel);
|
raise_interrupt(channel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
BX_PANIC(("Should not get here!"));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3120,7 +3119,7 @@ void bx_hard_drive_c::init_mode_sense_single(Bit8u channel, const void* src, int
|
|||||||
BX_SELECTED_CONTROLLER(channel).buffer[7] = 0; // reserved
|
BX_SELECTED_CONTROLLER(channel).buffer[7] = 0; // reserved
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
memcpy(BX_SELECTED_CONTROLLER(channel).buffer + 8, src, size);
|
memmove(BX_SELECTED_CONTROLLER(channel).buffer + 8, src, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BX_CPP_AttrRegparmN(1)
|
void BX_CPP_AttrRegparmN(1)
|
||||||
|
|||||||
@ -301,6 +301,14 @@ void bx_pci_ide_c::timer()
|
|||||||
BX_PIDE_THIS s.bmdma[channel].prd_current = 0;
|
BX_PIDE_THIS s.bmdma[channel].prd_current = 0;
|
||||||
DEV_hd_bmdma_complete(channel);
|
DEV_hd_bmdma_complete(channel);
|
||||||
} else {
|
} else {
|
||||||
|
// To avoid buffer overflow reset buffer pointers and copy data if necessary
|
||||||
|
count = BX_PIDE_THIS s.bmdma[channel].buffer_top - BX_PIDE_THIS s.bmdma[channel].buffer_idx;
|
||||||
|
if (count > 0) {
|
||||||
|
memmove(BX_PIDE_THIS s.bmdma[channel].buffer, BX_PIDE_THIS s.bmdma[channel].buffer_idx, count);
|
||||||
|
}
|
||||||
|
BX_PIDE_THIS s.bmdma[channel].buffer_top = BX_PIDE_THIS s.bmdma[channel].buffer + count;
|
||||||
|
BX_PIDE_THIS s.bmdma[channel].buffer_idx = BX_PIDE_THIS s.bmdma[channel].buffer;
|
||||||
|
// Prepare for next PRD
|
||||||
BX_PIDE_THIS s.bmdma[channel].prd_current += 8;
|
BX_PIDE_THIS s.bmdma[channel].prd_current += 8;
|
||||||
DEV_MEM_READ_PHYSICAL(BX_PIDE_THIS s.bmdma[channel].prd_current, 4, (Bit8u *)&prd.addr);
|
DEV_MEM_READ_PHYSICAL(BX_PIDE_THIS s.bmdma[channel].prd_current, 4, (Bit8u *)&prd.addr);
|
||||||
DEV_MEM_READ_PHYSICAL(BX_PIDE_THIS s.bmdma[channel].prd_current+4, 4, (Bit8u *)&prd.size);
|
DEV_MEM_READ_PHYSICAL(BX_PIDE_THIS s.bmdma[channel].prd_current+4, 4, (Bit8u *)&prd.size);
|
||||||
|
|||||||
@ -136,7 +136,7 @@ void bx_pit_c::init(void)
|
|||||||
|
|
||||||
BX_DEBUG(("finished init"));
|
BX_DEBUG(("finished init"));
|
||||||
|
|
||||||
BX_DEBUG(("s.last_usec="FMT_LL"d",BX_PIT_THIS s.last_usec));
|
BX_DEBUG(("s.last_usec=" FMT_LL "d",BX_PIT_THIS s.last_usec));
|
||||||
BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0]));
|
BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0]));
|
||||||
BX_DEBUG(("s.timer.get_next_event_time=%d",BX_PIT_THIS s.timer.get_next_event_time()));
|
BX_DEBUG(("s.timer.get_next_event_time=%d",BX_PIT_THIS s.timer.get_next_event_time()));
|
||||||
BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time));
|
BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time));
|
||||||
@ -191,7 +191,7 @@ void bx_pit_c::handle_timer()
|
|||||||
}
|
}
|
||||||
BX_PIT_THIS s.last_next_event_time = BX_PIT_THIS s.timer.get_next_event_time();
|
BX_PIT_THIS s.last_next_event_time = BX_PIT_THIS s.timer.get_next_event_time();
|
||||||
}
|
}
|
||||||
BX_DEBUG(("s.last_usec="FMT_LL"d",BX_PIT_THIS s.last_usec));
|
BX_DEBUG(("s.last_usec=" FMT_LL "d",BX_PIT_THIS s.last_usec));
|
||||||
BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0]));
|
BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0]));
|
||||||
BX_DEBUG(("s.timer.get_next_event_time=%x",BX_PIT_THIS s.timer.get_next_event_time()));
|
BX_DEBUG(("s.timer.get_next_event_time=%x",BX_PIT_THIS s.timer.get_next_event_time()));
|
||||||
BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time));
|
BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time));
|
||||||
@ -325,7 +325,7 @@ void bx_pit_c::write(Bit32u address, Bit32u dvalue, unsigned io_len)
|
|||||||
}
|
}
|
||||||
BX_PIT_THIS s.last_next_event_time = BX_PIT_THIS s.timer.get_next_event_time();
|
BX_PIT_THIS s.last_next_event_time = BX_PIT_THIS s.timer.get_next_event_time();
|
||||||
}
|
}
|
||||||
BX_DEBUG(("s.last_usec="FMT_LL"d",BX_PIT_THIS s.last_usec));
|
BX_DEBUG(("s.last_usec=" FMT_LL "d",BX_PIT_THIS s.last_usec));
|
||||||
BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0]));
|
BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0]));
|
||||||
BX_DEBUG(("s.timer.get_next_event_time=%x",BX_PIT_THIS s.timer.get_next_event_time()));
|
BX_DEBUG(("s.timer.get_next_event_time=%x",BX_PIT_THIS s.timer.get_next_event_time()));
|
||||||
BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time));
|
BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time));
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#pragma clang diagnostic ignored "-Wc++11-narrowing"
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// $Id$
|
// $Id$
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -663,7 +663,7 @@ Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun)
|
|||||||
case 0x08:
|
case 0x08:
|
||||||
case 0x28:
|
case 0x28:
|
||||||
case 0x88:
|
case 0x88:
|
||||||
BX_DEBUG(("Read (sector "FMT_LL"d, count %d)", lba, len));
|
BX_DEBUG(("Read (sector " FMT_LL "d, count %d)", lba, len));
|
||||||
if (lba > max_lba)
|
if (lba > max_lba)
|
||||||
goto illegal_lba;
|
goto illegal_lba;
|
||||||
r->sector = lba;
|
r->sector = lba;
|
||||||
@ -672,7 +672,7 @@ Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun)
|
|||||||
case 0x0a:
|
case 0x0a:
|
||||||
case 0x2a:
|
case 0x2a:
|
||||||
case 0x8a:
|
case 0x8a:
|
||||||
BX_DEBUG(("Write (sector "FMT_LL"d, count %d)", lba, len));
|
BX_DEBUG(("Write (sector " FMT_LL "d, count %d)", lba, len));
|
||||||
if (lba > max_lba)
|
if (lba > max_lba)
|
||||||
goto illegal_lba;
|
goto illegal_lba;
|
||||||
r->sector = lba;
|
r->sector = lba;
|
||||||
@ -680,7 +680,7 @@ Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun)
|
|||||||
is_write = 1;
|
is_write = 1;
|
||||||
break;
|
break;
|
||||||
case 0x35:
|
case 0x35:
|
||||||
BX_DEBUG(("Syncronise cache (sector "FMT_LL"d, count %d)", lba, len));
|
BX_DEBUG(("Syncronise cache (sector " FMT_LL "d, count %d)", lba, len));
|
||||||
// TODO: flush cache
|
// TODO: flush cache
|
||||||
break;
|
break;
|
||||||
case 0x43:
|
case 0x43:
|
||||||
|
|||||||
@ -448,7 +448,7 @@ int bx_sound_linux_c::alsa_pcm_write()
|
|||||||
BX_ERROR(("ALSA: short write, write %d frames", ret));
|
BX_ERROR(("ALSA: short write, write %d frames", ret));
|
||||||
}
|
}
|
||||||
audio_bufsize -= alsa_bufsize;
|
audio_bufsize -= alsa_bufsize;
|
||||||
memcpy(audio_buffer, audio_buffer+alsa_bufsize, audio_bufsize);
|
memmove(audio_buffer, audio_buffer+alsa_bufsize, audio_bufsize);
|
||||||
}
|
}
|
||||||
if ((audio_bufsize == 0) && (alsa_buffer != NULL)) {
|
if ((audio_bufsize == 0) && (alsa_buffer != NULL)) {
|
||||||
free(alsa_buffer);
|
free(alsa_buffer);
|
||||||
|
|||||||
@ -558,7 +558,7 @@ void bx_vga_c::determine_screen_dimensions(unsigned *piHeight, unsigned *piWidth
|
|||||||
{
|
{
|
||||||
int ai[0x20];
|
int ai[0x20];
|
||||||
int i,h,v;
|
int i,h,v;
|
||||||
for (i = 0 ; i < 0x20 ; i++)
|
for (i = 0 ; i < 0x19 ; i++)
|
||||||
ai[i] = BX_VGA_THIS s.CRTC.reg[i];
|
ai[i] = BX_VGA_THIS s.CRTC.reg[i];
|
||||||
|
|
||||||
h = (ai[1] + 1) * 8;
|
h = (ai[1] + 1) * 8;
|
||||||
|
|||||||
@ -529,7 +529,7 @@ void bx_virt_timer_c::timer_handler(void)
|
|||||||
printf("useconds: " FMT_LL "u, ", temp1);
|
printf("useconds: " FMT_LL "u, ", temp1);
|
||||||
printf("expect ticks: " FMT_LL "u, ", temp2);
|
printf("expect ticks: " FMT_LL "u, ", temp2);
|
||||||
printf("ticks: " FMT_LL "u, ", temp3);
|
printf("ticks: " FMT_LL "u, ", temp3);
|
||||||
printf("diff: "FMT_LL "u\n", temp4);
|
printf("diff: " FMT_LL "u\n", temp4);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|||||||
@ -185,7 +185,7 @@ inc_one:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// access outside limits of physical memory, ignore
|
// access outside limits of physical memory, ignore
|
||||||
BX_DEBUG(("Write outside the limits of physical memory (0x"FMT_PHY_ADDRX") (ignore)", a20addr));
|
BX_DEBUG(("Write outside the limits of physical memory (0x" FMT_PHY_ADDRX ") (ignore)", a20addr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
# This script invokes the gem5 simulator. It is written to be used
|
# This script invokes the gem5 simulator. It is written to be used
|
||||||
# with the Fail* framework. For further information, see
|
# with the FAIL* framework. For further information, see
|
||||||
# http://www.m5sim.org/Simulation_Scripts_Explained
|
# http://www.m5sim.org/Simulation_Scripts_Explained
|
||||||
# This script is based on $FAIL/simulators/gem5/configs/example/fs.py
|
# This script is based on $FAIL/simulators/gem5/configs/example/fs.py
|
||||||
#
|
#
|
||||||
@ -33,7 +33,7 @@ Options.addFSOptions(parser) # TODO: dito
|
|||||||
if args:
|
if args:
|
||||||
print "Error: script doesn't take any positional arguments"
|
print "Error: script doesn't take any positional arguments"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
print "[Fail*] Welcome to the FULL SYSTEM simulation script for gem5!"
|
print "[FAIL*] Welcome to the FULL SYSTEM simulation script for gem5!"
|
||||||
|
|
||||||
# Sets up the low-level system parameter:
|
# Sets up the low-level system parameter:
|
||||||
class FailArmSystem(System):
|
class FailArmSystem(System):
|
||||||
@ -130,10 +130,10 @@ test_sys = makeFailArmSystem(test_mem_mode, options.machine_type)
|
|||||||
# experiment target (e.g., the abo-simple-arm.elf file). It should
|
# experiment target (e.g., the abo-simple-arm.elf file). It should
|
||||||
# contain the bootload code as well.
|
# contain the bootload code as well.
|
||||||
if options.kernel is not None:
|
if options.kernel is not None:
|
||||||
print "[Fail*] Using target: " + options.kernel
|
print "[FAIL*] Using target: " + options.kernel
|
||||||
test_sys.kernel = options.kernel
|
test_sys.kernel = options.kernel
|
||||||
else:
|
else:
|
||||||
print "[Fail*] No kernel target given, exiting!"
|
print "[FAIL*] No kernel target given, exiting!"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
test_sys.init_param = options.init_param
|
test_sys.init_param = options.init_param
|
||||||
|
|||||||
@ -584,7 +584,7 @@ class FloatRegOperand(Operand):
|
|||||||
return self.buildWriteCode(func)
|
return self.buildWriteCode(func)
|
||||||
# (DanceOS hack begin...
|
# (DanceOS hack begin...
|
||||||
if self.ctype == 'int32_t' or self.ctype == 'int16_t':
|
if self.ctype == 'int32_t' or self.ctype == 'int16_t':
|
||||||
print "Applying Fail* hack in %s@%s ... :-)" % \
|
print "Applying FAIL* hack in %s@%s ... :-)" % \
|
||||||
(__file__, inspect.currentframe().f_lineno)
|
(__file__, inspect.currentframe().f_lineno)
|
||||||
wb = '''
|
wb = '''
|
||||||
{
|
{
|
||||||
|
|||||||
@ -334,7 +334,8 @@ BaseSimpleCPU::checkForInterrupts()
|
|||||||
if (interrupt != NoFault) {
|
if (interrupt != NoFault) {
|
||||||
// DanceOS
|
// DanceOS
|
||||||
#ifdef CONFIG_EVENT_INTERRUPT
|
#ifdef CONFIG_EVENT_INTERRUPT
|
||||||
fail::simulator.onInterrupt(dynamic_cast<ArmFault*>(interrupt.get())->offset(), false);
|
// FIXME pass the currently active ConcreteCPU instance
|
||||||
|
fail::simulator.onInterrupt(NULL, dynamic_cast<ArmFault*>(interrupt.get())->offset(), false);
|
||||||
#endif
|
#endif
|
||||||
fetchOffset = 0;
|
fetchOffset = 0;
|
||||||
interrupts->updateIntrInfo(tc);
|
interrupts->updateIntrInfo(tc);
|
||||||
|
|||||||
@ -15,10 +15,10 @@ SET(PROTOBUF_IMPORT_DIRS "/usr/include;${CMAKE_CURRENT_SOURCE_DIR}/core/comm"
|
|||||||
# is generated by CMake from config/FailConfig.hpp.in and stored in
|
# is generated by CMake from config/FailConfig.hpp.in and stored in
|
||||||
# your build-dir. (The same goes for "FailControlMessage.pb.h", etc.)
|
# your build-dir. (The same goes for "FailControlMessage.pb.h", etc.)
|
||||||
# This is done in the "src"-folder because experiments need to include
|
# This is done in the "src"-folder because experiments need to include
|
||||||
# Fail* headers as well (see hierarchy of CMakeLists.txt's).
|
# FAIL* headers as well (see hierarchy of CMakeLists.txt's).
|
||||||
|
|
||||||
## Add CMakeLists from subdirectories ##
|
## Add CMakeLists from subdirectories ##
|
||||||
# The Fail* core source files (and it's subdirectories):
|
# The FAIL* core source files (and it's subdirectories):
|
||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
|
|
||||||
# Here we add all user-defined experiments (which fills the target list)
|
# Here we add all user-defined experiments (which fills the target list)
|
||||||
@ -39,8 +39,8 @@ endforeach(plugin_name)
|
|||||||
# (probably there's a smarter way to do that with cmake?)
|
# (probably there's a smarter way to do that with cmake?)
|
||||||
add_library(fail dummy.cc)
|
add_library(fail dummy.cc)
|
||||||
|
|
||||||
## Setup build dependencies of the Fail* lib
|
## Setup build dependencies of the FAIL* lib
|
||||||
## -> the Fail* targets and user defined experiment targets
|
## -> the FAIL* targets and user defined experiment targets
|
||||||
# start/end-group: ld must iterate over these archives more than once to figure
|
# start/end-group: ld must iterate over these archives more than once to figure
|
||||||
# out which objects are needed
|
# out which objects are needed
|
||||||
set(experiment_libraries "")
|
set(experiment_libraries "")
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
### Add Boost and Threads
|
### Add Boost and Threads
|
||||||
find_package(Boost 1.42 COMPONENTS thread REQUIRED)
|
find_package(Boost 1.53 COMPONENTS thread coroutine context REQUIRED)
|
||||||
include_directories(${Boost_INCLUDE_DIRS})
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
link_directories(${Boost_LIBRARY_DIRS})
|
link_directories(${Boost_LIBRARY_DIRS})
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ link_directories(${Boost_LIBRARY_DIRS})
|
|||||||
# The autogenerated header files
|
# The autogenerated header files
|
||||||
add_subdirectory(config)
|
add_subdirectory(config)
|
||||||
|
|
||||||
# Fail* targets
|
# FAIL* targets
|
||||||
add_subdirectory(comm)
|
add_subdirectory(comm)
|
||||||
add_subdirectory(cpn)
|
add_subdirectory(cpn)
|
||||||
add_subdirectory(efw)
|
add_subdirectory(efw)
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
set(SRCS
|
set(SRCS
|
||||||
ExperimentData.hpp
|
ExperimentData.hpp
|
||||||
SocketComm.hpp
|
|
||||||
SocketComm.cc
|
|
||||||
)
|
)
|
||||||
|
|
||||||
## Setup desired protobuf descriptions HERE ##
|
## Setup desired protobuf descriptions HERE ##
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
import "google/protobuf/descriptor.proto";
|
import "google/protobuf/descriptor.proto";
|
||||||
extend google.protobuf.FieldOptions {
|
extend google.protobuf.FieldOptions {
|
||||||
optional bool sql_primary_key = 32382 [ default = false];
|
optional bool sql_primary_key = 32382 [ default = false];
|
||||||
@ -8,8 +10,6 @@ import "@CONCRETE_INJECTION_POINT@";
|
|||||||
|
|
||||||
message DatabaseCampaignMessage {
|
message DatabaseCampaignMessage {
|
||||||
required uint32 pilot_id = 1 [(sql_primary_key) = true];
|
required uint32 pilot_id = 1 [(sql_primary_key) = true];
|
||||||
required uint32 variant_id = 2 [(sql_ignore) = true];
|
|
||||||
required uint32 fspmethod_id = 3 [(sql_ignore) = true];
|
|
||||||
|
|
||||||
// ToDo: injection_instr can be deleted if all experiments switched to
|
// ToDo: injection_instr can be deleted if all experiments switched to
|
||||||
// using generic InjectionPointMessage
|
// using generic InjectionPointMessage
|
||||||
@ -21,10 +21,19 @@ message DatabaseCampaignMessage {
|
|||||||
required string benchmark = 9 [(sql_ignore) = true];
|
required string benchmark = 9 [(sql_ignore) = true];
|
||||||
|
|
||||||
required InjectionPointMessage injection_point = 10 [(sql_ignore) = true];
|
required InjectionPointMessage injection_point = 10 [(sql_ignore) = true];
|
||||||
|
|
||||||
|
required bool inject_bursts = 11 [default = false];
|
||||||
|
enum RegisterInjectionMode {
|
||||||
|
OFF = 0;
|
||||||
|
AUTO = 1;
|
||||||
|
FORCE = 2;
|
||||||
|
RANDOMJUMP = 3;
|
||||||
|
}
|
||||||
|
optional RegisterInjectionMode register_injection_mode = 12 [default = OFF];
|
||||||
}
|
}
|
||||||
|
|
||||||
message DatabaseExperimentMessage {
|
message DatabaseExperimentMessage {
|
||||||
required uint32 bitoffset = 1 [(sql_primary_key) = true];
|
required uint32 bitoffset = 1 [(sql_primary_key) = true];
|
||||||
required uint32 original_value = 2;
|
required uint32 original_value = 2;
|
||||||
|
required uint32 injection_width = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
message FailControlMessage {
|
message FailControlMessage {
|
||||||
enum Command {
|
enum Command {
|
||||||
// Minions may send these:
|
// Minions may send these:
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
message InjectionPointMessage {
|
message InjectionPointMessage {
|
||||||
// Costs of the hop chain on the PandaBoard
|
// Costs of the hop chain on the PandaBoard
|
||||||
// ToDo: Could be eliminated, but it is nice for evaluation
|
// ToDo: Could be eliminated, but it is nice for evaluation
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
message InjectionPointMessage {
|
message InjectionPointMessage {
|
||||||
required uint32 injection_instr = 1;
|
required uint32 injection_instr = 1;
|
||||||
}
|
}
|
||||||
@ -1,117 +0,0 @@
|
|||||||
#include <string>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <poll.h>
|
|
||||||
|
|
||||||
#include "SocketComm.hpp"
|
|
||||||
|
|
||||||
namespace fail {
|
|
||||||
|
|
||||||
void SocketComm::init()
|
|
||||||
{
|
|
||||||
// It's usually much easier to handle the error on write(), than to do
|
|
||||||
// anything intelligent in a SIGPIPE handler.
|
|
||||||
signal(SIGPIPE, SIG_IGN);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SocketComm::sendMsg(int sockfd, google::protobuf::Message& msg)
|
|
||||||
{
|
|
||||||
int size = htonl(msg.ByteSize());
|
|
||||||
std::string buf;
|
|
||||||
if (safe_write(sockfd, &size, sizeof(size)) == -1
|
|
||||||
|| !msg.SerializeToString(&buf)
|
|
||||||
|| safe_write(sockfd, buf.c_str(), buf.size()) == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SocketComm::rcvMsg(int sockfd, google::protobuf::Message& msg)
|
|
||||||
{
|
|
||||||
char *buf;
|
|
||||||
int bufsiz;
|
|
||||||
if ((buf = getBuf(sockfd, &bufsiz))) {
|
|
||||||
std::string st(buf, bufsiz);
|
|
||||||
delete [] buf;
|
|
||||||
return msg.ParseFromString(st);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SocketComm::dropMsg(int sockfd)
|
|
||||||
{
|
|
||||||
char *buf;
|
|
||||||
int bufsiz;
|
|
||||||
if ((buf = getBuf(sockfd, &bufsiz))) {
|
|
||||||
delete [] buf;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
char * SocketComm::getBuf(int sockfd, int *size)
|
|
||||||
{
|
|
||||||
char *buf;
|
|
||||||
if (safe_read(sockfd, size, sizeof(int)) == -1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*size = ntohl(*size);
|
|
||||||
buf = new char[*size];
|
|
||||||
if (safe_read(sockfd, buf, *size) == -1) {
|
|
||||||
delete [] buf;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
int SocketComm::timedAccept(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int timeout)
|
|
||||||
{
|
|
||||||
struct pollfd pfd = {sockfd, POLLIN, 0};
|
|
||||||
int ret = poll(&pfd, 1, timeout);
|
|
||||||
if (ret > 0) {
|
|
||||||
return accept(sockfd, addr, addrlen);
|
|
||||||
}
|
|
||||||
errno = EWOULDBLOCK;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssize_t SocketComm::safe_write(int fd, const void *buf, size_t count)
|
|
||||||
{
|
|
||||||
ssize_t ret;
|
|
||||||
const char *cbuf = (const char *) buf;
|
|
||||||
do {
|
|
||||||
ret = write(fd, cbuf, count);
|
|
||||||
if (ret == -1) {
|
|
||||||
if (errno == EINTR) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
count -= ret;
|
|
||||||
cbuf += ret;
|
|
||||||
} while (count);
|
|
||||||
return cbuf - (const char *)buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssize_t SocketComm::safe_read(int fd, void *buf, size_t count)
|
|
||||||
{
|
|
||||||
ssize_t ret;
|
|
||||||
char *cbuf = (char *) buf;
|
|
||||||
do {
|
|
||||||
ret = read(fd, cbuf, count);
|
|
||||||
if (ret == -1) {
|
|
||||||
if (errno == EINTR) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
} else if (ret == 0) {
|
|
||||||
// this deliberately deviates from read(2)
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
count -= ret;
|
|
||||||
cbuf += ret;
|
|
||||||
} while (count);
|
|
||||||
return cbuf - (const char *) buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end-of-namespace: fail
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
/**
|
|
||||||
* \brief Socket based communication wrapper functions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __SOCKET_COMM_HPP__
|
|
||||||
#define __SOCKET_COMM_HPP__
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <google/protobuf/message.h>
|
|
||||||
|
|
||||||
namespace fail {
|
|
||||||
|
|
||||||
class SocketComm {
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* This allows us to ignore SIGPIPE.
|
|
||||||
*/
|
|
||||||
static void init();
|
|
||||||
/**
|
|
||||||
* Send Protobuf-generated message
|
|
||||||
* @param sockfd open socket descriptor to write to
|
|
||||||
* @param Msg Reference to Protobuf generated message type
|
|
||||||
* \return false if message sending failed
|
|
||||||
*/
|
|
||||||
static bool sendMsg(int sockfd, google::protobuf::Message& msg);
|
|
||||||
/**
|
|
||||||
* Receive Protobuf-generated message
|
|
||||||
* @param sockfd open socket descriptor to read from
|
|
||||||
* @param Msg Reference to Protobuf generated message type
|
|
||||||
* \return false if message reception failed
|
|
||||||
*/
|
|
||||||
static bool rcvMsg(int sockfd, google::protobuf::Message& msg);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Receive Protobuf-generated message and just drop it
|
|
||||||
* @param sockfd open socket descriptor to read from
|
|
||||||
* \return false if message reception failed
|
|
||||||
*/
|
|
||||||
static bool dropMsg(int sockfd);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An accept() wrapper that times out (using poll(2))
|
|
||||||
* @param sockfd listening socket descriptor to accept connections from
|
|
||||||
* @param addr same as accept()'s
|
|
||||||
* @param addrlen same as accept()'s
|
|
||||||
* @param timeout timeout in milliseconds (see poll(2))
|
|
||||||
* \return < 0 on failure, > 0 for a new socket connection
|
|
||||||
*/
|
|
||||||
static int timedAccept(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int timeout);
|
|
||||||
|
|
||||||
private:
|
|
||||||
static char *getBuf(int sockfd, int *size);
|
|
||||||
static ssize_t safe_write(int fd, const void *buf, size_t count);
|
|
||||||
static ssize_t safe_read(int fd, void *buf, size_t count);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // end-of-namespace: fail
|
|
||||||
|
|
||||||
#endif // __SOCKET_COMM_HPP__
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user