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

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: remove unrelated change 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
« no previous file with comments | « 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..9d523bb4894ecb8466978721d70c675b814407d5 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,10 +92,20 @@ 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());
+ std::string number_of_fds =
+ base::StringPrintf("%d", process_metrics->GetOpenFdCount());
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.";
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698