[all-commits] [llvm/llvm-project] b20a4e: [Support] Speedup llvm-dwarfdump 3.9x

Jan Kratochvil via All-commits all-commits at lists.llvm.org
Wed Aug 26 01:30:24 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b20a4e293c3b617d0890657b3c46edcc7410c8fd
      https://github.com/llvm/llvm-project/commit/b20a4e293c3b617d0890657b3c46edcc7410c8fd
  Author: Jan Kratochvil <jan.kratochvil at redhat.com>
  Date:   2020-08-26 (Wed, 26 Aug 2020)

  Changed paths:
    M llvm/include/llvm/Support/raw_ostream.h
    M llvm/lib/Support/raw_ostream.cpp

  Log Message:
  -----------
  [Support] Speedup llvm-dwarfdump 3.9x

Currently `strace llvm-dwarfdump x.debug >/tmp/file`:

  ioctl(1, TCGETS, 0x7ffd64d7f340)        = -1 ENOTTY (Inappropriate ioctl for device)
  write(1, "           DW_AT_decl_line\t(89)\n"..., 4096) = 4096
  ioctl(1, TCGETS, 0x7ffd64d7f400)        = -1 ENOTTY (Inappropriate ioctl for device)
  ioctl(1, TCGETS, 0x7ffd64d7f410)        = -1 ENOTTY (Inappropriate ioctl for device)
  ioctl(1, TCGETS, 0x7ffd64d7f400)        = -1 ENOTTY (Inappropriate ioctl for device)

After this patch:

  write(1, "0000000000001102 \"strlen\")\n     "..., 4096) = 4096
  write(1, "site\n                  DW_AT_low"..., 4096) = 4096
  write(1, "d53)\n\n0x000e4d4d:       DW_TAG_G"..., 4096) = 4096

The same speedup can be achieved by `--color=0` but that is not much convenient.

This implementation has been suggested by Joerg Sonnenberger.

Differential Revision: https://reviews.llvm.org/D86406




More information about the All-commits mailing list