From: Rodrigo Morales <moralesrodrigo1100@gmail.com>
To: uzibalqa <uzibalqa@proton.me>
Cc: uzibalqa via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Re: Graph of elisp function calls
Date: Mon, 28 Aug 2023 21:34:30 +0000 [thread overview]
Message-ID: <CAGxMbPaCwCTez-ByLyJzE8d04WS_hRYgQ3R-NZDrfjHeKeThQQ@mail.gmail.com> (raw)
In-Reply-To: <xOSdakgFJK86Vs9yZGps11zPWVz-yiW31Hqa7w_CS_Jf93MvMMUDEk_mZFsdm3P58j85ro5NRlW6s6qo9XuTtxDPGIBPmvoN42OlD3KwWLM=@proton.me>
I'm not aware of a built-in function to do this, but if I had to write
code to do that. This is how I would do it:
1. Write a function Elisp that gets a tree representation of function
calls (just as `M-x profiler-report` does)
2. Output the three representation as a set of edges (just as the
command `guix graph` does)
```
$ guix graph -t references
/gnu/store/h1yiaimhmg0zf5p3czv
5xgj7ksqp527z-tesseract-ocr-5.3.0
```
```
digraph "Guix references" {
"/gnu/store/h1yiaimhmg0zf5p3czv5xgj7ksqp527z-tesseract-ocr-5.3.0"
[label = "tesseract-ocr-5.3.0", shape = box, fontname = sans];
"/gnu/store/h1yiaimhmg0zf5p3czv5xgj7ksqp527z-tesseract-ocr-5.3.0" ->
"/gnu/store/0hvkv5kvrk7ix29pfnbkyppbdxa7ki7n-libx11-1.8.1" [color =
magenta];
(...some omitted lines...)
"/gnu/store/h1yiaimhmg0zf5p3czv5xgj7ksqp527z-tesseract-ocr-5.3.0" ->
"/gnu/store/z8kgahaarjpl0b1nzpqmzyrm4bbmnxw3-libxext-1.3.4" [color =
magenta];
"/gnu/store/h1yiaimhmg0zf5p3czv5xgj7ksqp527z-tesseract-ocr-5.3.0" ->
"/gnu/store/zkxvwia0z25409k1kmm0jqzfk9prc8fx-libpng-1.6.37" [color =
magenta];
"/gnu/store/0hvkv5kvrk7ix29pfnbkyppbdxa7ki7n-libx11-1.8.1" [label =
"libx11-1.8.1", shape = box, fontname = sans];
"/gnu/store/0hvkv5kvrk7ix29pfnbkyppbdxa7ki7n-libx11-1.8.1" ->
"/gnu/store/0hvkv5kvrk7ix29pfnbkyppbdxa7ki7n-libx11-1.8.1" [color =
magenta];
(...some omitted lines...)
"/gnu/store/0hvkv5kvrk7ix29pfnbkyppbdxa7ki7n-libx11-1.8.1" ->
"/gnu/store/yilf64y14qciml3kkj3506i3n2gmaawb-libxau-1.0.10" [color =
magenta];
"/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib" [label
= "gcc-11.3.0-lib", shape = box, fontname = sans];
(...some omitted lines...)
}
```
3. Display the graph information in any way I might find convenient.
One way would be to use xdot.
```
$ guix graph -t references
/gnu/store/h1yiaimhmg0zf5p3czv5xgj7ksqp527z-tesseract-ocr-5.3.0 | xdot
-f fdp -
```
There's nothing impossible in Emacs as long as you have enough
knowledge and time.
On Mon, 28 Aug 2023 at 19:15, uzibalqa <uzibalqa@proton.me> wrote:
>
>
> Is it possible to produce a graph of elisp function calls ?
>
>
>
next prev parent reply other threads:[~2023-08-28 21:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 19:14 Graph of elisp function calls uzibalqa
2023-08-28 21:34 ` Rodrigo Morales [this message]
2023-08-28 23:25 ` Michael Heerdegen
2023-08-29 1:13 ` Heime
2023-08-29 1:50 ` Michael Heerdegen
2023-08-29 2:05 ` Heime
2023-08-29 2:10 ` Michael Heerdegen
2023-08-29 8:13 ` Heime
2023-08-30 0:45 ` Michael Heerdegen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGxMbPaCwCTez-ByLyJzE8d04WS_hRYgQ3R-NZDrfjHeKeThQQ@mail.gmail.com \
--to=moralesrodrigo1100@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=uzibalqa@proton.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).