Add UMA logging for base::FeatureList::IsEnabled() calls. [chromium/src : main]

0 views
Skip to first unread message

Alexei Svitkine (Gerrit)

unread,
Mar 9, 2026, 10:15:27 AM (3 days ago) Mar 9
to Arkadiusz Tomczak, Ramon Cano Aparicio, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
Attention needed from Arkadiusz Tomczak and Ramon Cano Aparicio

Alexei Svitkine added 7 comments

File base/feature_list.cc
Line 310, Patchset 11 (Latest):constexpr uint32_t kCachedLogGeneralMask = 0x00010000;
Alexei Svitkine . unresolved

Add comments to these and also can they be defined somewhere close to the comment above mutable std::atomic<uint32_t> cached_value?

One option is to make a type alias for this type and having the comment above the type alias and have the constants following, together in the same place.

Line 844, Patchset 11 (Latest): // We need to use a loop to preserve the logging bits (bits 16 and 17),
Alexei Svitkine . unresolved

Let's make a helper function to set the specified bits that you call here.

Line 1068, Patchset 11 (Latest):void FeatureList::RegisterFeatureAccess(const Feature& feature,
Alexei Svitkine . unresolved

Make this in anon namespace function at the top of the file, since it doesn't need to be in the .h

Line 1073, Patchset 11 (Latest): if ((expected & logging_mask) == logging_mask) {
Alexei Svitkine . unresolved

This is the same condition as the while, so not needed.

Line 1079, Patchset 11 (Latest): if (feature.cached_value.compare_exchange_weak(expected, new_value,
Alexei Svitkine . unresolved

Nit: Let's add a comment mentioning that this call will update `expected` if the value doesn't match.

File base/feature_list_unittest.cc
Line 1097, Patchset 11 (Latest):BASE_FEATURE(kEarlyFeature, FEATURE_DISABLED_BY_DEFAULT);
Alexei Svitkine . unresolved

Put these at the top of the file in the anon namespace.

File tools/metrics/histograms/metadata/variations/enums.xml
Line 37, Patchset 11 (Latest):<enum name="HashFeatureName">
Alexei Svitkine . unresolved

Nit: FeatureNameHash

Open in Gerrit

Related details

Attention is currently required from:
  • Arkadiusz Tomczak
  • Ramon Cano Aparicio
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
Gerrit-Change-Number: 7637774
Gerrit-PatchSet: 11
Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Ramon Cano Aparicio <rcanoa...@google.com>
Gerrit-Attention: Arkadiusz Tomczak <arto...@google.com>
Gerrit-Comment-Date: Mon, 09 Mar 2026 14:15:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Arkadiusz Tomczak (Gerrit)

unread,
Mar 10, 2026, 9:28:43 AM (2 days ago) Mar 10
to Ramon Cano Aparicio, Alexei Svitkine, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
Attention needed from Alexei Svitkine and Ramon Cano Aparicio

Arkadiusz Tomczak voted and added 7 comments

Votes added by Arkadiusz Tomczak

Commit-Queue+1

7 comments

File base/feature_list.cc
Line 310, Patchset 11:constexpr uint32_t kCachedLogGeneralMask = 0x00010000;
Alexei Svitkine . resolved

Add comments to these and also can they be defined somewhere close to the comment above mutable std::atomic<uint32_t> cached_value?

One option is to make a type alias for this type and having the comment above the type alias and have the constants following, together in the same place.

Arkadiusz Tomczak

I created type alias and moved the constants.

Line 844, Patchset 11: // We need to use a loop to preserve the logging bits (bits 16 and 17),
Alexei Svitkine . resolved

Let's make a helper function to set the specified bits that you call here.

Arkadiusz Tomczak

Separated to helper function.

Line 1068, Patchset 11:void FeatureList::RegisterFeatureAccess(const Feature& feature,
Alexei Svitkine . resolved

Make this in anon namespace function at the top of the file, since it doesn't need to be in the .h

Arkadiusz Tomczak

Moved to anonymous namespace.

Line 1073, Patchset 11: if ((expected & logging_mask) == logging_mask) {
Alexei Svitkine . resolved

This is the same condition as the while, so not needed.

Arkadiusz Tomczak

Right, removed the condition.

Line 1079, Patchset 11: if (feature.cached_value.compare_exchange_weak(expected, new_value,
Alexei Svitkine . resolved

Nit: Let's add a comment mentioning that this call will update `expected` if the value doesn't match.

Arkadiusz Tomczak

Added a comment.

File base/feature_list_unittest.cc
Line 1097, Patchset 11:BASE_FEATURE(kEarlyFeature, FEATURE_DISABLED_BY_DEFAULT);
Alexei Svitkine . resolved

Put these at the top of the file in the anon namespace.

Arkadiusz Tomczak

Done

File tools/metrics/histograms/metadata/variations/enums.xml
Line 37, Patchset 11:<enum name="HashFeatureName">
Alexei Svitkine . resolved

Nit: FeatureNameHash

Arkadiusz Tomczak

Renamed.

Open in Gerrit

Related details

Attention is currently required from:
  • Alexei Svitkine
  • Ramon Cano Aparicio
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
    Gerrit-Change-Number: 7637774
    Gerrit-PatchSet: 14
    Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
    Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
    Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
    Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
    Gerrit-Attention: Ramon Cano Aparicio <rcanoa...@google.com>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 13:28:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Alexei Svitkine <asvi...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alexei Svitkine (Gerrit)

    unread,
    Mar 10, 2026, 10:28:28 AM (2 days ago) Mar 10
    to Arkadiusz Tomczak, Ramon Cano Aparicio, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
    Attention needed from Arkadiusz Tomczak and Ramon Cano Aparicio

    Alexei Svitkine added 2 comments

    File base/feature_list.h
    Line 285, Patchset 14 (Latest): public:
    Alexei Svitkine . unresolved

    Don't introduce a public section in the middle. Just put these at the top of the normal public section.

    File base/feature_list.cc
    Line 327, Patchset 14 (Latest):void RegisterFeatureAccess(
    Alexei Svitkine . unresolved

    Just pass the base::Feature to this instead of cached_value and feature_name separately.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Arkadiusz Tomczak
    • Ramon Cano Aparicio
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
      Gerrit-Change-Number: 7637774
      Gerrit-PatchSet: 14
      Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
      Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
      Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
      Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Ramon Cano Aparicio <rcanoa...@google.com>
      Gerrit-Attention: Arkadiusz Tomczak <arto...@google.com>
      Gerrit-Comment-Date: Tue, 10 Mar 2026 14:28:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ramon Cano Aparicio (Gerrit)

      unread,
      Mar 10, 2026, 10:54:18 AM (2 days ago) Mar 10
      to Arkadiusz Tomczak, Alexei Svitkine, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
      Attention needed from Arkadiusz Tomczak

      Ramon Cano Aparicio voted and added 2 comments

      Votes added by Ramon Cano Aparicio

      Code-Review+1

      2 comments

      Patchset-level comments
      File-level comment, Patchset 14 (Latest):
      Ramon Cano Aparicio . resolved

      LGTM % comments

      File base/feature_list.h
      Alexei Svitkine . unresolved

      Don't introduce a public section in the middle. Just put these at the top of the normal public section.

      Ramon Cano Aparicio

      Same for the private one, it's duplicated

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Arkadiusz Tomczak
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
        Gerrit-Change-Number: 7637774
        Gerrit-PatchSet: 14
        Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
        Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
        Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
        Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-Attention: Arkadiusz Tomczak <arto...@google.com>
        Gerrit-Comment-Date: Tue, 10 Mar 2026 14:54:00 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Arkadiusz Tomczak (Gerrit)

        unread,
        4:50 AM (7 hours ago) 4:50 AM
        to Ramon Cano Aparicio, Alexei Svitkine, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
        Attention needed from Alexei Svitkine and Ramon Cano Aparicio

        Arkadiusz Tomczak added 2 comments

        File base/feature_list.h
        Line 285, Patchset 14: public:
        Alexei Svitkine . resolved

        Don't introduce a public section in the middle. Just put these at the top of the normal public section.

        Ramon Cano Aparicio

        Same for the private one, it's duplicated

        Arkadiusz Tomczak

        I've restructured the definitions and accompanying comments.

        File base/feature_list.cc
        Line 327, Patchset 14:void RegisterFeatureAccess(
        Alexei Svitkine . unresolved

        Just pass the base::Feature to this instead of cached_value and feature_name separately.

        Arkadiusz Tomczak

        We cannot do that explicitly since the `cached_value` is a private field of Feature. I brought back the RegisterFeatureAccess as static method of FeatureList, since it's a friend class and this way it will have access to this field.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alexei Svitkine
        • Ramon Cano Aparicio
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
          Gerrit-Change-Number: 7637774
          Gerrit-PatchSet: 16
          Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
          Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
          Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
          Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
          Gerrit-Attention: Ramon Cano Aparicio <rcanoa...@google.com>
          Gerrit-Comment-Date: Thu, 12 Mar 2026 08:50:06 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Alexei Svitkine <asvi...@chromium.org>
          Comment-In-Reply-To: Ramon Cano Aparicio <rcanoa...@google.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ramon Cano Aparicio (Gerrit)

          unread,
          4:56 AM (7 hours ago) 4:56 AM
          to Arkadiusz Tomczak, Alexei Svitkine, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
          Attention needed from Alexei Svitkine and Arkadiusz Tomczak

          Ramon Cano Aparicio voted and added 2 comments

          Votes added by Ramon Cano Aparicio

          Code-Review+1

          2 comments

          Patchset-level comments
          Ramon Cano Aparicio . resolved

          LGTM % comments

          File base/feature_list.h
          Line 673, Patchset 16 (Latest): // Registers the feature access to the appropriate histograms.
          static void RegisterFeatureAccess(const Feature& feature,
          Feature::FeatureStateCache logging_mask);
          Ramon Cano Aparicio . unresolved

          Let's move this below go/cstyle#Declaration_Order

          Also, make order the methods in .cc file with the same order as they are declared here.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alexei Svitkine
          • Arkadiusz Tomczak
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
            Gerrit-Change-Number: 7637774
            Gerrit-PatchSet: 16
            Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
            Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
            Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
            Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
            Gerrit-Attention: Arkadiusz Tomczak <arto...@google.com>
            Gerrit-Comment-Date: Thu, 12 Mar 2026 08:56:32 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Arkadiusz Tomczak (Gerrit)

            unread,
            5:29 AM (7 hours ago) 5:29 AM
            to Ramon Cano Aparicio, Alexei Svitkine, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
            Attention needed from Alexei Svitkine and Ramon Cano Aparicio

            Arkadiusz Tomczak added 1 comment

            File base/feature_list.h
            Line 673, Patchset 16: // Registers the feature access to the appropriate histograms.

            static void RegisterFeatureAccess(const Feature& feature,
            Feature::FeatureStateCache logging_mask);
            Ramon Cano Aparicio . resolved

            Let's move this below go/cstyle#Declaration_Order

            Also, make order the methods in .cc file with the same order as they are declared here.

            Arkadiusz Tomczak

            Moved it to a better suiting location. Methods in .cc don't follow the order from .h, but right new method is at the end of static methods block, right before first private method `FinalizeInitialization`. If we want to strictly follow this guidance, we would need to land a small refactor first.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alexei Svitkine
            • Ramon Cano Aparicio
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
              Gerrit-Change-Number: 7637774
              Gerrit-PatchSet: 17
              Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
              Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
              Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
              Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
              Gerrit-Attention: Ramon Cano Aparicio <rcanoa...@google.com>
              Gerrit-Comment-Date: Thu, 12 Mar 2026 09:29:16 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Ramon Cano Aparicio <rcanoa...@google.com>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Ramon Cano Aparicio (Gerrit)

              unread,
              6:21 AM (6 hours ago) 6:21 AM
              to Arkadiusz Tomczak, Alexei Svitkine, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, extension...@chromium.org, browser-comp...@chromium.org, chromium-a...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, asvitkine...@chromium.org
              Attention needed from Alexei Svitkine and Arkadiusz Tomczak

              Ramon Cano Aparicio voted Code-Review+1

              Code-Review+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alexei Svitkine
              • Arkadiusz Tomczak
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                • requirement satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I7c6230cd42cfe8d301361b08d37f185cf097777a
                Gerrit-Change-Number: 7637774
                Gerrit-PatchSet: 17
                Gerrit-Owner: Arkadiusz Tomczak <arto...@google.com>
                Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
                Gerrit-Reviewer: Arkadiusz Tomczak <arto...@google.com>
                Gerrit-Reviewer: Ramon Cano Aparicio <rcanoa...@google.com>
                Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
                Gerrit-Attention: Arkadiusz Tomczak <arto...@google.com>
                Gerrit-Comment-Date: Thu, 12 Mar 2026 10:21:18 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy
                Reply all
                Reply to author
                Forward
                0 new messages