anchor.diff:    (:use :cl)
     (:export #:decode-profile-buffer
              #:save-profile
  -           #:with-profiling))
  +           #:with-profiling
  +           #:with-allocation-profiling))
   
   (in-package :mezzano.profiler)
  +
  +(defparameter *ignorable-function-names*
  +  '(sys.int::%apply
  +    apply
  +    (lambda :in system.closette::compute-1-effective-discriminator)
  +    (lambda :in system.closette::std-compute-effective-method-function)
  +    (lambda :in system.closette::compute-n-effective-discriminator)))
   
   (defstruct thread-sample
     thread
  
positive.code:           Can be a specific thread to sample.
  :BUFFER-SIZE - Size of the profiler's sample buffer.
  :PATH - Path to write th profiler report to, if NIL then the samples will be returned.
  :PRUNE - When :THREAD is T, try to prune away stack frames above the WITH-PROFILING call."
    `(call-with-profiling (lambda () ,@body) ,@options))
  
  (defun call-with-profiling (function &key buffer-size path (thread t) (verbosity :report) (prune (eql thread 't)))
    (let* ((profile-buffer nil)
           (results (unwind-protect
                         (progn
  
negative.code:                       (let ((fn (consume))
                              (offset (consume)))
                          (unless stop
                            (when (not (find (sys.int::function-name fn) ignore-functions
                                             :test #'equal))
                              (vector-push-extend (cons fn offset) call-stack))
                            (when (eql fn prune-function)
                              (setf stop t)))))
                       (t (return))))
  