| 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..c951c423e297b61f47eda26f17074688ed06b3b5 100644
|
| --- a/content/browser/browser_shutdown_profile_dumper.cc
|
| +++ b/content/browser/browser_shutdown_profile_dumper.cc
|
| @@ -29,14 +29,21 @@ BrowserShutdownProfileDumper::~BrowserShutdownProfileDumper() {
|
| WriteTracesToDisc();
|
| }
|
|
|
| +static float GetTraceBufferPercentFull() {
|
| + base::debug::TraceLog::BufferUsage buffer_usage =
|
| + base::debug::TraceLog::GetInstance()->GetBufferUsage();
|
| + return 100 *
|
| + static_cast<float>(static_cast<double>(buffer_usage.event_count) /
|
| + buffer_usage.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()) {
|
|
|