Go Luhng wrote at 2020-3-13 18:51 -0400: >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()`?
Again (like for profiling with parameters), you have the problem of mass data: in typical situations, you have a huge number of different call paths. I have not yet used "cProfile" but "profile" and its extension "dm.profile". "profile" collects statistics based on function and caller/callee. This means, that you can derived limited information about the call paths: the immediate caller/callees, but not the complete call paths. Again, you would (almost surely) need to write your own profiler to gather information broken down on the complete call paths. Such a profiler could only be used in restricted situations (where the amount of call paths is quite limited). -- https://mail.python.org/mailman/listinfo/python-list