[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: Checkpointing of simple programs in FreeBSD
From:       "K. Macy" <kmacy () freebsd ! org>
Date:       2012-03-19 15:31:04
Message-ID: CAHM0Q_MOuez8JW_-Z3V7fY_yUb4ws62PbsUCJKZKpA1xhxywsg () mail ! gmail ! com
[Download RAW message or body]

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 state?
> For example, can someone tell me the steps so that I can checkpoint a small
> 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"



-- 
   “The 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’t
want their little lives disturbed by anything bigger than themselves.
Those with no sides and no causes. Those who won’t take measure of
their own strength, for fear of antagonizing their own weakness. Those
who don’t like to make waves—or enemies.

   Those for whom freedom, honour, truth, and principles are only
literature. Those who live small, love small, die small. It’s the
reductionist approach to life: if you keep it small, you’ll keep it
under control. If you don’t make any noise, the bogeyman won’t find
you.

   But it’s 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.

   I choose my own way to burn.”

   Sophie Scholl
_______________________________________________
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"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic