gaogaotiantian / viztracer

A debugging and profiling tool that can trace and visualize python code execution
https://viztracer.readthedocs.io/
Apache License 2.0
5.33k stars 392 forks source link

Are Cython (.pyx) files not traced ? #472

Closed print-sid8 closed 2 months ago

print-sid8 commented 2 months ago

Hi just wanted to understand if Viztracer can trace and see which parts of .pyx file is used.

_rasterize is a function within _features.pyx , and it is used very frequently in features.py file here - https://github.com/rasterio/rasterio/tree/main/rasterio , but it's not captured in the trace and the visualization.

I would be good to know if viztracer can track these modules and functions somehow, thanks!

gaogaotiantian commented 2 months ago

If the function call can't be picked up by sys.setprofile, it can't be traced. I'm not a Cython user but I'm not surprised if Cython does not support sys.setprofile for its functions - it's not Python.

print-sid8 commented 2 months ago

Great thanks for the info!

auderson commented 1 month ago

@gaogaotiantian Wondering if we can detect C functions in py3.13 using the new monitoring feature?

gaogaotiantian commented 1 month ago

sys.monitoring does not give extra information about function calls.