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

Unified Diff: content/browser/browser_shutdown_profile_dumper.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
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | content/browser/devtools/protocol/tracing_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_shutdown_profile_dumper.cc
diff --git a/content/browser/browser_shutdown_profile_dumper.cc b/content/browser/browser_shutdown_profile_dumper.cc
index c2533a09604cbe7a5490d55758acc4844e4a3f99..0197093db152c380586bd9f2ce9a76ae49da0715 100644
--- a/content/browser/browser_shutdown_profile_dumper.cc
+++ b/content/browser/browser_shutdown_profile_dumper.cc
@@ -29,14 +29,20 @@ BrowserShutdownProfileDumper::~BrowserShutdownProfileDumper() {
WriteTracesToDisc();
}
+static float GetTraceBufferPercentFull() {
+ base::debug::TraceLogStatus status =
+ base::debug::TraceLog::GetInstance()->GetStatus();
+ return 100 * static_cast<float>(static_cast<double>(status.event_count) /
+ status.event_capacity);
+}
+
void BrowserShutdownProfileDumper::WriteTracesToDisc() {
// Note: I have seen a usage of 0.000xx% when dumping - which fits easily.
// Since the tracer stops when the trace buffer is filled, we'd rather save
// what we have than nothing since we might see from the amount of events
// that caused the problem.
- DVLOG(1) << "Flushing shutdown traces to disc. The buffer is %" <<
- base::debug::TraceLog::GetInstance()->GetBufferPercentFull() <<
- " full.";
+ DVLOG(1) << "Flushing shutdown traces to disc. The buffer is "
+ << GetTraceBufferPercentFull() << "% full.";
DCHECK(!dump_file_);
dump_file_ = base::OpenFile(dump_file_name_, "w+");
if (!IsFileValid()) {
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | content/browser/devtools/protocol/tracing_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698