From 220f284e18c0e234cdc9f4ca43d52c9fb78ed5e1 Mon Sep 17 00:00:00 2001 From: Michael Hatherly Date: Wed, 9 Dec 2015 19:08:45 +0200 Subject: [PATCH] Remove `atdoc_str` from Profile docs and reformat. --- base/docs/helpdb/Profile.jl | 106 ++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 59 deletions(-) diff --git a/base/docs/helpdb/Profile.jl b/base/docs/helpdb/Profile.jl index e37bc6b56621d..48c2938ed148a 100644 --- a/base/docs/helpdb/Profile.jl +++ b/base/docs/helpdb/Profile.jl @@ -2,95 +2,83 @@ # Base.Profile -doc""" -```rst -.. print([io::IO = STDOUT,] [data::Vector]; format = :tree, C = false, combine = true, cols = tty_cols()) - -Prints profiling results to ``io`` (by default, ``STDOUT``). If you -do not supply a ``data`` vector, the internal buffer of accumulated -backtraces will be used. ``format`` can be ``:tree`` or -``:flat``. If ``C==true``, backtraces from C and Fortran code are -shown. ``combine==true`` merges instruction pointers that -correspond to the same line of code. ``cols`` controls the width -of the display. -``` +""" + print([io::IO = STDOUT,] [data::Vector]; format = :tree, C = false, combine = true, cols = tty_cols()) + +Prints profiling results to `io` (by default, `STDOUT`). If you do not supply a `data` +vector, the internal buffer of accumulated backtraces will be used. `format` can be `:tree` +or `:flat`. If `C==true`, backtraces from C and Fortran code are shown. `combine==true` +merges instruction pointers that correspond to the same line of code. `cols` controls the +width of the display. """ Profile.print(io::IO = STDOUT, data::Vector=?) -doc""" -```rst -.. print([io::IO = STDOUT,] data::Vector, lidict::Dict; format = :tree, combine = true, cols = tty_cols()) +""" + print([io::IO = STDOUT,] data::Vector, lidict::Dict; format = :tree, combine = true, cols = tty_cols()) -Prints profiling results to ``io``. This variant is used to examine -results exported by a previous call to :func:`retrieve`. -Supply the vector ``data`` of backtraces and a dictionary -``lidict`` of line information. -``` +Prints profiling results to `io`. This variant is used to examine results exported by a +previous call to [`retrieve`](:func:`retrieve`). Supply the vector `data` of backtraces and +a dictionary `lidict` of line information. """ Profile.print(io::IO = STDOUT, data::Vector = ?, lidict::Dict = ?) -doc""" +""" init(; n::Integer, delay::Float64) -Configure the `delay` between backtraces (measured in seconds), and the number `n` of instruction pointers that may be stored. Each instruction pointer corresponds to a single line of code; backtraces generally consist of a long list of instruction pointers. Default settings can be obtained by calling this function with no arguments, and each can be set independently using keywords or in the order `(n, delay)`. +Configure the `delay` between backtraces (measured in seconds), and the number `n` of +instruction pointers that may be stored. Each instruction pointer corresponds to a single +line of code; backtraces generally consist of a long list of instruction pointers. Default +settings can be obtained by calling this function with no arguments, and each can be set +independently using keywords or in the order `(n, delay)`. """ Profile.init -doc""" -```rst -.. clear_malloc_data() +""" + clear_malloc_data() -Clears any stored memory allocation data when running julia with -``--track-allocation``. Execute the command(s) you want to test -(to force JIT-compilation), then call :func:`clear_malloc_data`. -Then execute your command(s) again, quit Julia, and examine the -resulting ``*.mem`` files. -``` +Clears any stored memory allocation data when running julia with `--track-allocation`. +Execute the command(s) you want to test (to force JIT-compilation), then call +[`clear_malloc_data`](:func:`clear_malloc_data`). Then execute your command(s) again, quit +Julia, and examine the resulting `*.mem` files. """ Profile.clear_malloc_data -doc""" -```rst -.. callers(funcname, [data, lidict], [filename=], [linerange=]) -> Vector{Tuple{count, linfo}} - -Given a previous profiling run, determine who called a particular -function. Supplying the filename (and optionally, range of line -numbers over which the function is defined) allows you to -disambiguate an overloaded method. The returned value is a vector -containing a count of the number of calls and line information -about the caller. One can optionally supply backtrace data -obtained from :func:`retrieve`; otherwise, the current internal profile -buffer is used. -``` +""" + callers(funcname, [data, lidict], [filename=], [linerange=]) -> Vector{Tuple{count, linfo}} + +Given a previous profiling run, determine who called a particular function. Supplying the +filename (and optionally, range of line numbers over which the function is defined) allows +you to disambiguate an overloaded method. The returned value is a vector containing a count +of the number of calls and line information about the caller. One can optionally supply +backtrace data obtained from [`retrieve`](:func:`retrieve`); otherwise, the current internal +profile buffer is used. """ Profile.callers -doc""" -```rst -.. fetch() -> data +""" + fetch() -> data -Returns a reference to the internal buffer of backtraces. Note that -subsequent operations, like :func:`clear`, can affect -``data`` unless you first make a copy. Note that the values in -``data`` have meaning only on this machine in the current session, -because it depends on the exact memory addresses used in -JIT-compiling. This function is primarily for internal use; -:func:`retrieve` may be a better choice for most users. -``` +Returns a reference to the internal buffer of backtraces. Note that subsequent operations, +like [`clear`](:func:`clear`), can affect `data` unless you first make a copy. Note that the +values in `data` have meaning only on this machine in the current session, because it +depends on the exact memory addresses used in JIT-compiling. This function is primarily for +internal use; [`retrieve`](:func:`retrieve`) may be a better choice for most users. """ Profile.fetch -doc""" +""" retrieve() -> data, lidict -"Exports" profiling results in a portable format, returning the set of all backtraces (`data`) and a dictionary that maps the (session-specific) instruction pointers in `data` to `LineInfo` values that store the file name, function name, and line number. This function allows you to save profiling results for future analysis. +"Exports" profiling results in a portable format, returning the set of all backtraces +(`data`) and a dictionary that maps the (session-specific) instruction pointers in `data` to +`LineInfo` values that store the file name, function name, and line number. This function +allows you to save profiling results for future analysis. """ Profile.retrieve -doc""" +""" clear() Clear any existing backtraces from the internal buffer. """ Profile.clear -