sumerc / yappi

Yet Another Python Profiler, but this time multithreading, asyncio and gevent aware.
MIT License
1.47k stars 73 forks source link

Ability to increase max depth #59

Open devxpy opened 4 years ago

devxpy commented 4 years ago

Hello, thanks for taking care of this beauty all these years!

Can we have a way to increase the depth of data yappi captures? I want to be able to see more functions in my call graph than the default.

I've noticed that the call graph stops at a function, that is implemented in python, so there are definitely missing callees after that which I would like to inspect.

I'm using kcachegrind, maybe its a limitation of that tool - I apologize if that is the case!

sumerc commented 4 years ago

Hello,

I will believe this limitation might be realted to the tool. I don't remember we have any limit for the callstack. You could always use following syntax to make sure your functions get profiled:

def foo():
     pass

yappi.start()
foo()
stats = yappi.get_func_stats(
    filter_callback=lambda x: yappi.func_matches(x, [foo])
).print_all()