Trace tracing Start/Stop events.

Permits measuring times from start of recording (usually start of a
call), and not time from first event that occurs after tracing starts.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1746693002 .

Cr-Commit-Position: refs/heads/master@{#11815}
This commit is contained in:
Peter Boström 2016-02-29 14:54:04 +01:00
parent 3f55dea259
commit dda8a837ce

View File

@ -139,6 +139,7 @@ class EventLogger final {
}
void Start(FILE* file, bool owned) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
RTC_DCHECK(file);
RTC_DCHECK(!output_file_);
output_file_ = file;
@ -158,9 +159,12 @@ class EventLogger final {
// Finally start, everything should be set up now.
logging_thread_.Start();
TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Start");
}
void Stop() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Stop");
// Try to stop. Abort if we're not currently logging.
if (rtc::AtomicOps::CompareAndSwap(&g_event_logging_active, 1, 0) == 0)
return;