Conversation
jemoreira
reviewed
Sep 24, 2026
Comment on lines
+41
to
+45
| if (index < is_default_values_.size()) { | ||
| return is_default_values_[index]; | ||
| } else { | ||
| return is_default_values_[0]; | ||
| } |
Member
There was a problem hiding this comment.
This assumes that is_default_values_ has at least one value, but the default value in the constructor is empty. Calling this in a ~default-constructed object will cause out of bounds errors.
Collaborator
Author
There was a problem hiding this comment.
Fixed. Added an is_default_values_.empty() case.
Collaborator
Author
There was a problem hiding this comment.
And fixed the issue you noticed in #3242 with the usage.
cjreynol
force-pushed
the
qemu_binary_flag_metrics
branch
from
September 24, 2026 23:17
1a6d21b to
cf82ae2
Compare
cjreynol
force-pushed
the
qemu_binary_flag_metrics
branch
from
September 24, 2026 23:36
cf82ae2 to
2fe60c0
Compare
To re-use the same parsing logic from metrics gathering. Bug: 476232062
The per-index distinction of a provided value versus a default matters for per-instance existence flag metrics like `qemu_binary_specified`. For example, if a user passes `--qemu_binary_dir=<value>,unset,<value>` then the complete `flag_info.is_default` will be false, but the middle instance should return `false` for `qemu_binary_specified`. The new field was added to the `FlagBase` constructor with a default that matches current behavior and avoid updating all the existing calls. It is trivial for the implementations that call the `from_gflags.h` helpers where the value is determined, but flags with other implementations are more complex. Since the new `FlagBase::IsDefaultForIndex` is only going to be used for a limited number of metrics flags, I feel it is safe to defer that work until it becomes necessary. Bug: 476232062
Not yet converted for transmission, but available. Bug: 476232062
Bug: 476232062
cjreynol
force-pushed
the
qemu_binary_flag_metrics
branch
from
September 25, 2026 18:35
2fe60c0 to
685ae13
Compare
This branch has not been deployed
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.
Not the flag's value, but its existence in the invocation.
This required adding the
FlagBase::IsDefaultForIndexhelper to account for multi-device cases where the value is provided for some instances andunsetis provided for others.Bug: 476232062