diff -r fbe139a244b4 Doc/library/profile.rst --- a/Doc/library/profile.rst Mon Oct 08 10:42:22 2012 +0200 +++ b/Doc/library/profile.rst Mon Oct 08 16:35:53 2012 +0200 @@ -224,11 +224,12 @@ .. function:: run(command, filename=None, sort=-1) This function takes a single argument that can be passed to the :func:`exec` - function, and an optional file name. In all cases this routine attempts to - :func:`exec` its first argument, and gather profiling statistics from the - execution. If no file name is present, then this function automatically - prints a simple profiling report, sorted by the standard name string - (file/line/function-name) that is presented in each line. The following is a + :func:`exec` function, and optionally a file name and a sorting + directive. In all cases this routine attempts to :func:`exec` + its first argument, and gather profiling statistics from the + execution. If no file name is present, then this function automatically + prints a simple profiling report, sorted by the standard name string + (file/line/function-name) that is presented in each line. The following is a typical output from such a call:: 2706 function calls (2004 primitive calls) in 4.504 CPU seconds @@ -269,11 +270,16 @@ When there are two numbers in the first column (for example, ``43/3``), then the latter is the number of primitive calls, and the former is the actual number of calls. Note that when the function does not recurse, these two values are the - same, and only the single figure is printed. + same, and only the single figure is printed. - If *sort* is given, it can be one of ``'stdname'`` (sort by filename:lineno), - ``'calls'`` (sort by number of calls), ``'time'`` (sort by total time) or - ``'cumulative'`` (sort by cumulative time). The default is ``'stdname'``. + If *sort* is given, it can be one of ``'stdname'``, ``'filename'``, ``'module'`` + (sort by filename:lineno), ``'nfl'`` (sort by name/file/line), + ``'calls'``, ``'ncalls'`` (sort by number of calls), + ``'pcalls'`` (sort by primitive number of calls), ``'time'``, ``'totime'`` + (sort by total time), ``'cumulative'``, ``'cumtime'`` (sort by cumulative time), + ``'line'`` (sort by line number). The default is ``'stdname'``. For additional + information, refer to :meth:`Stats.sort_stats`. + .. function:: runctx(command, globals, locals, filename=None)