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

Unified Diff: base/debug/trace_event_impl.cc

Issue 717083003: Report trace buffer usage as number of events, not only percentage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index ce62766da3df551884d487c2ea5f914a22f9d18a..45c8497a205057630a460b2ab02e23cf00308a76 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -1586,6 +1586,11 @@ bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const {
return it != enabled_state_observer_list_.end();
}
+size_t TraceLog::GetBufferUsage() const {
+ AutoLock lock(lock_);
+ return logged_events_->Size();
+}
+
float TraceLog::GetBufferPercentFull() const {
AutoLock lock(lock_);
return static_cast<float>(static_cast<double>(logged_events_->Size()) /

Powered by Google App Engine
This is Rietveld 408576698