From ef9efac025ff5f31d5e2c2b7fa5331fd52bf80eb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 12 May 2011 09:44:55 -0400 Subject: Mention Stats.print_callees() in doc/hacking.txt. --- doc/hacking.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/hacking.txt b/doc/hacking.txt index 4c5a464..941dfde 100644 --- a/doc/hacking.txt +++ b/doc/hacking.txt @@ -82,3 +82,7 @@ You can also toss:: print >> sys.stderr, '-'*60, '\n', '\n'.join(traceback.format_stack()[-10:]) into the function itself for a depth-first caller list. + +For a more top-down approach, try:: + + $ python -c "import pstats; p=pstats.Stats('profile'); p.sort_stats('cumulative').print_callees(20)" -- cgit