<div>hi everybody:</div><div>I write a test 'chat' code with eprof.</div><div>I have found the handle_info and handle_cast functions without in the anaylise result.</div><div>Why ?</div><div><br></div><div>thanks </div>
<div>Regards</div><div>jason</div><div><br></div><div><div> 1 -module(chat). </div>
<div> 2 -compile(export_all).</div><div> 3 %-behaviour(gen_server).</div><div> 4 start(N) -></div><div> 5 start_link(), </div><div> 6 eprof:start(),</div><div> 7 eprof:start_profiling([chat]),</div><div>
8 test(N),</div><div> 9 testcast(),</div><div> 10 test(),</div><div> 11 eprof:stop_profiling(),</div><div> 12 eprof:log(chat),</div><div> 13 eprof:analyse(),</div><div> 14 eprof:total_analyse(). </div>
<div> 15 </div><div> 16 test(N)-></div><div> 17 gen_server:call(?MODULE, {test,N}).</div><div> 18 test()-></div><div> 19 chat ! {test,1}.</div><div> 20 testcast() -></div><div> 21 gen_server:cast(?MODULE,castttt).</div>
<div> 22 </div><div> 23 start_link() -></div><div> 24 gen_server:start_link({local,?MODULE},?MODULE,[],[]).</div><div> 25 </div><div> 26 init([]) -></div><div> 27 {ok, {}}.</div><div> 28 </div><div> 29 handle_cast(Msg,State) -></div>
<div> 30 tttt(), </div><div> 31 io:format("cast=~p~n",[Msg]),</div><div> 32 {noreply,State}.</div><div> 33 </div><div> 34 handle_call({test,Number},From, State) when is_number(Number) -></div><div>
35 Reply = Number+1,</div><div> 36 {reply, Reply,State};</div></div><div><div> 37 </div><div> 38 handle_call(_,From, State) -></div><div> 39 Reply = numerror,</div><div> 40 {reply, Reply,State}.</div><div>
41 handle_info(Ino,State) -></div><div> 42 tttt(), </div><div> 43 io:format("info=~p~n",[Ino]),</div><div> 44 {noreply,State}.</div><div> 45 tttt() -></div><div> 46 ok.</div></div><div>%%%%%%%%%%%%%%%%%</div>
<div>Test result</div><div><div>5> chat:start(1).</div><div>eprof: Starting profiling ..... </div><div>eprof: Stop profiling</div><div>cast=castttt</div><div>info={test,1}</div><div>FUNCTION CALLS TIME </div>
<div><br></div><div>****** Process <0.35.0> -- 100 % of profiled time *** </div><div>gen_server:loop/6 1 30 % </div><div>gen_server:handle_msg/5 1 28 % </div>
<div>chat:handle_call/3 1 21 % </div><div>gen_server:reply/2 1 14 % </div><div>gen_server:decode_msg/8 1 8 % </div><div>
<br></div><div>Total time: 0.00</div><div>Measurement overhead: 0.00</div><div>FUNCTION CALLS TIME </div><div>gen_server:loop/6 1 30 % </div>
<div>gen_server:handle_msg/5 1 28 % </div><div>chat:handle_call/3 1 21 % </div><div>gen_server:reply/2 1 14 % </div>
<div>gen_server:decode_msg/8 1 8 % </div><div><br></div><div>Total time: 0.00</div><div>Measurement overhead: 0.00</div><div>ok</div><div>6> </div></div><div><br></div>