Chromium Code Reviews| Index: ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc |
| diff --git a/ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc b/ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc |
| index faee338dfcefe5bbde68332aa67b8db90c1b8676..634464a81adf2829f924c7187d81d071c90f241f 100644 |
| --- a/ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc |
| +++ b/ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/debug/crash_logging.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/process/memory.h" |
| +#include "base/process/process_metrics.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/trace_event/trace_event.h" |
| @@ -91,13 +92,24 @@ ClientNativePixmapDmaBuf::ClientNativePixmapDmaBuf( |
| "(addr=nullptr, length=%zu, prot=(PROT_READ | PROT_WRITE), " |
| "flags=MAP_SHARED, fd=%d[valid=%d], offset=0)", |
| map_size, dmabuf_fd_.get(), fd_valid); |
| + std::string errno_str = logging::SystemErrorCodeToString(mmap_error); |
| + std::unique_ptr<base::ProcessMetrics> process_metrics( |
| + base::ProcessMetrics::CreateCurrentProcessMetrics()); |
|
Daniele Castagna
2017/03/02 02:05:04
CreateCurrentProcessMetrics calls base::GetCurrent
dshwang
2017/03/02 19:59:31
That's good point. By the way, it's base::GetCurre
Daniele Castagna
2017/03/02 20:08:52
Are you sure this works in the GPU process and the
dshwang
2017/03/02 20:15:12
I run this code in chromeos, and it works in only
|
| + std::string number_of_fds = |
| + base::StringPrintf("%d", process_metrics->GetOpenFdCount()); |
|
Daniele Castagna
2017/03/02 02:05:04
This would report -1 in case we're out of fds sinc
dshwang
2017/03/02 19:59:31
OH, that's good point. I didn't think about it. Fo
Daniele Castagna
2017/03/02 20:08:52
We were thinking of addding a UMA stat for openfds
dshwang
2017/03/02 20:15:12
good to know. do you want to wait for UMA stat cha
|
| base::debug::ScopedCrashKey params_crash_key("mmap_params", mmap_params); |
| base::debug::ScopedCrashKey size_crash_key("buffer_size", size.ToString()); |
| - base::debug::ScopedCrashKey errno_crash_key( |
| - "errno", logging::SystemErrorCodeToString(mmap_error)); |
| + base::debug::ScopedCrashKey errno_crash_key("errno", errno_str); |
| + base::debug::ScopedCrashKey number_of_fds_crash_key("number_of_fds", |
| + number_of_fds); |
| + LOG(ERROR) << "Failed to mmap dmabuf; mmap_params: " << mmap_params |
| + << ", buffer_size: (" << size.ToString() |
| + << "), errno: " << errno_str |
| + << " , number_of_fds: " << number_of_fds; |
| if (mmap_error == ENOMEM) |
| base::TerminateBecauseOutOfMemory(map_size); |
| - CHECK(false) << "Failed to mmap dmabuf."; |
| + CHECK(false); |
| + ; |
|
Daniele Castagna
2017/03/02 02:05:04
Why did you remove a useful log and just left a fl
dshwang
2017/03/02 19:59:31
Done.
|
| } |
| } |