<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">On Tue, Jan 27, 2015 at 12:57 PM, Pavel Emelyanov </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 01/27/2015 03:48 PM, Paschalis Mpeis wrote:<br>
<span class="">><br>
><br>
> On Tue, Jan 27, 2015 at 12:05 PM, Pavel Emelyanov <<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> <mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>>> wrote:<br>
><br>
> On 01/26/2015 08:05 PM, Paschalis Mpeis wrote:<br>
> > My initial thought was to fork the initial process, so as to exploit the copy-on-write fork implementation on Linux.<br>
> ><br>
> > Then the forked process will call the function, and the parent will make the dump, by providing the PID of its child.<br>
><br>
> This would work, but will anyway dump the whole process. In order to dump only what it relevant<br>
> to a single function... hmm... you should either explore the binary with disassembler or...<br>
> maybe the memory tracked would help. You reset the tracker, then start working. Then you<br>
> call criu to dump the process and dump only what memory has changed. This will include only<br>
> what was touched by the function.<br>
><br>
><br>
> So, I should reset the bits of the used memory pages, so CRIU will dump only the "dirty" ones?<br>
<br>
</span>Yes and no. Currently CRIU knows how to work with memory tracked, but the<br>
implementation of it is pretty strict -- you should provide criu with the<br>
"parent" image. In your case you do the single dump, so there's no parent<br>
image and criu will always dump all the memory.</blockquote><div><div class="gmail_default" style="font-family:verdana,sans-serif"></div><div class="gmail_default" style="font-family:verdana,sans-serif">Hmmm.. on your project's homepage it is mentioned this:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Using this tool, you can freeze a running application (or part of it) and checkpoint it to a hard drive as a collection of files.</blockquote></div><div><div class="gmail_default" style="font-family:verdana,sans-serif"></div><div class="gmail_default" style="font-family:verdana,sans-serif">So, the way to do this, is to dump twice, the parent and the children? Then, there is a way to provide this to CRIU, so it can find the differences, and provide a new images that contains only the changed bits?</div><div class="gmail_default" style="font-family:verdana,sans-serif">Is there a documentation, or can you provide some guidance on this? Or at least the relevant source files, so I can have a look at them?</div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
> Or I should modify parts also parts of the dump functionality?<br>
<br>
</span>Yes. Look at the mem.c generate_iovs() function. It generates the bitmap<br>
of pages that should be taken into the image.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">Is this the function that excludes the pages of the parent?<br>Am I going to use the incremental dump feature of CRIU?</div><div class="gmail_default" style="font-family:verdana,sans-serif">For example:</div><div class="gmail_default" style="font-family:verdana,sans-serif">.dump1: parent process. </div><div class="gmail_default" style="font-family:verdana,sans-serif">.dump2: child process (incremental)</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">So, on restore I 'll have to make it work on non-complete image files? How hard will this be?</div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">Is there anything else that I should know so as to do this?</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Thank you very much, Pavel!</div></div></div></div></div>