[all-commits] [llvm/llvm-project] ea1826: [MemProf] Defer profile file setup until dump time

Teresa Johnson via All-commits all-commits at lists.llvm.org
Fri Nov 18 15:09:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ea1826ee57984d4f44fdb4b35a47169d393618ed
      https://github.com/llvm/llvm-project/commit/ea1826ee57984d4f44fdb4b35a47169d393618ed
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M compiler-rt/lib/memprof/memprof_allocator.cpp
    M compiler-rt/lib/memprof/memprof_rtl.cpp
    M compiler-rt/test/memprof/TestCases/atexit_stats.cpp
    M compiler-rt/test/memprof/TestCases/malloc-size-too-big.cpp

  Log Message:
  -----------
  [MemProf] Defer profile file setup until dump time

With all of the writing of the memprof profile consolidated into one
place, there is no need to set up the profile file (which creates the
file and also redirects all printing from the runtime to it) until we
are ready to dump the profile.

This allows errors and other messages to be dumped to stderr instead of
the profile file, which by default is in a binary format. Additionally,
reset the output file to stderr after dumping the profile so that any
requested memprof allocator statistics are printed to stderr.

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




More information about the All-commits mailing list