This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Improve error reporting
ClosedPublic

Authored by mstojanovic on Feb 5 2020, 1:08 PM.

Details

Summary

Fix inconsistencies in error reporting created by mixing report_fatal_error() and ExitOnErr(), and add additional information to the error message to make it more user friendly. Minimize the use report_fatal_error() because it's meant for use in very rare cases and it results in low information density of the error messages.

Summary of the new design:

  • For command line argument errors output llvm-exegesis: <error_message>, which is consistent with the error output format emitted by the backend which checks correctness of the command line arguments.
  • For other errors the format llvm-exegesis error: <error_message> is used.
    • If the error occured during file access <error_message> will have of two parts: '<file_name>': <rest_of_the_error_message>

Diff Detail

Event Timeline

mstojanovic created this revision.Feb 5 2020, 1:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2020, 1:08 PM
Herald added a subscriber: tschuett. · View Herald Transcript
courbet accepted this revision.Feb 6 2020, 2:26 AM

Thanks for doing this.

This revision is now accepted and ready to land.Feb 6 2020, 2:26 AM
This revision was automatically updated to reflect the committed changes.
hans added a subscriber: hans.Feb 6 2020, 3:49 AM

A bunch of tests are now failing with "llvm-exegesis error: benchmarking unavailable, LLVM was built without libpfm."

See for example: http://45.33.8.238/linux/9540/step_12.txt

hans added a comment.Feb 6 2020, 3:56 AM

A bunch of tests are now failing with "llvm-exegesis error: benchmarking unavailable, LLVM was built without libpfm."

See for example: http://45.33.8.238/linux/9540/step_12.txt

I guess e.g. llvm/test/tools/llvm-exegesis/X86/lit.local.cfg needs to be updated to handle the new error handling.

I've reverted these changes in abe01e17f648a97666d4fbed41f0861686a17972 in the meantime.