|
|
DescriptionLimit the number of simultaneous event logs.
BUG=webrtc:7887
Review-Url: https://codereview.webrtc.org/2956003003
Cr-Commit-Position: refs/heads/master@{#18808}
Committed: https://chromium.googlesource.com/external/webrtc/+/c8e0552c0724dfc93c8b4334b2872c52cab04a1c
Patch Set 1 #Patch Set 2 : Make private #
Total comments: 5
Patch Set 3 : Use atomics instead of lock. #Messages
Total messages: 22 (16 generated)
The CQ bit was checked by terelius@webrtc.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.webrtc.org/...
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 terelius@webrtc.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.webrtc.org/...
terelius@webrtc.org changed reviewers: + tommi@webrtc.org
https://codereview.webrtc.org/2956003003/diff/20001/webrtc/logging/rtc_event_... File webrtc/logging/rtc_event_log/rtc_event_log.cc (right): https://codereview.webrtc.org/2956003003/diff/20001/webrtc/logging/rtc_event_... webrtc/logging/rtc_event_log/rtc_event_log.cc:102: static rtc::CriticalSection crit_; this is a complex global == cl will get reverted right away https://codereview.webrtc.org/2956003003/diff/20001/webrtc/logging/rtc_event_... webrtc/logging/rtc_event_log/rtc_event_log.cc:171: int RtcEventLogImpl::log_count = 0; log_count is missing the postfix _ actually... since it's global, perhaps it should have a g_ prefix? Regardless, I think we need to change the approach to not use a lock but only use a single atomic variable (assuming it really is accessed from multiple threads). https://codereview.webrtc.org/2956003003/diff/20001/webrtc/logging/rtc_event_... webrtc/logging/rtc_event_log/rtc_event_log.cc:584: LOG(LS_WARNING) << "Denied creation of additional WebRTC event logs. " there isn't a need to make this call while holding a lock btw. Logging can invoke quite a bit of code, including grabbing additional, potentially contended, locks. https://codereview.webrtc.org/2956003003/diff/20001/webrtc/logging/rtc_event_... webrtc/logging/rtc_event_log/rtc_event_log.cc:610: if (RtcEventLogImpl::AllowNewEventLog()) { instead of this approach, what about something like: auto ret = AtomicIncrement(&g_event_log_count); if (ret > kMax) { AtomicDecrement(&g_event_log_count); return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); } return std::unique_ptr<RtcEventLog>(new RtcEventLogImpl()); https://codereview.webrtc.org/2956003003/diff/20001/webrtc/logging/rtc_event_... webrtc/logging/rtc_event_log/rtc_event_log.cc:618: } else { no need for 'else' since the previous conditional always returns
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 terelius@webrtc.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.webrtc.org/...
Thanks for the comments. Rewritten as you suggested. Could you take another look? Class variables in the rest of the code don't seem to use the g_ prefix. Do you still want me to use it?
lgtm
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 terelius@webrtc.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1498657143282380, "parent_rev": "41b59ca8bf4d1a0320967fb3109791a43d42b39d", "commit_rev": "c8e0552c0724dfc93c8b4334b2872c52cab04a1c"}
Message was sent while issue was closed.
Description was changed from ========== Limit the number of simultaneous event logs. BUG=webrtc:7887 ========== to ========== Limit the number of simultaneous event logs. BUG=webrtc:7887 Review-Url: https://codereview.webrtc.org/2956003003 Cr-Commit-Position: refs/heads/master@{#18808} Committed: https://chromium.googlesource.com/external/webrtc/+/c8e0552c0724dfc93c8b4334b... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/external/webrtc/+/c8e0552c0724dfc93c8b4334b... |