Date: Mon, 19 Mar 2012 16:31:04 +0100 From: "K. Macy" <kmacy@freebsd.org> To: kota saikrishna <kotasaikrishna28@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Checkpointing of simple programs in FreeBSD Message-ID: <CAHM0Q_MOuez8JW_-Z3V7fY_yUb4ws62PbsUCJKZKpA1xhxywsg@mail.gmail.com> In-Reply-To: <CAB%2BEr%2Bmk1XmFOuOVnZsfrJ9Of=5D4HtS6M65Xc-3VCYRKvwQ4Q@mail.gmail.com> References: <CAB%2BEr%2Bmk1XmFOuOVnZsfrJ9Of=5D4HtS6M65Xc-3VCYRKvwQ4Q@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Take a look at gcore. That will let you checkpoint memory mappings and registers. The dragonfly implementation also keeps track of the sbrk value and open file handles which you will need to handle separately. Restoring the mappings and register state should be straightforward. I'm not sure at how you get the open file handles - look at how 'lsof' does it. Restoring pipes obviously makes no sense unless you checkpoint all processes in the graph and restoring sockets is something you'd want to defer to a restore handler. I can't speak for the current implementation, but the original was my first foray in to kernel hacking and only took a few days to implement so I would wager that porting it can't be all that difficult even with the divergence in kernel internals between FreeBSD and DragonFly. Cheers, Kip On Mon, Mar 19, 2012 at 3:15 PM, kota saikrishna <kotasaikrishna28@gmail.com> wrote: > I found that checkpointing and restart of a process is available for > DragonFlyBSD. > I need this feature for FreeBSD. How can I checkpoint simple programs in > FreeBSD such that they can be restored and run from the checkpointed stat= e? > For example, can someone tell me the steps so that I can checkpoint a sma= ll > program (that prints a few lines say) half way through its run, and then > restore it and print the rest of the lines? > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " --=20 =A0 =A0=93The real damage is done by those millions who want to 'get by.' The ordinary men who just want to be left in peace. Those who don=92t want their little lives disturbed by anything bigger than themselves. Those with no sides and no causes. Those who won=92t take measure of their own strength, for fear of antagonizing their own weakness. Those who don=92t like to make waves=97or enemies. =A0 =A0Those for whom freedom, honour, truth, and principles are only literature. Those who live small, love small, die small. It=92s the reductionist approach to life: if you keep it small, you=92ll keep it under control. If you don=92t make any noise, the bogeyman won=92t find you. =A0 =A0But it=92s all an illusion, because they die too, those people who roll up their spirits into tiny little balls so as to be safe. Safe?! >From what? Life is always on the edge of death; narrow streets lead to the same place as wide avenues, and a little candle burns itself out just like a flaming torch does. =A0 =A0I choose my own way to burn.=94 =A0 =A0Sophie Scholl
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHM0Q_MOuez8JW_-Z3V7fY_yUb4ws62PbsUCJKZKpA1xhxywsg>