<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">&lt;<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>&gt;</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="">&gt;<br>
&gt;<br>
&gt; On Tue, Jan 27, 2015 at 12:05 PM, Pavel Emelyanov &lt;<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> &lt;mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 01/26/2015 08:05 PM, Paschalis Mpeis wrote:<br>
&gt;     &gt; My initial thought was to fork the initial process, so as to exploit the copy-on-write fork implementation on Linux.<br>
&gt;     &gt;<br>
&gt;     &gt; Then the forked process will call the function, and the parent will make the dump, by providing the PID of its child.<br>
&gt;<br>
&gt;     This would work, but will anyway dump the whole process. In order to dump only what it relevant<br>
&gt;     to a single function... hmm... you should either explore the binary with disassembler or...<br>
&gt;     maybe the memory tracked would help. You reset the tracker, then start working. Then you<br>
&gt;     call criu to dump the process and dump only what memory has changed. This will include only<br>
&gt;     what was touched by the function.<br>
&gt;<br>
&gt;<br>
&gt; ​So, I should reset the bits of the used memory pages, so CRIU will dump only the &quot;dirty&quot; 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>
&quot;parent&quot; image. In your case you do the single dump, so there&#39;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&#39;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="">
&gt; 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 &#39;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>