# Python: 3D real-time debugging and function call structure

Here is two videos of a small script (python and xmlrpc calls to ubigraph visualization server) created to show a 3D graph of  the function call structure of a python application, the first shows only the structure created while running the application and the next video shows a debugging-like tool, it changes the node color to red when the function is called, and the labels shows: function name, python file name and the line on the python file where the code is.

To use the script, start the Ubigraph visualization server and add the profile module to your python application, it will looks like this:

import prof3d

def run_main():

if __name__ == "__main__":
prof3d.profile_me()
run_main()

## 8 thoughts to “Python: 3D real-time debugging and function call structure”

1. visik7 says:

is there some code to look ?

2. Hello, I’ll release the source code soon when I get time, I just need to clean up it.

3. visik7 says:

Tested with django 🙂 seems cool but a little bit too slow

4. visik7 says:

ok without all the time.sleep it’s a little bit faster 🙂

5. visik7 says:

not usable at all on django I left it running on the test server after 45 minutes it didn’t finished to startup while usually take a 2/3 seconds 🙁

6. Hello, the code is a PoC, it can be optimized for speed, I’ve put the “time.sleep” on the code because you can’t see the running node when the execution is in a fast function call. Try removing the trace for C calls, this trace show all the builtins calls, which are note desirable some times. Btw, you can profile only some parts of the code, I think that this 3D debugging idea is more important and interesting for debugging algorithms rather than django startup. When using this approach to debug an algorithm, you can see structure of loops and function call patterns which are very hard to see when tracing on simple textual console.

7. Leon says:

Hi Christian, do you have source code of UbiGraph? I wanna build it on Arch linux myself. Thanks.

1. No I don’t have it, actually Ubigraph is not open source, it’s free but it’s not open, that’s a shame.

This site uses Akismet to reduce spam. Learn how your comment data is processed.