[PATCH] D89086: [MemProf] Allow the binary to specify the profile output filename

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 17:52:01 PDT 2020


tejohnson created this revision.
tejohnson added reviewers: vitalybuka, davidxl.
Herald added subscribers: Sanitizers, wenlei.
Herald added a project: Sanitizers.
tejohnson requested review of this revision.

This will allow the output directory to be specified by a build time
option, similar to the directory specified for regular PGO profiles via
-fprofile-generate=. The memory profiling instrumentation pass will
set up the variable. This is the same mechanism used by the PGO
instrumentation and runtime.

Additionally, change the default of the log_path flag to nullptr, and
the code consuming that flag (ReportFile::SetReportPath) to treat
nullptr as stderr (so no change to the behavior of existing users).
This is so the flag can be used to override the new variable encoded in
the binary for runtime testing.

Finally, in preparation for a follow on change to clang which will
always specify an output filename via the new variable, change the
existing memprof tests to specify log_path=stderr when that was being
relied on.

Depends on D87120 <https://reviews.llvm.org/D87120>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89086

Files:
  compiler-rt/lib/memprof/memprof_interface_internal.h
  compiler-rt/lib/memprof/memprof_rtl.cpp
  compiler-rt/lib/memprof/weak_symbols.txt
  compiler-rt/lib/sanitizer_common/sanitizer_file.cpp
  compiler-rt/lib/sanitizer_common/sanitizer_flags.inc
  compiler-rt/test/memprof/TestCases/atexit_stats.cpp
  compiler-rt/test/memprof/TestCases/dump_process_map.cpp
  compiler-rt/test/memprof/TestCases/log_path_test.cpp
  compiler-rt/test/memprof/TestCases/malloc-size-too-big.cpp
  compiler-rt/test/memprof/TestCases/mem_info_cache_entries.cpp
  compiler-rt/test/memprof/TestCases/print_miss_rate.cpp
  compiler-rt/test/memprof/TestCases/stress_dtls.c
  compiler-rt/test/memprof/TestCases/test_malloc_load_store.c
  compiler-rt/test/memprof/TestCases/test_memintrin.cpp
  compiler-rt/test/memprof/TestCases/test_new_load_store.cpp
  compiler-rt/test/memprof/TestCases/test_terse.cpp
  compiler-rt/test/memprof/TestCases/unaligned_loads_and_stores.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89086.297091.patch
Type: text/x-patch
Size: 14559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201009/114013fb/attachment.bin>


More information about the llvm-commits mailing list