aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-05-17 13:58:14 +0000
committerGerd Moellmann2001-05-17 13:58:14 +0000
commitcebf1b97f3619eceb9d5ef0919fcf88315c3eab3 (patch)
treea88effaeec0cb39c800257dcfcd330c685bd3570
parente6dd1a49497ff043d3e1fa69392e41815c73717e (diff)
downloademacs-cebf1b97f3619eceb9d5ef0919fcf88315c3eab3.tar.gz
emacs-cebf1b97f3619eceb9d5ef0919fcf88315c3eab3.zip
(elp-instrument-function): Handle advised
functions.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/elp.el19
2 files changed, 18 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b28f19da1c5..1fed7553fa9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12001-05-17 Gerd Moellmann <gerd@gnu.org>
2
3 * emacs-lisp/elp.el (elp-instrument-function): Handle advised
4 functions.
5
12001-05-17 Stefan Monnier <monnier@cs.yale.edu> 62001-05-17 Stefan Monnier <monnier@cs.yale.edu>
2 7
3 * jit-lock.el (jit-lock-after-change): Check the font-lock-multiline 8 * jit-lock.el (jit-lock-after-change): Check the font-lock-multiline
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index af189126a09..6ecb05b231f 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -1,6 +1,6 @@
1;;; elp.el --- Emacs Lisp Profiler 1;;; elp.el --- Emacs Lisp Profiler
2 2
3;; Copyright (C) 1994,1995,1997,1998 Free Software Foundation, Inc. 3;; Copyright (C) 1994,1995,1997,1998, 2001 Free Software Foundation, Inc.
4 4
5;; Author: 1994-1998 Barry A. Warsaw 5;; Author: 1994-1998 Barry A. Warsaw
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -266,15 +266,22 @@ FUNSYM must be a symbol of a defined function."
266 ;; put the info vector on the property list 266 ;; put the info vector on the property list
267 (put funsym elp-timer-info-property infovec) 267 (put funsym elp-timer-info-property infovec)
268 268
269 ;; set the symbol's new profiling function definition to run 269 ;; Set the symbol's new profiling function definition to run
270 ;; elp-wrapper 270 ;; elp-wrapper.
271 (fset funsym newguts) 271 (let ((advice-info (get funsym 'ad-advice-info)))
272 (if advice-info
273 (progn
274 ;; If function is advised, don't let Advice change
275 ;; its definition from under us during the `fset'.
276 (put funsym 'ad-advice-info nil)
277 (fset funsym newguts)
278 (put funsym 'ad-advice-info advice-info))
279 (fset funsym newguts)))
272 280
273 ;; add this function to the instrumentation list 281 ;; add this function to the instrumentation list
274 (or (memq funsym elp-all-instrumented-list) 282 (or (memq funsym elp-all-instrumented-list)
275 (setq elp-all-instrumented-list 283 (setq elp-all-instrumented-list
276 (cons funsym elp-all-instrumented-list))) 284 (cons funsym elp-all-instrumented-list)))))
277 ))
278 285
279(defun elp-restore-function (funsym) 286(defun elp-restore-function (funsym)
280 "Restore an instrumented function to its original definition. 287 "Restore an instrumented function to its original definition.