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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
e62a1430
Commit
e62a1430
authored
Feb 22, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable profiling/tracing for module init code
parent
f6f110e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+16
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
e62a1430
...
...
@@ -2049,7 +2049,15 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"{"
)
tempdecl_code
=
code
.
insertion_point
()
profile
=
code
.
globalstate
.
directives
[
'profile'
]
linetrace
=
code
.
globalstate
.
directives
[
'linetrace'
]
if
profile
or
linetrace
:
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"Profile"
,
"Profile.c"
))
code
.
put_declare_refcount_context
()
if
profile
or
linetrace
:
tempdecl_code
.
put_trace_declarations
(
None
)
code
.
putln
(
"#if CYTHON_REFNANNY"
)
code
.
putln
(
"__Pyx_RefNanny = __Pyx_RefNannyImportAPI(
\
"
refnanny
\
"
);"
)
code
.
putln
(
"if (!__Pyx_RefNanny) {"
)
...
...
@@ -2149,8 +2157,16 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"/*--- Execution code ---*/"
)
code
.
mark_pos
(
None
)
if
profile
or
linetrace
:
code
.
put_trace_call
(
header3
,
self
.
pos
,
nogil
=
not
code
.
funcstate
.
gil_owned
)
code
.
funcstate
.
can_trace
=
True
self
.
body
.
generate_execution_code
(
code
)
if
profile
or
linetrace
:
code
.
funcstate
.
can_trace
=
False
code
.
put_trace_return
(
"Py_None"
,
nogil
=
not
code
.
funcstate
.
gil_owned
)
code
.
putln
()
code
.
putln
(
"/*--- Wrapped vars code ---*/"
)
self
.
generate_wrapped_entries_code
(
env
,
code
)
...
...
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