From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rodrigo Morales Newsgroups: gmane.emacs.help Subject: Re: Graph of elisp function calls Date: Mon, 28 Aug 2023 21:34:30 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33764"; mail-complaints-to="usenet@ciao.gmane.io" Cc: uzibalqa via Users list for the GNU Emacs text editor To: uzibalqa Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 28 23:35:26 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qajtO-0008b0-PG for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 28 Aug 2023 23:35:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qajsp-0007eG-Vn; Mon, 28 Aug 2023 17:34:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qajso-0007e8-FL for help-gnu-emacs@gnu.org; Mon, 28 Aug 2023 17:34:50 -0400 Original-Received: from mail-vk1-xa36.google.com ([2607:f8b0:4864:20::a36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qajsm-0005kM-76 for help-gnu-emacs@gnu.org; Mon, 28 Aug 2023 17:34:50 -0400 Original-Received: by mail-vk1-xa36.google.com with SMTP id 71dfb90a1353d-48f856b04b6so1037761e0c.2 for ; Mon, 28 Aug 2023 14:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693258486; x=1693863286; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YjA5mB6xgosLQG6JRDwgaZQC/ljitJf9Ss3i5ENH6EU=; b=KBjxxMHalf9fd73GG6sAbZWTAXnS/Du61LATj8cE28kCyvpQ/+X5K2jhboZ9QRjpzS pmKqUD800WK5Mb0TvXR933OcKVisYgcYHyhK0TmEuzxTa2zrDPmgDNZrBUwaom+6Onu1 AY3jMTFbk1bslfuACHz+qG/16cm21F1qOmqNl+SK3ArZ+teAvej/Qi7/aEGsoFoNSOJX 3NjuzAR0CdVmjruaeBsYwTS5D3dgUnaisVJNyRXa/zM73QydM8Jgx2oZiN+HFZxwDJSD RZMYA+aJ4UWzEUVjGE2EZYvbJ2lwdxKOyeC9Opp1T2f4A9E7F7daXE82gy8oZ0vPEIfg 7WrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693258486; x=1693863286; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YjA5mB6xgosLQG6JRDwgaZQC/ljitJf9Ss3i5ENH6EU=; b=YWvEauS4KjxtAblUttuDGiyk297PeBvvYsPDSFtuVWQv4IcvKj0uipuufXYc+hOx2K lk13zpdDFK9ME0iVBu7zQrEvkAN3TdzaLChwUa9sKvlP0Z5JQPIsfGTPT00i5i1je2TW FTVl4foj1PgPMbG5p1uboEUtBnE4k1/qCy/ixqTuIRwpitILwgh92QRnrcrHG9wI2EYf P+5YIHKg2hiwHJznoBpsre5UCV+6Ejn3fuagNvwz/nhJDyBdoXM2xLdWQhEKXmlElaI+ 4JtZTwpJlYY5+uEBb8IoLyWFM1Hwhkh+niqsE7ARUBkfOP+bgQzX5mMxTZc0JeSEyBlt IMdQ== X-Gm-Message-State: AOJu0Yw8iUlBoEd1OOYZthWG9SEPzdJaNlJ8Kvbh1yzyzHnA4NfTCG5y dWypDQEjvhDZes4X52Gt36qD0KcvoMF/9NeRMZPHJZ2qKOk= X-Google-Smtp-Source: AGHT+IG9Pd1Rlg+bY6Rb3f0nGrMDcNir1eJyxwVXoWPOS/qzSmFN3V58WtSCQoousaj06ttclEZDo8LzLi4Hm8OaJnI= X-Received: by 2002:a1f:dec4:0:b0:48f:b45c:ea3d with SMTP id v187-20020a1fdec4000000b0048fb45cea3dmr10067537vkg.7.1693258486480; Mon, 28 Aug 2023 14:34:46 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::a36; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-vk1-xa36.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145000 Archived-At: 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 wrote: > > > Is it possible to produce a graph of elisp function calls ? > > >