Sat Mar 19 17:40:43 EST 2005 jmony@xxxxxxxxx
* Adding ckpt library support (Checkpointing)
New patches:
[Adding ckpt library support (Checkpointing)
jmony@xxxxxxxxx**20050319224043] {
hunk ./arch/posix/SConscript 18
- 'util'
+ 'util',
+ 'ckpt'
hunk ./arch/posix/main.c 1
+#define WITH_CKPT // Activates CKPT support. ***RECOMMENDED***
+//#define CKPT_DEBUG // This enables a few debug messages related to CKPT
+ // Deactivated... related debug code could almost be
+ // removed. We should keep this until everything is
+ // stable enough.
+
hunk ./arch/posix/main.c 15
+#ifdef WITH_CKPT
+#include <string.h>
+#include <signal.h>
+#include <netdb.h>
+#include <ckpt.h>
hunk ./arch/posix/main.c 21
+static void CKPT_CheckPointInit(void); // Initializes ckpt parameters.
+static void CKPT_Restoring(void); // Executed on checkpoint reload
+static void CKPT_CheckPointDone(void); // Executed when checkpoint is done
+static void CKPT_DoCheckPoint(void); // Executed prior to a checkpoint
+static void CKPT_Shutdown(void); // Executed on clean shutdown
+static int CKPT_Interval; // Checkpoint interval in seconds.
+static char CKPT_Alternate; // Which file to use
+static char CKPT_Clean; // Are we writing a clean
shutdown?
+#endif
+
hunk ./arch/posix/main.c 39
- printf("unununium booting\n");
+ printf(" _ \n");
+ printf(" http://unununium.org/ (_) \n");
+ printf(" _ _ _ __ _ _ _ __ _ _ _ __ _ _ _ _ __ ___ \n");
+ printf("| | | | '_ \\| | | | '_ \\| | | | '_ \\| | | | | '_ ` _ \\ \n");
+ printf("| |_| | | | | |_| | | | | |_| | | | | | |_| | | | | | |\n");
+ printf(" \\__,_|_| |_|\\__,_|_| |_|\\__,_|_| |_|_|\\__,_|_| |_| |_|\n");
+ printf(" booting\n");
hunk ./arch/posix/main.c 47
+#ifdef WITH_CKPT
+ printf("Checkpointing initialization: ");
+/*
+ Initializing the ckpt functionalities. Note that ckpt_on_* functions allow
+ to register new hooks. For example, if you want to handle socket
+ save/restore, these functions will be used to register your hooks.
+*/
+ CKPT_Clean=0; // We are not clean. We are dirty ;-)
+ CKPT_Interval=60; // Setting the checkpoint interval manually for now.
+ // Using 60 seconds will make sure our 2 files are
+ // not in the same minute, so we know which checkpoint
+ // is the most recent...
+ // This could be dynamically modified later or taken
+ // from some configuration system.
+ CKPT_Alternate='1';
+ ckpt_on_preckpt((void*)CKPT_DoCheckPoint,NULL);
+ ckpt_on_postckpt((void*)CKPT_CheckPointDone,NULL);
+ ckpt_on_restart((void*)CKPT_Restoring,NULL);
+ ckpt_on_restart((void*)CKPT_CheckPointInit,NULL);
+ CKPT_CheckPointInit();
+ ckpt_ckpt(NULL);
+ alarm(CKPT_Interval); //Take a quick one before going back to
normal.
+ printf("done\n");
+#endif
+
+/* Python Specific */
hunk ./arch/posix/main.c 94
+
+
+#ifdef WITH_CKPT
+/* CKPT_* function set */
+
+/*
+ CKPT_CheckPointInit()
+ Configures the snapshot filename and which signal to grab.
+ It then sets an alarm timer so the checkpoints get taken periodically.
+*/
+static void CKPT_CheckPointInit(void){
+ struct ckptconfig CKPT_Config;
+
+
+ /*
+ flags: CKPT_NAME (Allows to set the snapshot filename)
+ CKPT_ASYNCSIG (which signal to hookup)
+ CKPT_CONTINUE (Whether the execution continues after ckpt)
+ CKPT_MSPERIOD (Set a timeframe in MS)
+ NOTE: We don't use it at the moment because it
+ seems to interfere with other signals.
+ Instead, we manually use SIGALRM signal.
+ */
+ CKPT_Config.flags = CKPT_NAME | CKPT_ASYNCSIG | CKPT_CONTINUE;
+ strcpy(&CKPT_Config.name,"checkpoint1");
+
+ CKPT_Config.asyncsig=SIGALRM;
+ CKPT_Config.continues=1;
+ CKPT_Config.msperiod=0; // UNUSED
+ ckpt_config(&CKPT_Config,NULL); // Loading configuration in ckpt
+}
+
+/*
+ CKPT_Restoring()
+ executed when a checkpoint is restored.
+ Right now, all it does is display a message and restart timer.
+ We could however put socket/file descriptor handling in there...
+ or add another hook.
+*/
+static void CKPT_Restoring(void){
+printf("Restoring ");
+if (CKPT_Clean == 1)
+ printf("from clean state");
+else
+ printf("from checkpoint");
+printf("\n");
+ alarm(CKPT_Interval);
+}
+
+/*
+ CKPT_CheckPointDone()
+ called when the checkpoint is done.
+ Here, we add some file rotation, and timer reactivation...
+ or else we will perform the checkpoint only once!
+*/
+static void CKPT_CheckPointDone(void){
+ struct ckptconfig CKPT_Config;
+#ifdef CKPT_DEBUG
+ printf("Checkpoint done\n");
+#endif
+/* *** PATCH ME ***
+ Improve the rotation... or even better: add logging support to ckpt!
+ Improvement idea: make a symbolic link from the latest image to "latest"
+*/
+ CKPT_Config.flags = CKPT_NAME;
+ if (CKPT_Alternate=='1'){
+
+ CKPT_Alternate='2';
+ strcpy(&CKPT_Config.name,"checkpoint2");
+ }
+ else {
+ CKPT_Alternate='1';
+ strcpy(&CKPT_Config.name,"checkpoint1");
+ }
+ ckpt_config(&CKPT_Config,NULL); // Loading configuration in ckpt
+
+ /*
+ We need to re-arm the timer, since it is deactivated (it got fired up)
+ */
+ alarm(CKPT_Interval);
+}
+
+/*
+ CKPT_DoCheckPoint() This function is called prior to checkpoint.
+ For example, we could add socket/file descriptor handling here.
+*/
+static void CKPT_DoCheckPoint(void){
+ alarm(0);
+#ifdef CKPT_DEBUG
+ printf("\nSaving Checkpoint\n");
+#endif
+}
+
+/*
+ CKPT_Shutdown() performs a clean shutdown and sets the flag accordingly.
+*/
+static void CKPT_Shutdown(void){
+ struct ckptconfig CKPT_Config;
+ alarm(0);
+ printf("Writing Stable image to disk\n");
+ CKPT_Config.flags = CKPT_CONTINUE;
+ CKPT_Config.continues=0;
+ ckpt_config(&CKPT_Config,NULL); // Loading configuration in ckpt
+ CKPT_Clean=1;
+ ckpt_ckpt("stable");
+ for(;;);
+ // System halted, at least our thread.
+ // But if the continues really works, the process is killed.
+}
+
+#endif
}
Context:
[Removed unneeded calls to fatal_error in undefined_symbols.c
ephex@xxxxxxxxxxxxxxxxxxxxxxxx**20050314003251]
[Povray source for the Uuu triangle logo
Phil Frost <indigo@xxxxxxxxxxx>**20050313211553]
[basic posix port
Phil Frost <indigo@xxxxxxxxxxx>**20050313174349]
[misc. tweaks to build system
Phil Frost <indigo@xxxxxxxxxxx>**20050306162435]
[assure end test marker is printed in case of exception
Phil Frost <indigo@xxxxxxxxxxx>**20050306162252]
[minimal tests for oskit
Phil Frost <indigo@xxxxxxxxxxx>**20050304060137]
[tweak chdir/getcwd tests
Phil Frost <indigo@xxxxxxxxxxx>**20050304060108]
[test for sys.platform
Phil Frost <indigo@xxxxxxxxxxx>**20050304060052]
[minimal tests for Scitech SNAP
Phil Frost <indigo@xxxxxxxxxxx>**20050304055856]
[documentation on writing Unununium tests
Phil Frost <indigo@xxxxxxxxxxx>**20050304055807]
[documentation for uuunittest
Phil Frost <indigo@xxxxxxxxxxx>**20050304054312]
[Allow tests to be divided into generic, and uuu-only tests
Phil Frost <indigo@xxxxxxxxxxx>**20050304005014
With this, it is possible to run only the tests that are expected to pass on
any python platform.
]
[remove now unneeded uuu.thread
Phil Frost <indigo@xxxxxxxxxxx>**20050303180928
The only thing this did was provide read_usec_timer() to snap, and snap no
longer needs this as it uses gettimeofday().
]
[write tests for some known problems
Phil Frost <indigo@xxxxxxxxxxx>**20050303162652]
[create uuu.test.uuunittest, like unittest, but better.
Phil Frost <indigo@xxxxxxxxxxx>**20050303161719
Most importantly, this allows tests to be skipped, or to be marked as expected
to fail.
]
[add options to save builds from test process
Phil Frost <indigo@xxxxxxxxxxx>**20050303032042
This is useful especially for publishing builds on the unununium.org website.
]
[make 'stty sane' command failure when running tests non-fatal
Phil Frost <indigo@xxxxxxxxxxx>**20050302200546
"stty sane" fails when stdout isn't a tty. Ignore that failure.
]
[add a testing framework
Phil Frost <indigo@xxxxxxxxxxx>**20050302141302
It has yet no tests, but is otherwise complete.
]
[By default search for oskit in /usr then /usr/local.
Phil Frost <indigo@xxxxxxxxxxx>**20050302135209
This should eliminate the need to manually configure oskitprefix for many
people.
]
[Crank the stack size up to 2 Mib
Phil Frost <indigo@xxxxxxxxxxx>**20050301041748
This makes the recently developed hacks to get twisted to run unneeded.
Hopefully, it will reduce the frequency of random crashing, too.
]
[add some commands to the shell for playing with twisted
Phil Frost <indigo@xxxxxxxxxxx>**20050228170747]
[Build more standard python C extension as shared objects
Phil Frost <indigo@xxxxxxxxxxx>**20050228113447]
[slightly more useful error message when getting the working directory for the
prompt
Phil Frost <indigo@xxxxxxxxxxx>**20050228101913
This is broken in oskit, somehow. Rather than fix oskit, make the error more
obvious by printing the exception in the prompt, rather than just '???'
]
[get rid of siginterrupt; python has been made to not need it
Phil Frost <indigo@xxxxxxxxxxx>**20050228094326]
[use build-conf.py to set build options
Phil Frost <indigo@xxxxxxxxxxx>**20050227054613]
[fix some directory handling errors in the (now unused) ext2 module
Phil Frost <indigo@xxxxxxxxxxx>**20050220052356]
[wrap oskit.blkio objects in process locks
Phil Frost <indigo@xxxxxxxxxxx>**20050220050141
Somehow I fear there are a dozen more things that need locks around them. Tried
putting them around the filesystem, which made qemu crash. Locking just the
blkio seems to make the bootable cd images work on hardware.
]
[tweak bootable CD build
Phil Frost <indigo@xxxxxxxxxxx>**20050220012030
- Use long filenames instead of 8.3 DOS crap in addition to rock ridge
extensions.
- Don't include the release string as a dependency, so the image is not rebuilt
when nothing has changed.
]
[make scons always complain when oskitprefix is not right
Phil Frost <indigo@xxxxxxxxxxx>**20050219234503]
[include a release identifier in bootable cd images
Phil Frost <indigo@xxxxxxxxxxx>**20050219174756]
[update documentation, and change cd build target from 'iso' to 'cd'.
Phil Frost <indigo@xxxxxxxxxxx>**20050219173830]
[add 'iso' build target, and make fixes to allow it to be mounted
Phil Frost <indigo@xxxxxxxxxxx>**20050219165356]
[link snap libs against the extension modules, instead of the core.
Phil Frost <indigo@xxxxxxxxxxx>**20041220140008]
[add a working, but minimal irc client
Phil Frost <indigo@xxxxxxxxxxx>**20050119134618
To use, create an instance of uuu.irc.Client and call its mainloop method, or
use the 'irc' command in the shell.
]
[enable the oskit fancy-console
Phil Frost <indigo@xxxxxxxxxxx>**20050119133050]
[fix printf declaration in interrupts.pyx
Phil Frost <indigo@xxxxxxxxxxx>**20050119012725]
[abort the build if the oskit symlink can not be created
Phil Frost <indigo@xxxxxxxxxxx>**20050118151304]
[enable networking; it works
Phil Frost <indigo@xxxxxxxxxxx>**20050116235346]
[kill unused make_interrupt_handler()
Phil Frost <indigo@xxxxxxxxxxx>**20050116184252]
[Updated README.en
Davison Avery <davery@xxxxxxxxxxxxx>**20050101155248]
[Automatic SNAP, Python + include/oskit symlink check | pull | create
davery@xxxxxxxxxxxxx**20050101155239]
[QEMU instructions
davery@xxxxxxxxxxxxx**20041227133259
Howto to help others run Uuu in QEMU
]
[add a grub floppy image to make people's life easier
Phil Frost <indigo@xxxxxxxxxxx>**20041224133729]
[clean up arch/ia32 directory
Phil Frost <indigo@xxxxxxxxxxx>**20041218132337]
[add python stdlib to install targets
Phil Frost <indigo@xxxxxxxxxxx>**20041219211532]
[add README in two flavors
Phil Frost <indigo@xxxxxxxxxxx>**20041217015848]
[add help on available options
Phil Frost <indigo@xxxxxxxxxxx>**20041216185004]
[mega rearangement of source and build system
Phil Frost <indigo@xxxxxxxxxxx>**20041216140636
- python modules are easier to integrate to the build and have installed
- option 'debug' to include debug symbols or not. Builds go in different
directories.
- remove src/, moving things to top level
- make build system has been made less centralized and more readable
- delete old crufty code
]
[don't load modules if possible at boot
Phil Frost <indigo@xxxxxxxxxxx>**20041215220026
Now that filesystem is provided by oskit, getting a filesystem working has less
bootstrap mess. Also, the last patch added a runtime linker, so now C
extensions can be loaded.
There is a new option INSTALLDIR which gives a directory to install all the
stuff. An alias 'install' now exists to install unununium.o and the uuu modules
to that directory.
]
[give unununium the power to load shared libs with dlopen and friends
Phil Frost <indigo@xxxxxxxxxxx>**20041215130406]
[fix path to python modules loaded at init
Phil Frost <indigo@xxxxxxxxxxx>**20041215130131]
[make shell.py use standard os module interface for file manipulation
Phil Frost <indigo@xxxxxxxxxxx>**20041212015448
oskit now provides filesystem functionality, and the old VFS interface is no
longer used.
]
["fix on the timming at thread.pyx"
alphakiller@xxxxxxxxxxxxx**20041212015751]
[move undefined symbol hacks to a separate file, undefined_symbols.c
Phil Frost <indigo@xxxxxxxxxxx>**20041212044600]
[oskit wrapper cleanup; release references when done
Phil Frost <indigo@xxxxxxxxxxx>**20041212044427]
[disable network init for now, until it works
Phil Frost <indigo@xxxxxxxxxxx>**20041212042729]
[remove some old cruft
Phil Frost <indigo@xxxxxxxxxxx>**20041212030336]
[remove src/lib/c
Phil Frost <indigo@xxxxxxxxxxx>**20041212011153
this was a modified version of dietlibc, but is no longer needed as oskit
provides the C library.
]
[oskit: mount root filesystem based on root=fu option at boot
Phil Frost <indigo@xxxxxxxxxxx>**20041211202012]
[oskit: wrap memfs as oskit.fs.MemFS
Phil Frost <indigo@xxxxxxxxxxx>**20041211201853]
[add 'options' dict to multiboot
Phil Frost <indigo@xxxxxxxxxxx>**20041211201752]
[panic when init.py can't run
Phil Frost <indigo@xxxxxxxxxxx>**20041211201654]
[oskit: wrap fsnamespace. Can mount and use filesystems now.
Phil Frost <indigo@xxxxxxxxxxx>**20041211172654]
[oskit: implement more filesystem methods, getroot, unmount, remount
Phil Frost <indigo@xxxxxxxxxxx>**20041211160226]
[oskit: kill cthread stuff again, due to conflicts
Phil Frost <indigo@xxxxxxxxxxx>**20041211043438]
[oskit: rename oskit.linux_fs to just oskit.fs and implement more methods
Phil Frost <indigo@xxxxxxxxxxx>**20041210152514]
[oskit: linux fs pyrex wrapper
Phil Frost <indigo@xxxxxxxxxxx>**20041210142130]
[oskit: working read method on blkio wrapper
Phil Frost <indigo@xxxxxxxxxxx>**20041207082502]
[oskit: start of a blkio pyrex wrapper
Phil Frost <indigo@xxxxxxxxxxx>**20041206153747]
[oskit: startvfs.h to allow socketmodule.c to bulid
Phil Frost <indigo@xxxxxxxxxxx>**20041202135211]
[oskit: networking support
Phil Frost <indigo@xxxxxxxxxxx>**20041129044854]
[enable unicode in python
Phil Frost <indigo@xxxxxxxxxxx>**20041128060029]
[oskit: make interrupts work again
Phil Frost <indigo@xxxxxxxxxxx>**20041128054654]
[oskit: getting there; boots to python prompt but many things are still broken
Phil Frost <indigo@xxxxxxxxxxx>**20041127201642]
[oskit: update multiboot module to use oskit interfaces
Phil Frost <indigo@xxxxxxxxxxx>**20041125174809]
[oskit: use oskit to provide multiboot, print message and hang at boot
Phil Frost <indigo@xxxxxxxxxxx>**20041125173250]
[add a very simple pyrex scanner to scons
Phil Frost <indigo@xxxxxxxxxxx>**20041211150358]
["fixes: UUUTime wrapper for SNAP added and Fixes on libc.pyx"
alphakiller@xxxxxxxxxxxxx**20041210190748]
[add unetcat, a simple clone of netcat in python
Phil Frost <indigo@xxxxxxxxxxx>**20041206153839]
["serial: Added Serial.py and testing Darcs workaround to it's bug"
alphakiller@xxxxxxxxxxxxx**20041128210043]
["wrapper: 1st Commit (makes able to run applications as python modules)"
alphakiller@xxxxxxxxxxxxx**20041202022105]
["scons: Building fixes"
alphakiller@xxxxxxxxxxxxx**20041130151704]
[remove libc.c
Phil Frost <indigo@xxxxxxxxxxx>**20041125163241
This is generated from libc.pyx, so is not needed.
]
[initial revision from
uuu-devel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/unununium--mainline--0.2--patch-14
Phil Frost <indigo@xxxxxxxxxxx>**20041125041506]
Patch bundle hash:
eb34a092fa380db5078db5ebb9abdcd07392078d
_______________________________________________
Uuu-devel mailing list
Uuu-devel@xxxxxxxxxxxxx
http://unununium.org/cgi-bin/mailman/listinfo/uuu-devel
|