https://docs.python.org/3/library/profile.html#pstats.Stats.print_callers
On Sat, 14 Mar 2020 at 00:54, Go Luhng <golu...@gmail.com> wrote: > Consider a simple call graph: `main()` calls `foo()`, which calls > `bar()`. Then `main()` calls `qux()` which also calls `bar()`, but > with different parameters. > > When you run the above through cProfile and view the result in > SnakeViz, you will see `main()` calling `foo()` and `qux()`, with each > of them calling `bar()`. However, if you hover or click on `bar()`, > you will see the global aggregate statistics for it. For example, the > number of times it has been called, and their total time cost. > > Is there a way to get a path-dependent profiler breakdown for `bar()`? > Specifically for this example, statistics for when it is called by > `foo()`, and separately statistics for when it is called by `qux()`. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list