class LlvmProfdata
Defined at line 12 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
Public Members
static const size_t kAlign
static basic_string_view kDataSinkName
static basic_string_view kFileSuffix
static basic_string_view kAnnounce
Public Methods
size_t LiveDataCountersAlignment ()
This is the minimum alignment required for LiveData::counters::data().
Defined at line 19 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
void LlvmProfdata ()
The object can be default-constructed and copied into, but cannot be used
in its default-constructed state.
Defined at line 25 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
void LlvmProfdata (const LlvmProfdata & )
Defined at line 26 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
void Init (std::span<const std::byte> build_id)
If not compiled with instrumentation at all, then all the link-time
references in the real implementation below won't work. So provide stubs.
Defined at line 26 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
void Init (std::span<const std::byte> build_id)
If not compiled with instrumentation at all, then all the link-time
references in the real implementation below won't work. So provide stubs.
Defined at line 26 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
void Init (std::span<const std::byte> build_id)
If not compiled with instrumentation at all, then all the link-time
references in the real implementation below won't work. So provide stubs.
Defined at line 26 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
void Init (std::span<const std::byte> build_id)
If not compiled with instrumentation at all, then all the link-time
references in the real implementation below won't work. So provide stubs.
Defined at line 26 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
void Init (std::span<const std::byte> build_id)
If not compiled with instrumentation at all, then all the link-time
references in the real implementation below won't work. So provide stubs.
Defined at line 26 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
bool UsingSingleByteCounters ()
This returns true if single byte counters are used.
It is only public to be used by tests.
Defined at line 425 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
std::span<const std::byte> BuildIdFromRawProfile (std::span<const std::byte> data)
If the data appears to be valid llvm-profdata format with a build ID, then
return the subspan that is just the build ID bytes themselves. Otherwise
return an empty span. This does only minimal format validation that is
sufficient to find the build ID safely, and does not guarantee that the
other sizes in the header are valid.
std::span<const std::byte> BuildIdFromRawProfile (std::span<const std::byte> data)
If the data appears to be valid llvm-profdata format with a build ID, then
return the subspan that is just the build ID bytes themselves. Otherwise
return an empty span. This does only minimal format validation that is
sufficient to find the build ID safely, and does not guarantee that the
other sizes in the header are valid.
std::span<const std::byte> BuildIdFromRawProfile (std::span<const std::byte> data)
If the data appears to be valid llvm-profdata format with a build ID, then
return the subspan that is just the build ID bytes themselves. Otherwise
return an empty span. This does only minimal format validation that is
sufficient to find the build ID safely, and does not guarantee that the
other sizes in the header are valid.
Defined at line 565 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
std::span<const std::byte> BuildIdFromRawProfile (std::span<const std::byte> data)
If the data appears to be valid llvm-profdata format with a build ID, then
return the subspan that is just the build ID bytes themselves. Otherwise
return an empty span. This does only minimal format validation that is
sufficient to find the build ID safely, and does not guarantee that the
other sizes in the header are valid.
std::span<const std::byte> BuildIdFromRawProfile (std::span<const std::byte> data)
If the data appears to be valid llvm-profdata format with a build ID, then
return the subspan that is just the build ID bytes themselves. Otherwise
return an empty span. This does only minimal format validation that is
sufficient to find the build ID safely, and does not guarantee that the
other sizes in the header are valid.
bool Match (std::span<const std::byte> data)
Return true if data appears to be a valid llvm-profdata dump whose build
ID matches the one passed to Init.
bool Match (std::span<const std::byte> data)
Return true if data appears to be a valid llvm-profdata dump whose build
ID matches the one passed to Init.
LlvmProfdata & operator= (const LlvmProfdata & )
Defined at line 27 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
bool Match (std::span<const std::byte> data)
Return true if data appears to be a valid llvm-profdata dump whose build
ID matches the one passed to Init.
Defined at line 595 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
bool Match (std::span<const std::byte> data)
Return true if data appears to be a valid llvm-profdata dump whose build
ID matches the one passed to Init.
bool Match (std::span<const std::byte> data)
Return true if data appears to be a valid llvm-profdata dump whose build
ID matches the one passed to Init.
void CopyLiveData (LiveData data)
Copy out the current live data values from their link-time locations where
they have accumulated since startup. The data.counters buffer must be at
least counters_size_bytes() and must be aligned as uint64, and the
data.bitmap must be at least bitmap_size_bytes(), usually the return value
of WriteFixedData or VerifyMatch.
Defined at line 32 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
void MergeLiveData (LiveData data)
This is like CopyLiveData, but instead of overwriting the buffer, it
merges the data with the existing live data values in the buffer.
Defined at line 34 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
size_t size_bytes ()
This returns the size of the data blob to be published.
The return value is zero if there is no data to publish.
Defined at line 35 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
void UseLiveData (LiveData data)
After CopyLiveData or MergeLiveData has prepared the buffers, start using
them for live data updates. This can be called again later to switch to
different buffers.
Defined at line 36 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
size_t counters_offset ()
These return the offset and size within the blob of the aligned uint64_t[]
counters array.
Defined at line 39 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
size_t counters_size_bytes ()
Defined at line 40 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
size_t bitmap_offset ()
These return the offset and size within the blob of the char[] bitmap
bytes array.
Defined at line 48 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
size_t bitmap_size_bytes ()
Defined at line 49 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData WriteFixedData (std::span<std::byte> data)
This must be passed a span of at least size_bytes() whose pointer must be
aligned to kAlign bytes. Write the fixed metadata into the buffer, but
leave the live data areas in the buffer untouched. Returns the subspans
covering the live data.
Defined at line 66 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData WriteFixedData (std::span<std::byte> data)
This must be passed a span of at least size_bytes() whose pointer must be
aligned to kAlign bytes. Write the fixed metadata into the buffer, but
leave the live data areas in the buffer untouched. Returns the subspans
covering the live data.
Defined at line 66 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData WriteFixedData (std::span<std::byte> data)
This must be passed a span of at least size_bytes() whose pointer must be
aligned to kAlign bytes. Write the fixed metadata into the buffer, but
leave the live data areas in the buffer untouched. Returns the subspans
covering the live data.
Defined at line 66 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData WriteFixedData (std::span<std::byte> data)
This must be passed a span of at least size_bytes() whose pointer must be
aligned to kAlign bytes. Write the fixed metadata into the buffer, but
leave the live data areas in the buffer untouched. Returns the subspans
covering the live data.
Defined at line 66 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData WriteFixedData (std::span<std::byte> data)
This must be passed a span of at least size_bytes() whose pointer must be
aligned to kAlign bytes. Write the fixed metadata into the buffer, but
leave the live data areas in the buffer untouched. Returns the subspans
covering the live data.
Defined at line 66 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData VerifyMatch (std::span<std::byte> data)
Verify the contents after Match(data) is true, causing assertion failures
if the data was corrupted. After this, the data is verified to match what
WriteFixedData would have written. Returns the subspans covering the
live data, just as WriteFixedData would have done.
Defined at line 72 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData VerifyMatch (std::span<std::byte> data)
Verify the contents after Match(data) is true, causing assertion failures
if the data was corrupted. After this, the data is verified to match what
WriteFixedData would have written. Returns the subspans covering the
live data, just as WriteFixedData would have done.
Defined at line 72 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData VerifyMatch (std::span<std::byte> data)
Verify the contents after Match(data) is true, causing assertion failures
if the data was corrupted. After this, the data is verified to match what
WriteFixedData would have written. Returns the subspans covering the
live data, just as WriteFixedData would have done.
Defined at line 72 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData VerifyMatch (std::span<std::byte> data)
Verify the contents after Match(data) is true, causing assertion failures
if the data was corrupted. After this, the data is verified to match what
WriteFixedData would have written. Returns the subspans covering the
live data, just as WriteFixedData would have done.
Defined at line 72 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
LiveData VerifyMatch (std::span<std::byte> data)
Verify the contents after Match(data) is true, causing assertion failures
if the data was corrupted. After this, the data is verified to match what
WriteFixedData would have written. Returns the subspans covering the
live data, just as WriteFixedData would have done.
Defined at line 72 of file ../../src/lib/llvm-profdata/include/lib/llvm-profdata/llvm-profdata.h
void MergeLiveData (LiveData to, LiveData from)
This merges the from values into the to values.
Defined at line 543 of file ../../src/lib/llvm-profdata/llvm-profdata.cc
void UseLinkTimeLiveData ()
This resets the runtime after UseLiveData so that the original link-time
counter locations will be updated hereafter. It's only used in tests.
Defined at line 559 of file ../../src/lib/llvm-profdata/llvm-profdata.cc