I know that it is possible to get the frequency of function calls for a particular module using the pstats.print_stats('python_script.py:')
, however I would like to print a report of the frequencies of all invoked functions in a profiled program that do not involve a set of functions.
For instance, say that I have function1
, function2
, function3
, and function4
(assume that this list is much larger) and that I want to print the number of times each function was invoked as long as it isn't function3
. Is it possible to create a list of the functions to be ignored and pass that to the pstats
module as well as the file that I am profiling?
Particularly, I am interested in the number of calls for all functions that do not include the previously mentioned set. I could probably write a script to parse out the full listing of functions and ignore that set, but I feel that there may be an easier way in the pstats module.