Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View/intercept all emacs lisp function calls

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         
like image 556
ealfonso Avatar asked Dec 01 '13 06:12

ealfonso


2 Answers

You can try M-x profile-start RET RET ... M-x profile-report RET. It won't give you a complete trace, but it will show you the call tree for any function that lasted enough time.

BTW, I have no idea what problem you're trying to track. Calling recvfrom and getting EAGAIN over and over again might be completely normal.

like image 186
Stefan Avatar answered Oct 01 '22 05:10

Stefan


The Elisp info manual comes with a node

18.2.12 Trace Buffer

As stuff mentioned relies on edebug, should be a way to work from trace-point to trace-point and eventually kill.

WRT to logging, that might be done already with trace-function from trace.el.

_

like image 24
Andreas Röhler Avatar answered Oct 01 '22 04:10

Andreas Röhler