Function: profiler-calltree-compute-percentages
profiler-calltree-compute-percentages is a byte-compiled function
defined in profiler.el.gz.
Signature
(profiler-calltree-compute-percentages TREE)
Source Code
;; Defined in /usr/src/emacs/lisp/profiler.el.gz
(defun profiler-calltree-compute-percentages (tree)
(let ((total-count 0))
;; FIXME: the memory profiler's total wraps around all too easily!
(dolist (child (profiler-calltree-children tree))
(incf total-count (profiler-calltree-count child)))
(unless (zerop total-count)
(profiler-calltree-walk
tree (lambda (node)
(setf (profiler-calltree-count-percent node)
(profiler-format-percent (profiler-calltree-count node)
total-count)))))))