.SH DEVELOPMENT OPTIONS
The following options are used to help when developing a JITed application.
.TP
-.I "--debug"
+.I "--debug", "--debug=OPTIONS"
Turns on the debugging mode in the runtime. If an assembly was
compiled with debugging information, it will produce line number
information for stack traces.
+.RS
+.ne 8
+.PP
+The optional OPTIONS argument is a comma separated list of debugging
+options. These options are turned off by default since they generate
+much larger and slower code at runtime.
+.TP
+The following options are supported:
+.TP
+.I casts
+Produces a detailed error when throwing a InvalidCastException.
+.TP
+.I mdb-optimizations
+Disable some JIT optimizations which are usually only disabled when
+running inside the debugger. This can be helpful if you want to attach
+to the running process with mdb.
+.ne
+.RE
.TP
.I "--profile[=profiler[:profiler_args]]"
Turns on profiling. For more information about profiling applications
The output of this profile can be fed back into Mono's AOT compiler to
order the functions on the disk to produce precompiled images that
have methods in sequential pages.
+.PP
+The
+.I logging profiler
+will eventually replace the default one. It is a
+"general purpose" profiler, which can report method execution time,
+allocations, jit time, and can also work in statistical mode. You invoke
+it with:
+.nf
+ mono --profile=logging program.exe
+.fi
+Its main characteristic is that it does not print the profiling data
+at the end of the program execution, and in fact it does not elaborate
+the events at all; instead, it logs them into a file periodically
+during the program execution. The file is binary, and encoded as packed
+as possible, so to see the data you must use a decoder program, which
+you can find in svn in the "Mono.Profiler" module.
+.PP
+Some examples: to use the statistical profiler:
+.nf
+ mono --profile=logging:s program.exe
+.fi
+To profile method enter-exit and allocations:
+.nf
+ mono --profile=logging:c,a program.exe
+.fi
+To profile method enter-exit and jit time, and write the data to "mydata.mprof":
+.nf
+ mono --profile=logging:c,j,o=mydata.mprof program.exe
+.fi
+Then you would need to invoke the decoder on "mydata.mprof" to see the
+profiling results.
+.PP
+In its current state, this profiler can also perform heap analysis (like
+heap-shot), and the decoder is already able to read the data, however
+the user interface for this feature has not yet been written (which means
+that the data is not printed by the decoder).
+.PP
+More explanations are provided here: "http://www.mono-project.com/LoggingProfiler".
+.PP
+The whole set of options accepted by the logging profiler is the following:
+.TP
+.I output
+(or "out" or "o", default "o=profiler-log.prof"): the name of the output file.
+.TP
+.I jit
+(or "j"): collect information about time spent jitting methods.
+.TP
+.I allocations
+(or "alloc" or "a"): collect information about each allocation (object class
+and size).
+.TP
+.I enter-leave
+(or "calls" or "c"): measure the time spent inside each method call.
+.TP
+.I statistical
+(or "stat" or "s"): do statistical profiling.
+.TP
+.I unreachable
+(or "free" or "f"): enable garbage collection profiling in its lightweight
+form (at each collection, the list if unreachable objects is dumped, and
+for each object the class and size is provided, which together with the
+basic allocation information allows to compute the heap size broken down
+by class).
+.TP
+.I heap-shot
+(or "heap" or "h"): enable full heap profiling, in this case at each
+collection a full heap snapshot is dumped to disk.
+.TP
+.I gc-commands
+(or "gc-c" or "gcc", default none, file name required): the name of the
+file that controls the heap snapshot dumps.
+.TP
+.I gc-dumps
+(or "gc-d" or "gcd", default "gcd=0"): the initial number of heap
+snapshots to dump (if the control file is not used).
+.TP
+.I per-thread-buffer-size
+(or "tbs", default "tbs=10000"): the number of events that a thread buffer
+can hold, when it's full it is written to disk (the writing thread is the
+one that filled its buffer).
+.TP
+.I statistical-thread-buffer-size
+(or "sbs", default "sbs=10000"): the number of statistical samples that
+are hold in memory before they are dumped to disk (the system does
+double-buffering and the statistical samples are written by a helper
+thread).
+.TP
+.I write-buffer-size
+(or "wbs", default "wbs=1024"): size in bytes of the internal write
+buffers.
.SH CUSTOM PROFILERS
Mono provides a mechanism for loading other profiling modules which in
the form of shared libraries. These profiling modules can hook up to
If this variable is set, when the Mono VM runs into a verification
problem, instead of throwing an exception it will break into the
debugger. This is useful when debugging verifier problems
+.TP
+.I "no-gdb-backtrace"
+This option will disable the GDB backtrace emitted by the runtime
+after a SIGSEGV or SIGABRT in unmanaged code.
.ne
.RE
.TP
.fi
.TP
.I "MONO_MANAGED_WATCHER"
-If set to any value, System.IO.FileSystemWatcher will use the default
-managed implementation (slow). If unset, mono will try to use FAM under
-Unix systems and native API calls on Windows, falling back to the
-managed implementation on error.
+If set to "disabled", System.IO.FileSystemWatcher will use a file watcher
+implementation which silently ignores all the watching requests.
+If set to any other value, System.IO.FileSystemWatcher will use the default
+managed implementation (slow). If unset, mono will try to use inotify, FAM,
+Gamin, kevent under Unix systems and native API calls on Windows, falling
+back to the managed implementation on error.
.TP
.I "MONO_NO_SMP"
If set causes the mono process to be bound to a single processor. This may be
.nf
valgrind --suppressions=mono.supp mono ...
.fi
+.SH DTRACE
+On some platforms, Mono can expose a set of DTrace probes (also known
+as user-land statically defined, USDT Probes).
+.TP
+They are defined in the file `mono.d'.
+.TP
+.B ves-init-begin, ves-init-end
+.Sp
+Begin and end of runtime initialization.
+.TP
+.B method-compile-begin, method-compile-end
+.Sp
+Begin and end of method compilation.
+The probe arguments are class name, method name and signature,
+and in case of method-compile-end success or failure of compilation.
+.TP
+.B gc-begin, gc-end
+.Sp
+Begin and end of Garbage Collection.
+.TP
+To verify the availability of the probes, run:
+.nf
+ dtrace -P mono'$target' -l -c mono
+.fi
.SH FILES
On Unix assemblies are loaded from the installation lib directory. If you set
`prefix' to /usr, the assemblies will be located in /usr/lib. On