unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: guile-devel@gnu.org
Subject: a hack to do -- jitmaps
Date: Wed, 26 Feb 2020 22:17:04 +0100	[thread overview]
Message-ID: <871rqhnj5b.fsf@pobox.com> (raw)

Hey :)

I thought of a thing that I don't have time to implement right now:
perf jitmap support in Guile.

Basically, the "perf" Linux tool is a widely-available instruction-level
and microarchitectural profiler.  It's great: you run "perf record guile
foo.scm", and then you run "perf report", and you get instruction-level
info on the profile.  You can grab call graphs, see performance
counters, all kinds of things.  Good stuff.

With run-time code generation though, perf needs some help from the
program generating code.  The most basic step is what's known as "perf
maps", placed in /tmp/perf-$PID.map.  These are super-basic and just
identify code ranges with functions.  I just pushed a patch doing this.

The more useful thing is what's known as "jitmaps".  See
https://lwn.net/Articles/633846/, and
https://chromium.googlesource.com/v8/v8/+/refs/heads/master/src/diagnostics/perf-jit.cc.
It's totally underdocumented, but it actually saves the JIT code to a
file, which is needed to have instruction-level profiling.  It also adds
support for unwinding frames and source info.

Anyway if anyone wants to take this task in the next few weeks, LMK :)

Andy



                 reply	other threads:[~2020-02-26 21:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rqhnj5b.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    /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).