Add hierarchical discriminator multiplicity support#257
Open
kugan-nv wants to merge 1 commit intogoogle:masterfrom
Open
Add hierarchical discriminator multiplicity support#257kugan-nv wants to merge 1 commit intogoogle:masterfrom
kugan-nv wants to merge 1 commit intogoogle:masterfrom
Conversation
erozenfeld
approved these changes
Nov 25, 2025
Contributor
erozenfeld
left a comment
There was a problem hiding this comment.
LGTM with one question
source_info.h
Outdated
| } | ||
|
|
||
| // Return the full 64-bit offset for 32-bit hierarchical discriminators. | ||
| static constexpr uint64_t GenerateFullOffset(uint64_t Offset) { |
Contributor
There was a problem hiding this comment.
This is not called from anywhere , is it?
Contributor
Author
|
Thanks for the review @erozenfeld. I have also added support for aggregating samples with same with same [line + base discriminator] as a second pass as GCC doesn't aggregate. This is only done for create_gcov (for gcc) and supported with a flag. This is also enabled only for gcov version 3. GCC patches are now comitted. |
74a75eb to
03a7e16
Compare
Added support for mutiplicity and copy_id for gcc gcov. This should matches the GCC implementation. I am posting patches to GCC to match this. This patch also adds support for two-pass aggregation when using hierarchical discriminator encoding (gcov_version=3). The two-pass approach correctly handles duplicate samples from code duplication (loop unrolling, etc.). * GetBaseDiscriminator() - Extract bits 0-7 * GetMultiplicity() - Extract bits 8-14 (duplication factor) * GetCopyID() - Extract bits 15-25 (unused but reserved) With the patch we now: 1. Extract multiplicity and copy_id from discriminator 2. Multiply sample count by multiplicity 4. Add samples using copy_id. This was already supported for LLVM.
Contributor
Author
|
@erozenfeld: Ping ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for mutiplicity and copy_id for gcc gcov. This should matches the GCC
implementation. I am posting patches to GCC to match this.
This patch also adds support for two-pass aggregation when using hierarchical
discriminator encoding (gcov_version=3). The two-pass approach correctly
handles duplicate samples from code duplication (loop unrolling, etc.).
With the patch we now: