Hi Bjorn,<br><br>Thank you very much for your help, you were right that I only included my own module in the eprof. I ran it again now with file_server_2, the time in file_name_1 has now dropped to 27%:<br><br>6> eprof:total_analyse().<br>
FUNCTION                                       CALLS      TIME <br>erlang:port_command/2                          65075      53 % <br>file:file_name_1/1                             3086234    27 % <br>prim_file:get_uint32s/1                        231210     3 % <br>
prim_file:drv_get_response/1                   72301      1 % <br>prim_file:uint32/4                             223503     1 % <br>gen:do_call/4                                  29869      1 % <br>prim_file:drv_command/4                        65075      1 % <br>
prim_file:translate_response/2                 72301      1 % <br>gen_server:handle_msg/5                        29869      1 % <br>prim_file:drv_command/3                        65075      1 % <br>file:check_args/1                              93941      0 % <br>
gen:wait_resp_mon/3                            29869      0 % <br>file_server:handle_call/3                      29869      0 % <br>mirror11:get_file_info/2                       21195      0 % <br>erlang:iolist_to_binary/1                      44100      0 % <br>
prim_file:get_uint64/1                         28462      0 % <br>prim_file:drv_get_response/2                   72301      0 % <br>file:check_and_call/2                          29869      0 % <br>gen:call/4                                     29869      0 % <br>
prim_file:open_int/4                           26976      0 % <br>file:file_name/1                               36615      0 % <br>file:call/2                                    29869      0 % <br>prim_file:open_mode/4                          40464      0 % <br>
gen_server:call/3                              29869      0 % <br>prim_file:drv_command/2                        64113      0 % <br>erlang:bump_reductions/1                       72301      0 % <br>gen_server:loop/6                              29869      0 % <br>
prim_file:write_file_info_int/3                7225       0 % <br>mirror11:do_file/4                             6744       0 % <br>prim_file:reverse/1                            26976      0 % <br>prim_file:get_uint32/1                         56924      0 % <br>
gen_server:reply/2                             29869      0 % <br>prim_file:transform_info_ints/1                7707       0 % <br>file:read_link_info/1                          14451      0 % <br>file:copy_int/3                                13488      0 % <br>
prim_file:drv_close/1                          13488      0 % <br>erlang:'++'/2                                  21680      0 % <br>erlang:monitor/2                               29869      0 % <br>gen_server:decode_msg/8                        29869      0 % <br>
erlang:whereis/1                               29869      0 % <br>erlang:open_port/2                             13488      0 % <br>prim_file:open/2                               13488      0 % <br>erlang:list_to_tuple/1                         29869      0 % <br>
prim_file:close/1                              13488      0 % <br>erlang:list_to_binary/1                        21195      0 % <br>erlang:port_close/1                            13488      0 % <br>erlang:demonitor/1                             29869      0 % <br>
prim_file:drv_open/2                           13488      0 % <br>prim_file:open_mode/1                          13488      0 % <br>file:copy_opened_int/4                         7487       0 % <br>mirror11:by_type/6                             7707       0 % <br>
ets:lookup/2                                   21195      0 % <br>lists:reverse/2                                26976      0 % <br>lists:foreach/2                                7708       0 % <br>prim_file:int_to_bytes/1                       21675      0 % <br>
mirror11:log_debug/2                           6748       0 % <br>prim_file:date_to_bytes/1                      21675      0 % <br>file:write_file_info/2                         7225       0 % <br>prim_file:read/2                               7487       0 % <br>
prim_file:write/2                              7487       0 % <br>prim_file:read_link_info/2                     14451      0 % <br>prim_file:read_link_info_int/2                 14451      0 % <br>ets:insert/2                                   7707       0 % <br>
prim_file:open_int_setopts/3                   13488      0 % <br>erlang:list_to_atom/1                          7227       0 % <br>file:read/2                                    7487       0 % <br>file:write/2                                   7487       0 % <br>
mirror11:do_dir/3                              481        0 % <br>prim_file:copy/3                               6744       0 % <br>prim_file:write_file_info/3                    7225       0 % <br>prim_file:file_access/1                        7707       0 % <br>
file:copy_opened_int/3                         6744       0 % <br>prim_file:file_type/1                          7707       0 % <br>file:copy_opened/3                             6744       0 % <br>mirror11:'-do_dir/3-fun-5-'/4                  6744       0 % <br>
file:copy/2                                    6744       0 % <br>ets:delete/1                                   481        0 % <br>mirror11:start_dir_workers/5                   963        0 % <br>file:list_dir/1                                962        0 % <br>
mirror11:rendezvous/1                          963        0 % <br>file:make_dir/1                                481        0 % <br>erlang:apply/2                                 481        0 % <br>erlang:spawn/3                                 481        0 % <br>
ets:new/2                                      481        0 % <br>prim_file:list_dir/2                           962        0 % <br>erlang:spawn/1                                 481        0 % <br>prim_file:list_dir_int/2                       962        0 % <br>
prim_file:make_dir/2                           481        0 % <br>prim_file:make_dir_int/2                       481        0 % <br>mirror11:'-start_dir_workers/5-fun-0-'/3       481        0 % <br>mirror11:do_symlink/4                          2          0 % <br>
file:read_link/1                               4          0 % <br>mirror11:master_loop/0                         1          0 % <br>file:make_symlink/2                            2          0 % <br>prim_file:read_link/2                          4          0 % <br>
prim_file:read_link_int/2                      4          0 % <br>mirror11:'-do_dir/3-fun-6-'/4                  2          0 % <br>prim_file:make_symlink/3                       2          0 % <br>prim_file:make_symlink_int/3                   2          0 % <br>
<br>Total time: 157.56<br>Measurement overhead: 20.49<br><br>Thanks,<br>Ville<br><br><br><div class="gmail_quote">On Tue, Feb 17, 2009 at 10:10 AM, Bjorn Gustavsson <span dir="ltr"><<a href="mailto:bgustavsson@gmail.com">bgustavsson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Unless you specifically included the file_server_2 process in the set<br>
of processes<br>
to profile, you are only profiling the time spent in your own<br>
processes and not code<br>
that is executed in other processes. (And since I don't see no calls<br>
from the file_server or prim_file<br>
module in the output from eprof, I assume that you did not include the<br>
file_server_2 process.)<br>
<div><div></div><div class="Wj3C7c"><br>
/Bjorn<br>
--<br>
Björn Gustavsson, Erlang/OTP, Ericsson AB<br>
</div></div></blockquote></div><br>