[InstrProf][Temporal] Add weight field to traces
authorEllis Hoag <ellis.sparky.hoag@gmail.com>
Wed, 12 Apr 2023 17:21:38 +0000 (10:21 -0700)
committerEllis Hoag <ellis.sparky.hoag@gmail.com>
Thu, 13 Apr 2023 17:37:05 +0000 (10:37 -0700)
commit4bddef4117403a305727d145a9abf6bda700f8ff
treefecf699626134bbc6558209bb1a4b1b0134349d4
parentaca110f9dd17f2ec6492e56472a49bd409c185ae
[InstrProf][Temporal] Add weight field to traces

As discussed in [0], add a `weight` field to temporal profiling traces found in profiles. This allows users to use the `--weighted-input=` flag in the `llvm-profdata merge` command to weight traces from different scenarios differently.

Note that this is a breaking change, but since [1] landed very recently and there is no way to "use" this trace data, there should be no users of this feature. We believe it is acceptable to land this change without bumping the profile format version.

[0] https://reviews.llvm.org/D147812#4259507
[1] https://reviews.llvm.org/D147287

Reviewed By: snehasish

Differential Revision: https://reviews.llvm.org/D148150
12 files changed:
compiler-rt/test/profile/instrprof-timestamp.c
llvm/docs/CommandGuide/llvm-profdata.rst
llvm/include/llvm/ProfileData/InstrProf.h
llvm/include/llvm/ProfileData/InstrProfReader.h
llvm/include/llvm/ProfileData/InstrProfWriter.h
llvm/lib/ProfileData/InstrProfReader.cpp
llvm/lib/ProfileData/InstrProfWriter.cpp
llvm/test/tools/llvm-profdata/merge-traces.proftext
llvm/test/tools/llvm-profdata/read-traces.proftext
llvm/test/tools/llvm-profdata/trace-limit.proftext
llvm/tools/llvm-profdata/llvm-profdata.cpp
llvm/unittests/ProfileData/InstrProfTest.cpp