<div>Roux,</div>
<div> </div>
<div>This is really helpful. I got fprof included in the release file, and fprof was in the release. But I did not figure out how to profile the whole system. The user guide just shows how to profile a particular function. I tried fprof:trace(start), fprof:trace(stop), fprof:profile(), fprof:analyse() without luck. The server is a call server and spawning many processes.</div>
<div> </div>
<div>Thanks again for the detailed explanation.</div>
<div> </div>
<div>kaiduan<br><br></div>
<div class="gmail_quote">On Fri, Jan 30, 2009 at 6:25 AM, Roux Viljoen <span dir="ltr"><<a href="mailto:roux.viljoen@erlang-consulting.com">roux.viljoen@erlang-consulting.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div></div>
<div class="Wj3C7c">Kaiduan Xie <kaiduanx <at> <a href="http://gmail.com/" target="_blank">gmail.com</a>> writes:<br><br>><br>> The production server is structured as an OTP application, and an Erlang<br>
shell is attached. How to profile the WHOLE system with fprof from the shell?<br>Detailed command sequence is highly appreciated.Thanks a lot for help,kaiduan<br>><br><br><br></div></div>Kaiduan Xie,<br><br>Fprof is part of the tools library found in OTP, so first you need to make sure<br>
its loaded with your application by adding it to your release.<br>Add this to the list of applications in the release file, just change the<br>version to match yours:<br>{tools, '2.6.2'}<br><br>Now you can use the fprof application. There is alot of ways to use fprof, but<br>
the following should be fine. First start a trace by entering:<br><br>fprof:trace([start, {file, "/home/kaiduanxie/first.trace"}, verbose,<br>{procs,all}]).<br><br>Now you can run whichever processes you want to profile and then when you're<br>
done, stop the trace by entering:<br><br>fprof:trace([stop]).<br><br>The trace file can now be profiled and analyzed:<br><br>fprof:profile({file, "/home/kaiduanxie/first.trace"}).<br>fprof:analyse([totals, {dest, "/home/kaiduanxie/first.analysis"}]).<br>
<br>This will produce the first.analysis file which will contain all the data<br>you want. Just be aware that fprof has many configuration options available,<br>this was just a simplistic example.<br><br>Also, in this example we used the {procs,all} option when we started the trace,<br>
this allowed fprof to trace ALL processes. This can cause the trace and<br>analysis files to be huge if you're gonna run alot of processes, so just make<br>sure you have enough disk space.<br><br>Please consult the documentation for the configuration options if this example<br>
does not produce the desired results.<br><br>Good luck,<br><br><br>Roux Viljoen<br>Erlang Training & Consulting<br><a href="http://www.erlang-consulting.com/" target="_blank">http://www.erlang-consulting.com</a><br><br>
<br><br><br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>