Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
ef2f3011
Commit
ef2f3011
authored
Jun 09, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add section on coverage analysis to profiling/tracing docs
parent
a2a19494
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
docs/src/tutorial/profiling_tutorial.rst
docs/src/tutorial/profiling_tutorial.rst
+29
-0
No files found.
docs/src/tutorial/profiling_tutorial.rst
View file @
ef2f3011
...
@@ -76,6 +76,35 @@ file header comment (if ``cythonize()`` is used for compilation)::
...
@@ -76,6 +76,35 @@ file header comment (if ``cythonize()`` is used for compilation)::
# distutils: define_macros=CYTHON_TRACE_NOGIL=1
# distutils: define_macros=CYTHON_TRACE_NOGIL=1
Enabling coverage analysis
--------------------------
Since Cython 0.23, line tracing (see above) also enables support for coverage
reporting with the `coverage.py <http://nedbatchelder.com/code/coverage/>`_ tool.
To make the coverage analysis understand Cython modules, you also need to enable
Cython's coverage plugin in your ``.coveragerc`` file as follows:
.. code-block:: ini
[run]
plugins = Cython.Coverage
With this plugin, your Cython source files should show up normally in the
coverage reports.
To include the coverage report in the Cython annotated HTML file, you need
to first run the coverage.py tool to generate an XML result file. Pass
this file into the ``cython`` command as follows:
.. code-block:: bash
$ cython --annotate-coverage coverage.xml package/mymodule.pyx
This will recompile the Cython module and generate one HTML output
file next to each Cython source file it processes, containing colour
markers for lines that were contained in the coverage report.
.. _profiling_tutorial:
.. _profiling_tutorial:
Profiling Tutorial
Profiling Tutorial
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment