diff options
author | wlei <wlei@fb.com> | 2021-02-03 14:13:06 -0800 |
---|---|---|
committer | wlei <wlei@fb.com> | 2021-02-12 01:14:53 -0800 |
commit | c3aeabaea16ebe7653004a9af4ac337a34ec9275 (patch) | |
tree | 3426a97ffa8af812e58abbd1d04bc7c8da728468 /llvm/lib/ProfileData/SampleProfWriter.cpp | |
parent | 16213e1f509a2e8b7ab25731192279254a2b5377 (diff) | |
download | llvm-c3aeabaea16ebe7653004a9af4ac337a34ec9275.zip llvm-c3aeabaea16ebe7653004a9af4ac337a34ec9275.tar.gz llvm-c3aeabaea16ebe7653004a9af4ac337a34ec9275.tar.bz2 |
[CSSPGO][llvm-profgen] Add brackets for context id to support extended binary format
To align with https://reviews.llvm.org/D95547, we need to add brackets for context id before initializing the `SampleContext`.
Also added test cases for extended binary format from llvm-profgen side.
Differential Revision: https://reviews.llvm.org/D95929
Diffstat (limited to 'llvm/lib/ProfileData/SampleProfWriter.cpp')
-rw-r--r-- | llvm/lib/ProfileData/SampleProfWriter.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp index b388b78..8017f2a 100644 --- a/llvm/lib/ProfileData/SampleProfWriter.cpp +++ b/llvm/lib/ProfileData/SampleProfWriter.cpp @@ -360,10 +360,7 @@ std::error_code SampleProfileWriterCompactBinary::write( /// it needs to be parsed by the SampleProfileReaderText class. std::error_code SampleProfileWriterText::writeSample(const FunctionSamples &S) { auto &OS = *OutputStream; - if (FunctionSamples::ProfileIsCS) - OS << "[" << S.getNameWithContext() << "]:" << S.getTotalSamples(); - else - OS << S.getName() << ":" << S.getTotalSamples(); + OS << S.getNameWithContext(true) << ":" << S.getTotalSamples(); if (Indent == 0) OS << ":" << S.getHeadSamples(); OS << "\n"; |