gak / pycallgraph

pycallgraph is a Python module that creates call graphs for Python programs.
GNU General Public License v2.0
1.82k stars 336 forks source link

Importing adds a whole lot of nodes #160

Open asl97 opened 8 years ago

asl97 commented 8 years ago

Importing anything that hasn't been imported before (ie: not in sys.modules, eg: the html module*) seem to add a whole lot of nodes.

I had to manually whitelist names for it to produce what I expected.

Manually whitelisting is troublesome to say the least.

* on my system, it wasn't imported when I start a python shell


empty1.py

import empty2

def hello():
    pass

empty2.hello()

hello()

empty2.py

def hello():
    pass

pycallgraph graphviz -- /tmp/junk/empty1.py: pycallgraph bad

pycallgraph -i '__main__' -i 'hello' -i '<module>' -i 'empty2*' graphviz -- /tmp/junk/empty1.py pycallgraph

ice1x commented 5 years ago

Same for me

ice1x commented 5 years ago

-e/--exclude option doesn't work at all for me. I still see these unknown/unnamed nodes (CentOS 7)