|
|
Chromium Code Reviews
DescriptionRecord field-trial information in stability file for crash analysis.
BUG=620813
Review-Url: https://codereview.chromium.org/2666653002
Cr-Commit-Position: refs/heads/master@{#449013}
Committed: https://chromium.googlesource.com/chromium/src/+/33d92f4ec79c19ddc925b1a96adad8e4edbd8010
Patch Set 1 #Patch Set 2 : rebased #Patch Set 3 : use observer for field trial changes #Patch Set 4 : record field trial info directly instead of via posted task #
Total comments: 4
Patch Set 5 : addressed review comments by manzagop #
Total comments: 11
Patch Set 6 : addressed review comments by asvitkine #
Total comments: 6
Patch Set 7 : rebased #
Total comments: 2
Patch Set 8 : use GetActiveFieldTrialGroups instead of caching them locally #
Total comments: 4
Patch Set 9 : use c++ loop format #
Messages
Total messages: 93 (65 generated)
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
bcwhite@chromium.org changed reviewers: + manzagop@chromium.org
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
I want to make sure my understanding of Field trials is accurate. IIUC: - at startup it is already possible to know your full experiment configuration based on your seed and your commandline - *However* UMA uploads and crash reports only contain a *subset* of that configuration, based on what was "registered" at the time, because an experiment that is not registered has no effect. https://cs.chromium.org/chromium/src/components/metrics/metrics_service.h?rcl... Does this change record all experiments or the registered ones?
> > IIUC: > - at startup it is already possible to know your full experiment > configuration > based on your seed and your commandline > - *However* UMA uploads and crash reports only contain a *subset* of that > configuration, based on what was "registered" at the time, because an > experiment > that is not registered has no effect. > https://cs.chromium.org/chromium/src/components/ > metrics/metrics_service.h?rcl=1485491011&l=238 > > Does this change record all experiments or the registered ones? > What's recorded for field trials is the same information that's passed to all subprocesses so it should be complete. The global-user strings then record the actual lookups and their results. Brian bcwhite@google.com ----------------------------------------------------------------------------------------- *Treat someone as they are and they will remain that way.Treat someone as they can be and they will become that way.* -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #3 (id:40001) has been deleted
Patchset #2 (id:20001) has been deleted
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #2 (id:60001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
(+Alexei to make sure we get this right) IIUC: >> - at startup it is already possible to know your full experiment >> configuration >> based on your seed and your commandline >> - *However* UMA uploads and crash reports only contain a *subset* of that >> configuration, based on what was "registered" at the time, because an >> experiment >> that is not registered has no effect. >> https://cs.chromium.org/chromium/src/components/metrics/metr >> ics_service.h?rcl=1485491011&l=238 >> >> Does this change record all experiments or the registered ones? >> > > What's recorded for field trials is the same information that's passed to > all subprocesses so it should be complete. > I had a look at the code and this function dumps the registered_ field. My understanding is this field grows throughout chrome's lifetime, so I don't think a one time dump is enough. I'm guessing that's why there are calls to AddToAllocatorWhileLocked in ActivateFieldTrialEntryWhileLocked and OnGroupFinalized in addition to InstantiateFieldTrialAllocatorIfNeeded. The global-user strings then record the actual lookups and their results. > It seems not ideal to need to check a second structure to know about experiments being active. Could we use the existing activated field from the FieldTrialEntry struct [2]? [2] https://cs.chromium.org/chromium/src/base/metrics/ field_trial.h?type=cs&l=155 -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The 'activated' field should indeed be up to date. It's true that the data can grow during Chrome's runtime, but this is generally rare after startup - usually most trials are created by VariationsService during startup. Still, ideally we would use the most up to date version of that data (i.e. the one in the actual shared memory segment rather than a copy of it). But that would I guess require additional support - since it would be separate from breadcrumbs itself. On Tue, Jan 31, 2017 at 8:20 AM, Pierre-Antoine Manzagol < manzagop@chromium.org> wrote: > (+Alexei to make sure we get this right) > > IIUC: >>> - at startup it is already possible to know your full experiment >>> configuration >>> based on your seed and your commandline >>> - *However* UMA uploads and crash reports only contain a *subset* of that >>> configuration, based on what was "registered" at the time, because an >>> experiment >>> that is not registered has no effect. >>> https://cs.chromium.org/chromium/src/components/metrics/metr >>> ics_service.h?rcl=1485491011&l=238 >>> >>> Does this change record all experiments or the registered ones? >>> >> >> What's recorded for field trials is the same information that's passed to >> all subprocesses so it should be complete. >> > > I had a look at the code and this function dumps the registered_ field. My > understanding is this field grows throughout chrome's lifetime, so I don't > think a one time dump is enough. I'm guessing that's why there are calls to > AddToAllocatorWhileLocked in ActivateFieldTrialEntryWhileLocked > and OnGroupFinalized in addition to InstantiateFieldTrialAlloca > torIfNeeded. > > The global-user strings then record the actual lookups and their results. >> > > It seems not ideal to need to check a second structure to know about > experiments being active. Could we use the existing activated field from > the FieldTrialEntry struct [2]? > > [2] https://cs.chromium.org/chromium/src/base/metrics/field_ > trial.h?type=cs&l=155 > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Right we want to have the complete up to date picture, as we hope this will increase fidelity of experiment membership information in crashes and stability reports. Some more questions: - Is there a difference between registered and activated? - (assuming yes) what do the stability / crash reports include: activated or registered? On Tue, Jan 31, 2017 at 11:31 AM, Alexei Svitkine <asvitkine@chromium.org> wrote: > The 'activated' field should indeed be up to date. > > It's true that the data can grow during Chrome's runtime, but this is > generally rare after startup - usually most trials are created by > VariationsService during startup. > > Still, ideally we would use the most up to date version of that data (i.e. > the one in the actual shared memory segment rather than a copy of it). But > that would I guess require additional support - since it would be separate > from breadcrumbs itself. > > On Tue, Jan 31, 2017 at 8:20 AM, Pierre-Antoine Manzagol < > manzagop@chromium.org> wrote: > >> (+Alexei to make sure we get this right) >> >> IIUC: >>>> - at startup it is already possible to know your full experiment >>>> configuration >>>> based on your seed and your commandline >>>> - *However* UMA uploads and crash reports only contain a *subset* of >>>> that >>>> configuration, based on what was "registered" at the time, because an >>>> experiment >>>> that is not registered has no effect. >>>> https://cs.chromium.org/chromium/src/components/metrics/metr >>>> ics_service.h?rcl=1485491011&l=238 >>>> >>>> Does this change record all experiments or the registered ones? >>>> >>> >>> What's recorded for field trials is the same information that's passed >>> to all subprocesses so it should be complete. >>> >> >> I had a look at the code and this function dumps the registered_ field. >> My understanding is this field grows throughout chrome's lifetime, so I >> don't think a one time dump is enough. I'm guessing that's why there are >> calls to AddToAllocatorWhileLocked in ActivateFieldTrialEntryWhileLocked >> and OnGroupFinalized in addition to InstantiateFieldTrialAlloca >> torIfNeeded. >> >> The global-user strings then record the actual lookups and their results. >>> >> >> It seems not ideal to need to check a second structure to know about >> experiments being active. Could we use the existing activated field from >> the FieldTrialEntry struct [2]? >> >> [2] https://cs.chromium.org/chromium/src/base/metrics/field_tria >> l.h?type=cs&l=155 >> > > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
There's a difference. Crash reports include activated. On Jan 31, 2017 8:45 AM, "Pierre-Antoine Manzagol" <manzagop@chromium.org> wrote: > Right we want to have the complete up to date picture, as we hope this > will increase fidelity of experiment membership information in crashes and > stability reports. > > Some more questions: > - Is there a difference between registered and activated? > - (assuming yes) what do the stability / crash reports include: activated > or registered? > > On Tue, Jan 31, 2017 at 11:31 AM, Alexei Svitkine <asvitkine@chromium.org> > wrote: > >> The 'activated' field should indeed be up to date. >> >> It's true that the data can grow during Chrome's runtime, but this is >> generally rare after startup - usually most trials are created by >> VariationsService during startup. >> >> Still, ideally we would use the most up to date version of that data >> (i.e. the one in the actual shared memory segment rather than a copy of >> it). But that would I guess require additional support - since it would be >> separate from breadcrumbs itself. >> >> On Tue, Jan 31, 2017 at 8:20 AM, Pierre-Antoine Manzagol < >> manzagop@chromium.org> wrote: >> >>> (+Alexei to make sure we get this right) >>> >>> IIUC: >>>>> - at startup it is already possible to know your full experiment >>>>> configuration >>>>> based on your seed and your commandline >>>>> - *However* UMA uploads and crash reports only contain a *subset* of >>>>> that >>>>> configuration, based on what was "registered" at the time, because an >>>>> experiment >>>>> that is not registered has no effect. >>>>> https://cs.chromium.org/chromium/src/components/metrics/metr >>>>> ics_service.h?rcl=1485491011&l=238 >>>>> >>>>> Does this change record all experiments or the registered ones? >>>>> >>>> >>>> What's recorded for field trials is the same information that's passed >>>> to all subprocesses so it should be complete. >>>> >>> >>> I had a look at the code and this function dumps the registered_ field. >>> My understanding is this field grows throughout chrome's lifetime, so I >>> don't think a one time dump is enough. I'm guessing that's why there are >>> calls to AddToAllocatorWhileLocked in ActivateFieldTrialEntryWhileLocked >>> and OnGroupFinalized in addition to InstantiateFieldTrialAlloca >>> torIfNeeded. >>> >>> The global-user strings then record the actual lookups and their results. >>>> >>> >>> It seems not ideal to need to check a second structure to know about >>> experiments being active. Could we use the existing activated field from >>> the FieldTrialEntry struct [2]? >>> >>> [2] https://cs.chromium.org/chromium/src/base/metrics/field_tria >>> l.h?type=cs&l=155 >>> >> >> > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
It's true that only a single snapshot of the metrics information is captured and stored. However, the individual recordings of the checks will always show the value at the time of the query. That means that additions and changes will still get recorded, though only the result they returned rather than the full field-trial/feature information.
On 2017/01/31 18:36:24, bcwhite wrote: > It's true that only a single snapshot of the metrics information is captured and > stored. However, the individual recordings of the checks will always show the > value at the time of the query. > > That means that additions and changes will still get recorded, though only the > result they returned rather than the full field-trial/feature information. Stability reports and crash reports seem to only have the hashed experiment and group, so it looks like we don't need some of the data in the snapshot (e.g. params). For the global user data, we'd need to add the experiment group in addition to the name, but I don't think I like it as a mechanism... It seems preferable to have a dedicated experiment recording, no? Siggi's also asking about single-instancing the experiment set data. Let me start a thread.
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
Implemented as discussed. All field-trial activations are recorded in global_data along with the active group name. I've checked this on an official build and about 1.5KiB of strings are stored in the breadcrumbs file. Note that this only affects field-trials. Features enabled on the command-line via --enable-features do not get included this way but those that have --force-field-trials=... do appear.
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Patchset #3 (id:90001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Record field-trial information in stability file for crash analysis. BUG=620813 ========== to ========== Record field-trial information in stability file for crash analysis. BUG=620813 ==========
bcwhite@chromium.org changed reviewers: - asvitkine@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
manzagop@chromium.org changed reviewers: + siggi@chromium.org
I've investigated how experiments are recorded to crash keys and I think Siggi's concern is the delay from the observer mechanism posting a task. Siggi, can you confim this is your concern?
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Patchset #4 (id:130001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Yups, we want immediate recording, not re-posting. On Fri, Feb 3, 2017 at 8:57 AM <manzagop@chromium.org> wrote: > I've investigated how experiments are recorded to crash keys and I think > Siggi's > concern is the delay from the observer mechanism posting a task. > > Siggi, can you confim this is your concern? > > https://codereview.chromium.org/2666653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On 2017/02/03 16:57:00, manzagop wrote: > I've investigated how experiments are recorded to crash keys and I think Siggi's > concern is the delay from the observer mechanism posting a task. > > Siggi, can you confim this is your concern? I've created a new version that records it immediately, no posted tasks.
Thanks, this is great! lgtm % question about GlobalUserData We need to keep in mind we have a small blind spot for now at start because we wait for the experiment state to decide whether we record to the stability file. https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... base/debug/activity_tracker.cc:1291: // Destruction of the object will disable tracking. Update comment (no longer destroys). https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... base/debug/activity_tracker.h:937: ActivityUserData global_data_; Do you mean for this to be of type GlobalUserData?
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... base/debug/activity_tracker.cc:1291: // Destruction of the object will disable tracking. On 2017/02/03 19:01:49, manzagop wrote: > Update comment (no longer destroys). Done. https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2666653002/diff/150001/base/debug/activity_tr... base/debug/activity_tracker.h:937: ActivityUserData global_data_; On 2017/02/03 19:01:49, manzagop wrote: > Do you mean for this to be of type GlobalUserData? Oops! Yes!
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
bcwhite@chromium.org changed reviewers: + asvitkine@chromium.org
asvitkine@chromium.org: Please review changes in base/metrics/field_trial.cc chrome/browser/chrome_browser_field_trials_desktop.cc
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... base/debug/activity_tracker.cc:75: void Disable() { What prevents this being called after Record() has already added something to global_data()? https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... base/debug/activity_tracker.cc:110: trial_group_map_.insert(std::make_pair(key, group_name.as_string())); group_name is being turned back into a string here, making the param being a StringPiece worse than if it was a string ref. Use a string ref instead. https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... File base/metrics/field_trial.cc (right): https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... base/metrics/field_trial.cc:987: // to an observer may not get executed before a crash. While you're changing this, how about setting crash_keys from the same place? This way, the problem will also be fixed there too. https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... base/metrics/field_trial.cc:988: base::debug::GlobalActivityTracker::RecordFieldTrial( Is this API thread safe? Because this can be called from any thread.... If it is, please document it in the API's function comment.
https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... File base/metrics/field_trial.cc (right): https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... base/metrics/field_trial.cc:987: // to an observer may not get executed before a crash. On 2017/02/06 17:46:12, Alexei Svitkine (very slow) wrote: > While you're changing this, how about setting crash_keys from the same place? > This way, the problem will also be fixed there too. IIUC the problem with crash keys is the update leads to querying for all active experiments, hashing them, and formatting them, which is deemed too expensive to be inline experiment activation?
I think it's inefficient, yes, but it's still all just computation stuff that doesn't involve IO so I think it should still be fine to do it inline as part of experiment activation. Plus, we'll only do it as many times as there are active experiments - so total 30 or so times each session. On Mon, Feb 6, 2017 at 1:38 PM, <manzagop@chromium.org> wrote: > > https://codereview.chromium.org/2666653002/diff/170001/base/ > metrics/field_trial.cc > File base/metrics/field_trial.cc (right): > > https://codereview.chromium.org/2666653002/diff/170001/base/ > metrics/field_trial.cc#newcode987 > base/metrics/field_trial.cc:987: // to an observer may not get executed > before a crash. > On 2017/02/06 17:46:12, Alexei Svitkine (very slow) wrote: > > While you're changing this, how about setting crash_keys from the same > place? > > This way, the problem will also be fixed there too. > > IIUC the problem with crash keys is the update leads to querying for all > active experiments, hashing them, and formatting them, which is deemed > too expensive to be inline experiment activation? > > https://codereview.chromium.org/2666653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... base/debug/activity_tracker.cc:75: void Disable() { On 2017/02/06 17:46:12, Alexei Svitkine (slow) wrote: > What prevents this being called after Record() has already added something to > global_data()? Nothing. Data before that point will be recorded, if a GlobalActivityTracker got created, but not after. No harm. https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... base/debug/activity_tracker.cc:110: trial_group_map_.insert(std::make_pair(key, group_name.as_string())); On 2017/02/06 17:46:12, Alexei Svitkine (slow) wrote: > group_name is being turned back into a string here, making the param being a > StringPiece worse than if it was a string ref. Use a string ref instead. This isn't the usual case, though. Normal activity will run through the case above which doesn't turn it back into a std::string. However, since we know where it's being called from and that it's a std::string there, might as well make use of that. Done. https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... File base/metrics/field_trial.cc (right): https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... base/metrics/field_trial.cc:987: // to an observer may not get executed before a crash. Happy to do it, if it's desired, but I'll do it as a separate CL so if there is a problem and it has to be reverted, it won't affect the rest. https://codereview.chromium.org/2666653002/diff/170001/base/metrics/field_tri... base/metrics/field_trial.cc:988: base::debug::GlobalActivityTracker::RecordFieldTrial( On 2017/02/06 17:46:12, Alexei Svitkine (slow) wrote: > Is this API thread safe? Because this can be called from any thread.... > > If it is, please document it in the API's function comment. Yes. Done.
https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... base/debug/activity_tracker.cc:75: void Disable() { On 2017/02/07 15:58:58, bcwhite wrote: > On 2017/02/06 17:46:12, Alexei Svitkine (slow) wrote: > > What prevents this being called after Record() has already added something to > > global_data()? > > Nothing. Data before that point will be recorded, if a GlobalActivityTracker > got created, but not after. No harm. Can you document that? In practice, I guess this means that whatever trials we check before and including the trial that's controlling the Feature in question will always be recorded? https://codereview.chromium.org/2666653002/diff/190001/base/debug/activity_tr... File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2666653002/diff/190001/base/debug/activity_tr... base/debug/activity_tracker.h:792: // dumped into it. This call is completely thread-safe. Nit: Remove the word "completely". "thread safe" is enough to be clear. https://codereview.chromium.org/2666653002/diff/190001/base/debug/activity_tr... base/debug/activity_tracker.h:796: // Disable all filed trial recording. This should be called when its known field https://codereview.chromium.org/2666653002/diff/190001/chrome/browser/chrome_... File chrome/browser/chrome_browser_field_trials_desktop.cc (right): https://codereview.chromium.org/2666653002/diff/190001/chrome/browser/chrome_... chrome/browser/chrome_browser_field_trials_desktop.cc:115: base::debug::GlobalActivityTracker::DisableFieldTrialRecording(); I notice SetupStabilityDebugging() is only called on Windows. So on other platforms we'll never hit this Disable call. What will happen then - since the field_trial.cc code still runs on all the platforms?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/170001/base/debug/activity_tr... base/debug/activity_tracker.cc:75: void Disable() { On 2017/02/07 16:14:06, Alexei Svitkine (slow) wrote: > On 2017/02/07 15:58:58, bcwhite wrote: > > On 2017/02/06 17:46:12, Alexei Svitkine (slow) wrote: > > > What prevents this being called after Record() has already added something > to > > > global_data()? > > > > Nothing. Data before that point will be recorded, if a GlobalActivityTracker > > got created, but not after. No harm. > > Can you document that? In practice, I guess this means that whatever trials we > check before and including the trial that's controlling the Feature in question > will always be recorded? They can't be recorded until a global tracker is created. Generally, it'll either be created or field-trial tracking will be disabled but not both. The result is that early field-trial activations will get held in temporary space and then discarded when Disable is called. https://codereview.chromium.org/2666653002/diff/190001/base/debug/activity_tr... File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2666653002/diff/190001/base/debug/activity_tr... base/debug/activity_tracker.h:792: // dumped into it. This call is completely thread-safe. On 2017/02/07 16:14:06, Alexei Svitkine (slow) wrote: > Nit: Remove the word "completely". "thread safe" is enough to be clear. Done. https://codereview.chromium.org/2666653002/diff/190001/base/debug/activity_tr... base/debug/activity_tracker.h:796: // Disable all filed trial recording. This should be called when its known On 2017/02/07 16:14:06, Alexei Svitkine (slow) wrote: > field Done. https://codereview.chromium.org/2666653002/diff/190001/chrome/browser/chrome_... File chrome/browser/chrome_browser_field_trials_desktop.cc (right): https://codereview.chromium.org/2666653002/diff/190001/chrome/browser/chrome_... chrome/browser/chrome_browser_field_trials_desktop.cc:115: base::debug::GlobalActivityTracker::DisableFieldTrialRecording(); On 2017/02/07 16:14:06, Alexei Svitkine (slow) wrote: > I notice SetupStabilityDebugging() is only called on Windows. > > So on other platforms we'll never hit this Disable call. > > What will happen then - since the field_trial.cc code still runs on all the > platforms? Good catch. Added call to disable on non-Win platforms.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2666653002/diff/210001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/210001/base/debug/activity_tr... base/debug/activity_tracker.cc:82: void DumpCollectedActivity() { Thinking about this more, I think we can simplify this much more by not having this extra FieldTrialRecorder class. Right now, you monitor for field trial activations even before the global object has been created and then have this Dump call to synchronize it. Instead, I propose the following: - When GlobalTracker is created, instead of the Dump call from this intermediate object, it queries the current activated state from the FieldTrial system. - Calls to base::debug::GlobalActivityTracker::RecordFieldTrial() are no-ops before the GlobalTracker exists and once it does they start update the full state. This way, no need for FieldTrialRecorded and no need for extra intermediate state or any special Disable functionality. You can get the active field trial groups via GetActiveFieldTrialGroups() when the activity tracker is created.
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #8 (id:230001) has been deleted
https://codereview.chromium.org/2666653002/diff/210001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/210001/base/debug/activity_tr... base/debug/activity_tracker.cc:82: void DumpCollectedActivity() { On 2017/02/07 19:28:10, Alexei Svitkine (slow) wrote: > Thinking about this more, I think we can simplify this much more by not having > this extra FieldTrialRecorder class. > > Right now, you monitor for field trial activations even before the global object > has been created and then have this Dump call to synchronize it. > > Instead, I propose the following: > - When GlobalTracker is created, instead of the Dump call from this > intermediate object, it queries the current activated state from the FieldTrial > system. > - Calls to base::debug::GlobalActivityTracker::RecordFieldTrial() are no-ops > before the GlobalTracker exists and once it does they start update the full > state. > > This way, no need for FieldTrialRecorded and no need for extra intermediate > state or any special Disable functionality. > > You can get the active field trial groups via GetActiveFieldTrialGroups() when > the activity tracker is created. Done.
lgtm % comment https://codereview.chromium.org/2666653002/diff/250001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/250001/base/debug/activity_tr... base/debug/activity_tracker.cc:1277: for (size_t i = 0; i < active_groups.size(); ++i) Nit: C++ for each loop https://codereview.chromium.org/2666653002/diff/250001/base/metrics/field_tri... File base/metrics/field_trial.cc (right): https://codereview.chromium.org/2666653002/diff/250001/base/metrics/field_tri... base/metrics/field_trial.cc:993: } Nit: I prefer this extra logic to be inside GlobalActivityTracker - i.e. still have a single static call from here like before and then do the null check within it and call the instance method there. The instance method can then be private.
The CQ bit was checked by bcwhite@chromium.org to run a CQ dry run
https://codereview.chromium.org/2666653002/diff/250001/base/debug/activity_tr... File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2666653002/diff/250001/base/debug/activity_tr... base/debug/activity_tracker.cc:1277: for (size_t i = 0; i < active_groups.size(); ++i) On 2017/02/07 21:23:52, Alexei Svitkine (slow) wrote: > Nit: C++ for each loop Done. I'd just copied it from a unittest. https://codereview.chromium.org/2666653002/diff/250001/base/metrics/field_tri... File base/metrics/field_trial.cc (right): https://codereview.chromium.org/2666653002/diff/250001/base/metrics/field_tri... base/metrics/field_trial.cc:993: } On 2017/02/07 21:23:52, Alexei Svitkine (slow) wrote: > Nit: I prefer this extra logic to be inside GlobalActivityTracker - i.e. still > have a single static call from here like before and then do the null check > within it and call the instance method there. > > The instance method can then be private. It could but all the existing tracker interface operates as methods off of an instance so I'd like to remain consistent with that.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by bcwhite@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from manzagop@chromium.org, asvitkine@chromium.org Link to the patchset: https://codereview.chromium.org/2666653002/#ps270001 (title: "use c++ loop format")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 270001, "attempt_start_ts": 1486571778921700,
"parent_rev": "013e6c4c3399fd6da7e11ab4a7b668f5b6f295c7", "commit_rev":
"33d92f4ec79c19ddc925b1a96adad8e4edbd8010"}
Message was sent while issue was closed.
Description was changed from ========== Record field-trial information in stability file for crash analysis. BUG=620813 ========== to ========== Record field-trial information in stability file for crash analysis. BUG=620813 Review-Url: https://codereview.chromium.org/2666653002 Cr-Commit-Position: refs/heads/master@{#449013} Committed: https://chromium.googlesource.com/chromium/src/+/33d92f4ec79c19ddc925b1a96ada... ==========
Message was sent while issue was closed.
Committed patchset #9 (id:270001) as https://chromium.googlesource.com/chromium/src/+/33d92f4ec79c19ddc925b1a96ada... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
