My initial thought was to fork the initial process, so as to exploit the copy-on-write fork implementation on Linux.<br><div><br></div><div>Then the forked process will call the function, and the parent will make the dump, by providing the PID of its child.</div><div><br></div><div>How does this sound to you? I don&#39;t know if its feasible, I &#39;ll just try to give it a shot!</div><div><br></div><div>I &#39;ll also have a chat about it with my research advisors, and get back to you!</div><div><br></div><div><br></div><div>Cheers,</div><div>Paschalis</div><br><div class="gmail_quote">On Mon Jan 26 2015 at 2:46:01 PM Pavel Emelyanov &lt;<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
&gt;     I would be happy to help, but I don&#39;t understand what &quot;function-only&quot; capturing means. Can<br>
&gt;     ​ ​<br>
&gt;     you describe your scenario in more details?<br>
&gt;<br>
&gt;<br>
&gt; Currently, I dump a program before the execution of the function daxpy. Then, I can replay<br>
&gt; the program from that point onwards. That replaying is basically like a resuming from that point, and<br>
&gt; I can ​do it<br>
&gt;  as many times as I want, since I have kept in disk some image files.<br>
&gt;<br>
<br>
Great! :)<br>
<br>
&gt; So, dump has captured all information needed not only by the &quot;daxpy&quot; functions, but also for the rest of the program.<br>
&gt;<br>
&gt;<br>
&gt; What I want, is to execute let&#39;s say in isolation the function &quot;daxpy&quot;. Then on dump,<br>
&gt;  I want t<br>
&gt; ​he contents of the images to be just the<br>
&gt; necessary information that the function<br>
&gt; ​&quot;​<br>
&gt; daxpy<br>
&gt; ​&quot;​<br>
&gt; needs.<br>
&gt; ​Such information are<br>
&gt; :<br>
&gt; ​.the parameters of &quot;daxpy&quot;<br>
&gt; .the code of the functions that are being called by the &quot;daxpy&quot;​<br>
&gt; .the global variables that are &quot;touched&quot; by &quot;daxpy&quot;, or by the functions that are called by &quot;daxpy&quot;<br>
&gt;<br>
&gt; With this information, I will NOT be able to resume the program. But, I will be able to replay just the function &quot;daxpy&quot;.<br>
<br>
Oh, I see. That would be an interesting feature indeed. But I&#39;m not an expert in compilers<br>
to say whether it&#39;s possible at all to find out the part of the in-memory state of a process<br>
that only &quot;relates&quot; to some function :)<br>
<br>
&gt; Once again, thank you very much Pavel for your prompt and really informative replies!<br>
<br>
You&#39;re always welcome!<br>
<br>
Thanks,<br>
Pavel<br>
<br>
<br>
</blockquote></div>