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

Unified Diff: ui/ozone/platform/drm/gpu/drm_device.cc

Issue 2593513002: Add page flip completion event to trace on CrOS (Closed)
Patch Set: Created 4 years 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 | « AUTHORS ('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/gpu/drm_device.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_device.cc b/ui/ozone/platform/drm/gpu/drm_device.cc
index 03ac08417b654c485fa12c3dcd8168074ce09862..54a1c3057909fcc96fa8a88b24f08613fd89ce26 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -19,6 +19,7 @@
#include "base/task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
+#include "base/trace_event/trace_event_argument.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "ui/display/types/gamma_ramp_rgb_entry.h"
#include "ui/ozone/platform/drm/common/drm_util.h"
@@ -91,6 +92,14 @@ bool ProcessDrmEvent(int fd, const DrmEventHandler& callback) {
DCHECK_LE(static_cast<int>(sizeof(drm_event_vblank)), len - idx);
drm_event_vblank vblank;
memcpy(&vblank, &buffer[idx], sizeof(vblank));
+ std::unique_ptr<base::trace_event::TracedValue> drm_data(
+ new base::trace_event::TracedValue());
+ drm_data->SetInteger("frame_count", 1);
+ drm_data->SetInteger("vblank.tv_sec", vblank.tv_sec);
+ drm_data->SetInteger("vblank.tv_usec", vblank.tv_usec);
+ TRACE_EVENT_INSTANT1("benchmark,drm", "DrmEventFlipComplete",
+ TRACE_EVENT_SCOPE_THREAD, "data",
+ std::move(drm_data));
callback.Run(vblank.sequence, vblank.tv_sec, vblank.tv_usec,
vblank.user_data);
} break;
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698