'Handler for call events.
Adds (filename, modulename, funcname) to the self._calledfuncs dict.'

def globaltrace_countfuncs(self, frame, why, arg):

    if (why == 'call'):
        this_func = self.file_module_function_of(frame)
        self._calledfuncs[this_func] = 1
