From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 19 15:31:05 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE6C31065675 for ; Mon, 19 Mar 2012 15:31:04 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id A16FD8FC15 for ; Mon, 19 Mar 2012 15:31:04 +0000 (UTC) Received: by iahk25 with SMTP id k25so13489354iah.13 for ; Mon, 19 Mar 2012 08:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=8cjZTZLMrP5nWv0qIDoizMBJR11LJAV9GlBdMbv/WIU=; b=ZbvJJjEAMugPhG3XL6cpIEfBOoCw8tx4WkNOEQ+SVb/3bgUKw7R9Ycrt1uH0pgHYu8 bu529AdSjEuGxte6clmMFk1RO+Bbhn1qcPoEore6dGT57D47H46GvSdASWcMP+IK+QGa ismA7J69N8cCvsJsoPMQtUzGR6Cvc7pI/GgYDKk7WaFaAk7dL1bHW34QkggeDtkEQixX aalLzm9ZRh/ZmjRalQfTq63a/X3O61wOItt0y74dn1fT2L8ryG4ANzStAtzegjkTXQl6 wWywr3D2ZLP4oP86716OQW5xjM5DdcBuj9Tr3/BvrQzyRnHZxUoUS7sxWPxqwHdX4GoN /C1A== MIME-Version: 1.0 Received: by 10.50.42.136 with SMTP id o8mr6347896igl.38.1332171064266; Mon, 19 Mar 2012 08:31:04 -0700 (PDT) Sender: kmacybsd@gmail.com Received: by 10.50.134.106 with HTTP; Mon, 19 Mar 2012 08:31:04 -0700 (PDT) In-Reply-To: References: Date: Mon, 19 Mar 2012 16:31:04 +0100 X-Google-Sender-Auth: 5ue702A6VJxl_GgJuPAez-EuOHg Message-ID: From: "K. Macy" To: kota saikrishna Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Checkpointing of simple programs in FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 15:31:05 -0000 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 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