Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Issue 2316403002: Fix races in trace events filtering. (Closed)

Created:
4 years, 3 months ago by ssid
Modified:
4 years, 3 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, Primiano Tucci (use gerrit)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix races in trace events filtering. The trace event filters for each category were stored as a list and the objects were destroyed when tracing ends. But, when destroying these filters the trace events on other thread which have checked the ENABLED_FOR_FILTERING flag will try to access the filters list at the same time. This CL: 1. Makes the filters enabled for categories a bitmap and restricts the number of filters that can be added in Chrome to 32 across all tracing sessions in a single browsing session. This removes the need for creation for filters for each category group. 2. Keeps all the filters alive till next tracing session starts since it is not possible to determine when the trace events have finished accessing the filter and it gives enough time for all the threads to complete acessing the filter. 3. Stores a global vector of all filters with max size 32 to access all the enabled filters for a trace category (corresponding to the bitmap flag) quickly. This CL also fixes another issue where the trace events from V8 and Skia were not recorded by EndEvent calls in filters. This is because the EndFilter was called by trace_event.h. This call is now moved to UpdateDuration, and end of all the events will now be recorded in filters. BUG=625170 Committed: https://crrev.com/7e6ad8071badb6ce2bb83cc8278f9662f191c953 Cr-Commit-Position: refs/heads/master@{#419917}

Patch Set 1 #

Patch Set 2 : Clear filters on SetEnabled. #

Total comments: 6

Patch Set 3 : Fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -53 lines) Patch
M base/trace_event/trace_event.h View 1 chunk +0 lines, -5 lines 0 comments Download
M base/trace_event/trace_log.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M base/trace_event/trace_log.cc View 1 2 10 chunks +88 lines, -48 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 35 (24 generated)
ssid
ptal thanks.
4 years, 3 months ago (2016-09-08 17:36:50 UTC) #14
ssid
friendly ping
4 years, 3 months ago (2016-09-13 01:37:56 UTC) #15
oystein (OOO til 10th of July)
It feels like we should be able to solve this in a simpler way though, ...
4 years, 3 months ago (2016-09-13 21:19:09 UTC) #16
ssid
On 2016/09/13 21:19:09, oystein wrote: > It feels like we should be able to solve ...
4 years, 3 months ago (2016-09-13 22:37:27 UTC) #17
oystein (OOO til 10th of July)
On 2016/09/13 22:37:27, ssid wrote: > On 2016/09/13 21:19:09, oystein wrote: > > It feels ...
4 years, 3 months ago (2016-09-15 16:39:01 UTC) #18
ssid
cleared the filters at SetEnabled. UpdateCategoryGroupEnabledFlag is always called under lock, so two threads creating ...
4 years, 3 months ago (2016-09-16 18:33:08 UTC) #22
oystein (OOO til 10th of July)
This is great, thank you! lgtm with nits. https://codereview.chromium.org/2316403002/diff/120001/base/trace_event/trace_log.cc File base/trace_event/trace_log.cc (right): https://codereview.chromium.org/2316403002/diff/120001/base/trace_event/trace_log.cc#newcode591 base/trace_event/trace_log.cc:591: unsigned ...
4 years, 3 months ago (2016-09-16 19:09:00 UTC) #23
ssid
thanks, fixed. https://codereview.chromium.org/2316403002/diff/120001/base/trace_event/trace_log.cc File base/trace_event/trace_log.cc (right): https://codereview.chromium.org/2316403002/diff/120001/base/trace_event/trace_log.cc#newcode591 base/trace_event/trace_log.cc:591: unsigned index = 0; On 2016/09/16 19:09:00, ...
4 years, 3 months ago (2016-09-21 00:20:26 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2316403002/140001
4 years, 3 months ago (2016-09-21 00:21:23 UTC) #31
commit-bot: I haz the power
Committed patchset #3 (id:140001)
4 years, 3 months ago (2016-09-21 00:28:33 UTC) #33
commit-bot: I haz the power
4 years, 3 months ago (2016-09-21 00:31:04 UTC) #35
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/7e6ad8071badb6ce2bb83cc8278f9662f191c953
Cr-Commit-Position: refs/heads/master@{#419917}

Powered by Google App Engine
This is Rietveld 408576698