This is an archive of the discontinued LLVM Phabricator instance.

Add profile writing capabilities for sampling profiles.
ClosedPublic

Authored by dnovillo on Oct 27 2014, 8:11 AM.

Details

Summary

This patch finishes up support for handling sampling profiles in both
text and binary formats. The new binary format uses uleb128 encoding to
represent numeric values. This makes profiles files about 25% smaller.

The profile writer class can write profiles in the existing text and the
new binary format. In subsequent patches, I will add the capability to
read (and perhaps write) profiles in the gcov format used by GCC.

Additionally, I will be adding support in llvm-profdata to manipulate
sampling profiles.

There was a bit of refactoring needed to separate some code that was in
the reader files, but is actually common to both the reader and writer.

The new test checks that reading the same profile encoded as text or
raw, produces the same results.

Diff Detail

Repository
rL LLVM

Event Timeline

dnovillo updated this revision to Diff 15492.Oct 27 2014, 8:11 AM
dnovillo retitled this revision from to Add profile writing capabilities for sampling profiles..
dnovillo updated this object.
dnovillo edited the test plan for this revision. (Show Details)
dnovillo added reviewers: bogner, dexonsmith.
dnovillo added a subscriber: Unknown Object (MLST).
dnovillo updated this revision to Diff 15511.Oct 27 2014, 5:49 PM

Address review feedback.

1- Use ErrorOr in readNumber/readString.
2- Remove local debugging code.
3- Other minor fixes.

dnovillo updated this revision to Diff 15558.Oct 29 2014, 5:54 PM
  • Use an LLVM context instead of a module for emitting diagnostics.
  • Remove unnecessary enum SampleProfileFormat.
dnovillo updated this revision to Diff 15571.Oct 30 2014, 8:44 AM
  • Fix comment.
dnovillo closed this revision.Oct 30 2014, 11:10 AM
dnovillo updated this revision to Diff 15574.

Closed by commit rL220915 (authored by @dnovillo).