rr 4.6 imminent

Dima Kogan dima at secretsauce.net
Tue Sep 5 02:41:50 UTC 2017


Robert O'Callahan <robert at ocallahan.org> writes:

> Let me know if there's anything I'm missing that should get fixed for
> 4.6.

This is relatively minor, but highly annoying. I keep meaning to fix it
myself (and then send you a patch), but haven't gotten to it yet. If you
fix it in 4.6, that'd be awesome.

I always replay logs inside emacs GUD. When invoking 'M-x gud-gdb' emacs
prompts me for the gdb command, and I instinctively enter

  rr replay ~/.local/share/rr/latest-trace/

The result is always this:

  Current directory is /tmp

  rr: Warning: Your CPU frequency governor is 'powersave'.  rr strongly
      recommends that you use the 'performance' governor.  Not using the
      'performance' governor can cause rr to be at least 2x slower
      on laptops.

      On Fedora-based systems, you can enable the 'performance' governor
      by running the following commands:

      $ sudo dnf install kernel-tools
      $ sudo cpupower frequency-set -g performance


  rr: error: Version file for recorded trace `~/.local/share/rr/latest-trace//version' not found.  Did you record
             `~/.local/share/rr/latest-trace//version' with an older version of rr?  If so, you'll need to replay
             `~/.local/share/rr/latest-trace//version' with that older version.  Otherwise, your trace is
             likely corrupted.


The cause is that for some reason ~ is not being expanded to $HOME, and
thus that path doesn't point to anything. Expanding the ~ manually makes
it work.

So feature requests:

1. Instead of 18 unhelpful lines of text, there should be 1 line:

   Directory not found: ~/.local/share/rr/latest-trace/

   I don't know if there are any emacs users that tried rr once, saw
   this mysterious failure, and then gave up. But there could be some.

2. Something should expand ~. I think the shell is supposed to do it
   normally, but here emacs is doing its thing. On the other hand, using
   gdb under gud works just fine, even with ~. So I don't exactly know
   what's going on, and some quick debugging didn't make it clear (hence
   no patch yet). But it's probably harmless for rr to
   s{^~/}{$ENV{HOME}/} on the path

3. On Debian-based distros the package to install is called
   linux-cpupower. There're multiple ways to see what's appropriate; on
   relatively recent boxes you can look at /etc/os-release. Debian-based
   boxes will have ID=debian or ID_LIKE=debian. RPM-based boxes will
   have ID_LIKE=rhel or fedora or "rhel fedora"

4. I've never bothered to touch the cpu governor, and rr seems fast
   enough (it is beyond magical!) Does it make sense to print out that
   warning every time? If so, can it be made less verbose?

Again, this is minor stuff, and if you don't fix it, I'll send you
patches eventually.

Thanks very much for rr. I proselytize when I can :)


More information about the rr-dev mailing list