[Mono-list] Profiling is not working?

Rodrigo Kumpera kumpera at gmail.com
Thu Aug 6 15:16:40 EDT 2009


Profiling is only supported on linux.

The default profiler is not recommended on recent versions of mono (2.4 or
trunk),
please try the new logging profiler[1], which have a work-in-progress GUI[2]
for it.

Keep in mind that under statistical profiling you need to run a long enough
program
to get enough samples and build a meaningful result. Usually 1-15 minutes of
steady
state execution is enough to capture enough information.

The new statistical profiler returns information of managed and unmanaged
code
mixed together so if you get a result with too many frames from the mono
runtime
I can give you a hand on figuring out the problem if I get access to the
sampling file.

Cheers,
Rodrigo

[1] http://www.mono-project.com/LoggingProfiler
[2] http://mono-project.com/MonoVisualProfiler

On Thu, Aug 6, 2009 at 2:55 PM, fsmac <yves at mindset-media.com> wrote:

>
> Hi,
>
> I've been trying to use profiling with mono to look at the performance of
> our application. (We have an F# application that runs pretty fast on
> Windows
> but is extremely slow on Linux or Mac OS X). I have tried a few different
> invocations of profiling, the last one being:
>
>    mono --profile=default:stat .....
>
> On Linux, I some output but none is about my code and mono says 0 methods
> compiled and 0 calls made. The following is mono's output.
>
> prof counts: total/unmanaged: 182/175
>     11  6.08 % mono(mono_local_cprop
>      9  4.97 % mono(mono_method_to_ir
>      8  4.42 % mono(mono_local_regalloc
>      7  3.87 % /lib64/libc.so.6(memset
>      6  3.31 % mono(mono_local_deadce
>      5  2.76 % /lib64/libc.so.6(_int_malloc
>      5  2.76 % mono(mono_generic_inst_equal_full
>      5  2.76 % mono(mono_handle_global_vregs
>      4  2.21 % mono(mono_spill_global_vars
>      4  2.21 % /lib64/libc.so.6(bsearch
>      4  2.21 % mono(lookup_internal
>      4  2.21 % /lib64/libpthread.so.0(write
>      4  2.21 % /lib64/libpthread.so.0(pthread_mutex_lock
>      4  2.21 % mono(mono_peephole_ins
>      4  2.21 % /lib64/libglib-2.0.so.0(g_hash_table_lookup
>      4  2.21 % mono(mono_metadata_decode_row
>      4  2.21 % mono(get_method_token
>      3  1.66 % mono(mono_type_equal
>      3  1.66 % /lib64/libpthread.so.0(__pthread_mutex_unlock_usercnt
>      3  1.66 % /lib64/libglib-2.0.so.0(g_str_hash
>      2  1.10 % /lib64/libglib-2.0.so.0(g_slice_free_chain_with_offset
>      2  1.10 % /lib64/libc.so.6(__libc_calloc
>      2  1.10 % mono(mono_mempool_alloc
>      2  1.10 % mono(mono_class_init
>      2  1.10 % /lib64/libc.so.6(strcmp
>      2  1.10 % mono(mono_optimize_branches
>      2  1.10 % mono(mono_metadata_type_hash
>      2  1.10 % mono(get_hazardous_pointer
>      2  1.10 % mono(set_vreg_to_inst
>      2  1.10 % mono(table_locator
>      2  1.10 % /lib64/libc.so.6(__libc_malloc
>      2  1.10 % mono(mono_find_block_region
>      2  1.10 % mono(mono_arch_output_basic_block
>      2  1.10 % mono(do_mono_metadata_type_equal
>      2  1.10 % mono(get_basic_blocks
>      1  0.55 % /lib64/libglib-2.0.so.0(g_list_foreach
>      1  0.55 % mono(mono_if_conversion
>      1  0.55 % /lib64/libglib-2.0.so.0(g_list_insert_before
>      1  0.55 % mono(do_mono_metadata_parse_type
>      1  0.55 % mono(mono_codegen
>      1  0.55 % mono(get_call_info
>      1  0.55 % /lib64/libglib-2.0.so.0(g_realloc
>      1  0.55 % mono(GC_mark_from
>      1  0.55 % Mono.Xml2.XmlTextReader:ReadChar ()
>      1  0.55 % /lib64/libc.so.6(brk
>      1  0.55 % mono(find_method_icall
>      1  0.55 % mono(compute_dominators
>      1  0.55 % mono(move_basic_block_to_end
>      1  0.55 % mono(mono_metadata_parse_type_full
>      1  0.55 % mono(mono_loader_lock
>      1  0.55 % mono(emit_stloc_ir
>      1  0.55 % System.Configuration.PropertyInformationCollection:get_Item
> (string)
>      1  0.55 % mono(g_direct_hash
>      1  0.55 % /lib64/libc.so.6(_int_free
>      1  0.55 % /lib64/libc.so.6(malloc_consolidate
>      1  0.55 % mono(inflate_generic_type
>      1  0.55 % System.Text.StringBuilder:Append (char)
>      1  0.55 % string:GetHashCode ()
>      1  0.55 % mono(check_call_signature
>      1  0.55 % mono(mono_metadata_decode_row_col
>      1  0.55 % /lib64/libglib-2.0.so.0(g_hash_table_insert
>      1  0.55 % mono(mono_get_method_from_token
>      1  0.55 % /lib64/libglib-2.0.so.0(g_atomic_int_exchange_and_add
>      1  0.55 % mono(mono_metadata_class_equal
>      1  0.55 % Mono.Globalization.Unicode.SimpleCollator:GetContraction
> (string,int,int,Mono.Globalization.Unicode.Contraction[])
>      1  0.55 % mono(type_from_op
>      1  0.55 % mono(find_method_in_class
>      1  0.55 % mono(mono_varlist_sort
>      1  0.55 % mono(mono_decompose_vtype_opts
>      1  0.55 % /lib64/libglib-2.0.so.0(g_list_prepend
>      1  0.55 % mono(mono_metadata_string_heap
>      1  0.55 % /lib64/libc.so.6(_IO_old_init
>      1  0.55 % mono(mono_save_args
>      1  0.55 % mono(mono_object_new
>      1  0.55 % mono(mono_call_inst_add_outarg_reg
>      1  0.55 % mono(mono_class_vtable
>      1  0.55 % mono(mono_domain_get
>      1  0.55 % mono(mono_jit_compile_method
>      1  0.55 % mono(mono_metadata_parse_mh_full
>      1  0.55 % mono(setup_interface_offsets
>      1  0.55 % mono(mono_get_root_domain
>      1  0.55 % System.Text.StringBuilder:set_Length (int)
>      1  0.55 % mono(mono_analyze_liveness
>      1  0.55 % mono(emit_call_body
>      1  0.55 %
> Total time spent compiling 0 methods (sec): 0
> Total number of calls: 0
>
> Allocation profiler
> Total memory allocated: 0 KB
>
> for this version of mono:
>
> % mono -V
> Mono JIT compiler version 2.4 (tarball Wed Jun 17 17:53:35 EDT 2009)
> Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
>        TLS:           __thread
>        GC:            Included Boehm (with typed GC)
>        SIGSEGV:       altstack
>        Notifications: epoll
>        Architecture:  amd64
>        Disabled:      none
>
> On Mac OS/X I get a SIGABRT:
>
> **
> ERROR:handles.c:497:_wapi_handle_new: assertion failed:
> (_wapi_has_shut_down
> == FALSE)
>
> ** (Metrics.exe:7915): WARNING **: Thread 0x0 may have been prematurely
> finalized
> Stacktrace:
>
>
> ** (Metrics.exe:7915): WARNING **: Thread 0x0 may have been prematurely
> finalized
>
> ** (Metrics.exe:7915): WARNING **: Thread 0x0 may have been prematurely
> finalized
>
> Native stacktrace:
>
>        0   mono                                0x00081b29
> mono_handle_native_sigsegv + 265
>        1   libSystem.B.dylib                   0x93b5c2bb _sigtramp + 43
>        2   ???                                 0xffffffff 0x0 + 4294967295
>        3   libSystem.B.dylib                   0x93bd023a raise + 26
>        4   libSystem.B.dylib                   0x93bdc679 abort + 73
>        5   libglib-2.0.0.dylib                 0x00370e72
> g_assertion_message +
> 258
>        6   libglib-2.0.0.dylib                 0x003714e8
> g_assertion_message_expr
> + 88
>        7   mono                                0x0017ab82 _wapi_handle_new
> + 130
>        8   mono                                0x001a04db
> _wapi_thread_duplicate +
> 203
>        9   mono                                0x0017a0e5 DuplicateHandle +
> 101
>        10  mono                                0x00160d49
> mono_thread_attach + 201
>        11  mono                                0x0013aa06
> mono_profiler_coverage_get + 3398
>        12  mono                                0x00139926
> mono_profiler_shutdown +
> 38
>        13  mono                                0x0000b202 mini_cleanup + 66
>        14  mono                                0x00065f96 mono_main + 5670
>        15  mono                                0x00001776 start + 54
>
> Debug info from gdb:
>
>
> =================================================================
> Got a SIGABRT while executing native code. This usually indicates
> a fatal error in the mono runtime or one of the native libraries
> used by your application.
> =================================================================
>
>
> Debug info from gdb:
>
>
> =================================================================
> Got a SIGABRT while executing native code. This usually indicates
> a fatal error in the mono runtime or one of the native libraries
> used by your application.
> =================================================================
>
> zsh: abort      mono --profile=default:stat Metrics.exe --help
>
> % mono -V
> Mono JIT compiler version 2.4 (tarball Wed May 27 21:40:43 PDT 2009)
> Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
>        TLS:           normal
>        GC:            Included Boehm (with typed GC)
>        SIGSEGV:       normal
>        Notification:  Thread + polling
>        Architecture:  x86
>        Disabled:      none
>
>
>
> How can I get profiling to work? The code was compiled on Windows using
> MS's
> F# compiler (which does not work on mono right now).
>
> Thanks for any help.
> YA
>
> --
> View this message in context:
> http://www.nabble.com/Profiling-is-not-working--tp24834274p24834274.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090806/e6be7c2a/attachment-0001.html 


More information about the Mono-list mailing list