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

Unified Diff: ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc

Issue 2725813005: ozone: drm: Add fd number to crash keys when dmabuf mmap fails. (Closed)
Patch Set: ozone: drm: Add fd number to crash keys when dmabuf mmap fails. Created 3 years, 10 months 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
« chrome/common/crash_keys.cc ('K') | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
}
}
« chrome/common/crash_keys.cc ('K') | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698