This CL implements the Reactive configuration, a configuration that allows triggering a trace manually,
and the trace is either concluded after a timeout or on
a second trigger.
BUG=495187
Committed: https://crrev.com/743fcdfd45d0a18c263e897e38eb2ddfae37f7c9
Cr-Commit-Position: refs/heads/master@{#332739}
Thank you for the quick feedback, will send another version later today. Some replies. https://codereview.chromium.org/1148393003/diff/1/content/browser/tracing/background_tracing_manager_impl.cc ...
5 years, 7 months ago
(2015-05-21 16:09:39 UTC)
#3
Thank you for the quick feedback, will send another version later today.
Some replies.
https://codereview.chromium.org/1148393003/diff/1/content/browser/tracing/bac...
File content/browser/tracing/background_tracing_manager_impl.cc (right):
https://codereview.chromium.org/1148393003/diff/1/content/browser/tracing/bac...
content/browser/tracing/background_tracing_manager_impl.cc:236:
BeginFinalizing(callback);
On 2015/05/21 15:59:06, shatch wrote:
> Just wondering, does deep reports need to know or care about whether a call to
> TriggerNamedEvent triggers an EnableRecording or BeginFinalizing?
No. The idea is to collect as many as we can, but feedback is not needed.
https://codereview.chromium.org/1148393003/diff/1/content/browser/tracing/bac...
content/browser/tracing/background_tracing_manager_impl.cc:242:
GetCategoryFilterForCategoryPreset(
On 2015/05/21 15:59:06, shatch wrote:
> BackgroundTracingReactiveConfig::TracingRule has a category_preset.
Yes, see todo above.
https://codereview.chromium.org/1148393003/diff/1/content/browser/tracing/bac...
content/browser/tracing/background_tracing_manager_impl.cc:245: TracingTimer*
timer = new TracingTimer(callback);
On 2015/05/21 15:59:06, shatch wrote:
> Maybe change this to a scoped_ptr member?
Yes, that is the plan.
Expanding to a wider audience, Dan, Can you take a look?
5 years, 6 months ago
(2015-06-01 18:18:05 UTC)
#10
Expanding to a wider audience, Dan, Can you take a look?
dsinclair
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracing/background_tracing_manager_browsertest.cc File content/browser/tracing/background_tracing_manager_browsertest.cc (right): https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracing/background_tracing_manager_browsertest.cc#newcode360 content/browser/tracing/background_tracing_manager_browsertest.cc:360: BackgroundTracingManager::GetInstance()->TriggerNamedEvent( What is the timeout this is using? How ...
5 years, 6 months ago
(2015-06-01 19:14:53 UTC)
#11
Thank you for the prompt review, PTAL. https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracing/background_tracing_manager_browsertest.cc File content/browser/tracing/background_tracing_manager_browsertest.cc (right): https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracing/background_tracing_manager_browsertest.cc#newcode360 content/browser/tracing/background_tracing_manager_browsertest.cc:360: BackgroundTracingManager::GetInstance()->TriggerNamedEvent( On ...
5 years, 6 months ago
(2015-06-02 21:15:28 UTC)
#12
Thank you for the prompt review, PTAL.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
File content/browser/tracing/background_tracing_manager_browsertest.cc (right):
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_browsertest.cc:360:
BackgroundTracingManager::GetInstance()->TriggerNamedEvent(
On 2015/06/01 19:14:52, dsinclair wrote:
> What is the timeout this is using? How long will this test require to timeout?
I added a Test fire to make it instant, it used to be 10s, another approach
would be to use a MockTimer but would require exposing the timer to the test.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_browsertest.cc:375:
On 2015/06/01 19:14:52, dsinclair wrote:
> nit: extra blank line.
Done.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_browsertest.cc:396:
BackgroundTracingManager::GetInstance()->TriggerNamedEvent(
On 2015/06/01 19:14:52, dsinclair wrote:
> How do we know this terminated because of the second event and not because of
> timeout?
The timeout is 10 seconds. It is not guaranteed, but I would doubt it gets
de-scheduled for that long.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_browsertest.cc:405: // This
tests that reactive mode multiple still triggers gathers once.
On 2015/06/01 19:14:52, dsinclair wrote:
> I'm not sure what this is trying to say? triggers gathering once?
Fixed.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_browsertest.cc:411:
On 2015/06/01 19:14:52, dsinclair wrote:
> nit: remove blank link.
Done.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_browsertest.cc:436: handle,
base::Bind(&StartedFinalizingCallback, base::Closure(), false));
On 2015/06/01 19:14:52, dsinclair wrote:
> How do we know this failed?
The callback (StartedFinalizingCallback) is bound using the expected value
(false here) and get the actual value comes from the callback.Run(false).
(called from TiggerNamedEvent).
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
File content/browser/tracing/background_tracing_manager_impl.cc (right):
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_impl.cc:43:
TracingTimer(StartedFinalizingCallback callback) : callback_(callback) {
On 2015/06/01 19:14:52, dsinclair wrote:
> I think it's more common to wrap at the params then at the method name?
Done.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_impl.cc:112: const
std::vector<BackgroundTracingReactiveConfig::TracingRule>&
On 2015/06/01 19:14:53, dsinclair wrote:
> What's the difference between monitoringRules and tracingRules? This block is
> very similar to the old one just the rule types are different and the check is
> slightly differnet
It is more of an explanation using variable names, monitoring is always on, once
a trigger happens, it dumps the trace. While tracing only starts at the trigger
point. (before that the system was not tracing).
Given that, a monitoring rule does not include the categories, as the categories
are fixed while having multiple trigger points. While a tracing rule contains
the categories as the categories can change per trace trigger.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_impl.cc:158: // There is
nothing to do in case of reactive tracing.
On 2015/06/01 19:14:53, dsinclair wrote:
> Let's remove the else in that case. Just put the comment in.
Done.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_impl.cc:235:
BeginFinalizing(callback);
On 2015/06/01 19:14:52, dsinclair wrote:
> Is there a race condition in here? The BeginFinalizing sets is_tracing_ to
false
> and calls to DisableRecording which is a PostTask. The code below calls to
> EnableRecording which is also a PostTask.
>
> So, what happens if we disable, post the task but before it's processed we
come
> in here and Enable. Will we still write out the correct results for the first
> disable before we re-enable and potentially change the trace buffer?
This code will not be reached on the second trigger since is_gathering_ will be
true which is checked in the IsAbleToTriggerTracing (the last test case covers
that scenario). And is_gathering_ is set from BeginFinalizing and not from the
posted task.
https://codereview.chromium.org/1148393003/diff/140001/content/browser/tracin...
content/browser/tracing/background_tracing_manager_impl.cc:237: } else {
On 2015/06/01 19:14:52, dsinclair wrote:
> The above returned, so don't need the else.
Done.
https://codereview.chromium.org/1148393003/diff/140001/content/public/browser...
File content/public/browser/background_tracing_reactive_config.h (right):
https://codereview.chromium.org/1148393003/diff/140001/content/public/browser...
content/public/browser/background_tracing_reactive_config.h:23: enum RuleType {
TRACE_UNTIL_10S_OR_TRIGGER_OR_FULL };
On 2015/06/01 19:14:53, dsinclair wrote:
> TRACE_FOR_10S_OR_TRIGGER_OR_FULL ?
Done.
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/13549)
5 years, 6 months ago
(2015-06-03 19:33:39 UTC)
#22
Issue 1148393003: Implement Reactive Configuration in Background Tracing
(Closed)
Created 5 years, 7 months ago by fmeawad
Modified 5 years, 6 months ago
Reviewers: dsinclair, no sievers
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 46