Skip to content

Commit

Permalink
Fix and update documentation for Profile.print
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jan 2, 2016
1 parent edc762c commit 5e72ae2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
21 changes: 14 additions & 7 deletions base/docs/helpdb/Profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,28 @@
# Base.Profile

"""
print([io::IO = STDOUT,] [data::Vector]; format = :tree, C = false, combine = true)
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.
print([io::IO = STDOUT,] [data::Vector]; format = :tree, C = false, combine = true, maxdepth = typemax(Int), sortedby = :filefuncline)
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. `maxdepth` can be used to limit the depth of printing in `:tree`
format, while `sortedby` can be used to control the order in `:flat`
format (`:filefuncline` sorts by the source line, whereas `:count`
sorts in order of number of collected samples).
"""
Profile.print(io::IO = STDOUT, data::Vector=?)

"""
print([io::IO = STDOUT,] data::Vector, lidict::Dict; format = :tree, combine = true)
print([io::IO = STDOUT,] data::Vector, lidict::Dict; kwargs)
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.
See `Profile.print([io], data)` for an explanation of the valid keyword arguments.
"""
Profile.print(io::IO = STDOUT, data::Vector = ?, lidict::Dict = ?)

Expand Down
8 changes: 5 additions & 3 deletions doc/stdlib/profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ The methods in :mod:`Base.Profile` are not exported and need to be called e.g. a
Clear any existing backtraces from the internal buffer.

.. function:: print([io::IO = STDOUT,] [data::Vector]; format = :tree, C = false, combine = true, cols = tty_cols())
.. function:: print([io::IO = STDOUT,] [data::Vector]; format = :tree, C = false, combine = true, maxdepth = typemax(Int), sortedby = :filefuncline)

.. Docstring generated from Julia source
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.
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. ``maxdepth`` can be used to limit the depth of printing in ``:tree`` format, while ``sortedby`` can be used to control the order in ``:flat`` format (``:filefuncline`` sorts by the source line, whereas ``:count`` sorts in order of number of collected samples).

.. function:: print([io::IO = STDOUT,] data::Vector, lidict::Dict; format = :tree, combine = true, cols = tty_cols())
.. function:: print([io::IO = STDOUT,] data::Vector, lidict::Dict; kwargs)

.. Docstring generated from Julia source
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.

See ``Profile.print([io], data)`` for an explanation of the valid keyword arguments.

.. function:: init(; n::Integer, delay::Float64)

.. Docstring generated from Julia source
Expand Down

0 comments on commit 5e72ae2

Please sign in to comment.