Re: Mapping (profile:report-time) over a list of profiled functions?

Madhu <[email protected]>
Newsgroups gmane.lisp.cmucl.general
Message-ID <[email protected]>
Helu
* "Denis Papathanasiou"  <[email protected]> :

| I'm profiling an application, and since I don't know where to look, I
| start by calling (profile:profile-all).
|
| After the app has run a bit, I run (profile:report-time) on one of the
| functions, and it works, i.e. I get a report as expected.
|
| But when I try to map (profile:report-time) across all the functions
| being profiled (as defined in profile:*timed-functions*), I get this,
| and I'm not sure why:
|
| * (mapcar #'(lambda (fn-name) (profile:report-time fn-name))
| profile:*timed-functions*)
|
| ; Note: Variable FN-NAME defined but never used.
|
|
| Error in FWRAPPERS:FIND-FWRAPPER:  the function FN-NAME is undefined.
|    [Condition of type UNDEFINED-FUNCTION]
|
| profile:*timed-functions* does contain a list of functions, and if I
| try any of those one at a time in (profile:report-time), it works.
|
| So why is the mapping problematic?

PROFILE:PROFILE-TIME is a Macro.

* (macroexpand-1 '(profile:report-time fn-name))

=> (PROFILE::%REPORT-TIMES '(FN-NAME))

i.e.  it ends up looking for #'FN-NAME and so it is not to be used
programatically.  In this respect it is similar to the TRACE/UNTRACE

--
Madhu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.