[all-commits] [llvm/llvm-project] a79929: [BOLT][Instrumentation] Keep profile open in Watch...

treapster via All-commits all-commits at lists.llvm.org
Wed Aug 23 13:51:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a799298152e3ef08b4919cdaac7a614f7cca9bc6
      https://github.com/llvm/llvm-project/commit/a799298152e3ef08b4919cdaac7a614f7cca9bc6
  Author: Denis Revunov <revunov.denis at huawei-partners.com>
  Date:   2023-08-23 (Wed, 23 Aug 2023)

  Changed paths:
    M bolt/runtime/common.h
    M bolt/runtime/instr.cpp

  Log Message:
  -----------
  [BOLT][Instrumentation] Keep profile open in WatchProcess

When a binary is instrumented with --instrumentation-sleep-time and
instrumentation-wait-forks options and lauched, the profile is
periodically written until all the forks die. The problem is that we
cannot wait for the whole process tree, and we have no way to tell when
it's safe to read the profile. Hovewer, if we keep profile open
throughout the life of the process tree, we can use fuser to determine
when writing is finished.

Reviewed By: rafauler

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


  Commit: a86dd9ae60662cfe9f9fb709a33c71d6fec66dfb
      https://github.com/llvm/llvm-project/commit/a86dd9ae60662cfe9f9fb709a33c71d6fec66dfb
  Author: Denis Revunov <revunov.denis at huawei-partners.com>
  Date:   2023-08-23 (Wed, 23 Aug 2023)

  Changed paths:
    M bolt/lib/Rewrite/RewriteInstance.cpp
    M bolt/runtime/common.h
    M bolt/runtime/instr.cpp

  Log Message:
  -----------
  [BOLT][Instrumentation] Fix indirect call profile in PIE

Because indirect call tables use static addresses for call sites, but pc
values recorded by runtime may be subject to ASLR in PIE, we couldn't
find indirect call descriptions by their runtime address in PIE. It
resulted in [unknown] entries in profile for all indirect calls. We need
to substract base address of .text from runtime addresses to get the
corresponding static addresses. Here we create a getter for base address
of .text and substract it's return value from recorded PC values. It
converts them to static addresses, which then may be used to find the
corresponding indirect call descriptions.

Reviewed By: rafauler

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


  Commit: dfc759929644ed1ea3224ab30e1086f7acc60da6
      https://github.com/llvm/llvm-project/commit/dfc759929644ed1ea3224ab30e1086f7acc60da6
  Author: Denis Revunov <revunov.denis at huawei-partners.com>
  Date:   2023-08-23 (Wed, 23 Aug 2023)

  Changed paths:
    M bolt/test/lit.cfg.py
    A bolt/test/runtime/instrumentation-indirect-2.c
    A bolt/test/runtime/wait_file.sh

  Log Message:
  -----------
  [BOLT][Instrumentation] Add test for append-pid option

Reviewed By: rafauler

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


Compare: https://github.com/llvm/llvm-project/compare/66c623bfc6c1...dfc759929644


More information about the All-commits mailing list