-
Notifications
You must be signed in to change notification settings - Fork 15k
[NFC][SampleFDO] In text sample prof reader, report dreport more concrete parsing errors for different line types #154885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… errors for different line types
@llvm/pr-subscribers-pgo Author: Mingming Liu (mingmingl-llvm) ChangesThe format Full diff: https://github.com/llvm/llvm-project/pull/154885.diff 1 Files Affected:
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index d147222fe2ce6..c4cba62524ed6 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -357,6 +357,7 @@ std::error_code SampleProfileReaderText::readImpl() {
uint64_t NumSamples, NumHeadSamples;
StringRef FName;
if (!ParseHead(*LineIt, FName, NumSamples, NumHeadSamples)) {
+
reportError(LineIt.line_number(),
"Expected 'mangled_name:NUM:NUM', found " + *LineIt);
return sampleprof_error::malformed;
@@ -382,9 +383,16 @@ std::error_code SampleProfileReaderText::readImpl() {
if (!ParseLine(*LineIt, LineTy, Depth, NumSamples, LineOffset,
Discriminator, FName, TargetCountMap, FunctionHash,
Attributes, IsFlat)) {
- reportError(LineIt.line_number(),
- "Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " +
- *LineIt);
+ switch (LineTy) {
+ case LineType::Metadata:
+ reportError(LineIt.line_number(),
+ "Cannot parse metadata: " + *LineIt);
+ break;
+ default:
+ reportError(LineIt.line_number(),
+ "Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " +
+ *LineIt);
+ }
return sampleprof_error::malformed;
}
if (LineTy != LineType::Metadata && Depth == DepthMetadata) {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
thanks for reviews! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/33611 Here is the relevant piece of the build log for the reference
|
…ore concrete parsing errors for different line types" (#155121) Reverts #154885 to fix build bot failure (https://lab.llvm.org/buildbot/#/builders/144/builds/33611)
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/15047 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/21015 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/12074 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/23331 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/154/builds/20630 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/17439 Here is the relevant piece of the build log for the reference
|
…t dreport more concrete parsing errors for different line types" (#155121) Reverts llvm/llvm-project#154885 to fix build bot failure (https://lab.llvm.org/buildbot/#/builders/144/builds/33611)
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/160/builds/23531 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/180/builds/23675 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/164/builds/12821 Here is the relevant piece of the build log for the reference
|
…ort more concrete parsing errors for different line types" (#155124) Re-apply llvm/llvm-project#154885 with a fix to initialize `LineTy` before calling `ParseLine`.
The format
'NUM[.NUM]: NUM[ mangled_name:NUM]*'
applies for most line types except metadata ones.