I would like to see a log of all the emacs lisp function calls made during an emacs session.
I want to know exactly what the interpreter is doing. How can "intercept" the interpreter's REPL, if that makes any sense?
With strace I can attach to the emacs process and see all the system calls. But I need higher level information about which lisp functions are actually responsible.
As an aside, the motivation for this is to debug a problem in my emacs session where the emacs process keeps listening on a socket that is forever unavailable:
recvfrom(4, 0xbd4754, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
# netstat -p |grep 14854
unix 3 [ ] STREAM CONNECTED 14854 3040/emacs
I'm not aware of anything which traces all function calls. That would surely need to be implemented in C. Maybe there are some existing debug compilation options you could use?
The following might still prove useful for more targeted debugging. (Emacs will certainly grind to a halt if you attempt to make them trace All The Things, however.)
Both libraries have usage details in their commentary.
Trace:
M-x
find-library
RETtrace
RETEmacs Lisp Profiler (ELP):
M-x
find-library
RETelp
RET