Commit c4363d1c authored by spang's avatar spang Committed by Commit bot

ozone: evdev: Add a couple more trace events

Add trace event inside each read notification for evdev.

BUG=none
TEST=chrome://tracing in link_freon

Review URL: https://codereview.chromium.org/1110693003

Cr-Commit-Position: refs/heads/master@{#327110}
parent 4b536b91
......@@ -7,6 +7,7 @@
#include <errno.h>
#include <linux/input.h>
#include "base/trace_event/trace_event.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/dom4/keycode_converter.h"
......@@ -53,6 +54,9 @@ EventConverterEvdevImpl::~EventConverterEvdevImpl() {
}
void EventConverterEvdevImpl::OnFileCanReadWithoutBlocking(int fd) {
TRACE_EVENT1("evdev", "EventConverterEvdevImpl::OnFileCanReadWithoutBlocking",
"fd", fd);
input_event inputs[4];
ssize_t read_size = read(fd, inputs, sizeof(inputs));
if (read_size < 0) {
......
......@@ -11,6 +11,7 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
namespace ui {
......@@ -70,6 +71,9 @@ EventReaderLibevdevCros::~EventReaderLibevdevCros() {
EventReaderLibevdevCros::Delegate::~Delegate() {}
void EventReaderLibevdevCros::OnFileCanReadWithoutBlocking(int fd) {
TRACE_EVENT1("evdev", "EventReaderLibevdevCros::OnFileCanReadWithoutBlocking",
"fd", fd);
if (EvdevRead(&evdev_)) {
if (errno == EINTR || errno == EAGAIN)
return;
......
......@@ -8,6 +8,7 @@
#include <linux/input.h>
#include "base/message_loop/message_loop.h"
#include "base/trace_event/trace_event.h"
#include "ui/events/event.h"
#include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h"
......@@ -44,6 +45,10 @@ TabletEventConverterEvdev::~TabletEventConverterEvdev() {
}
void TabletEventConverterEvdev::OnFileCanReadWithoutBlocking(int fd) {
TRACE_EVENT1("evdev",
"TabletEventConverterEvdev::OnFileCanReadWithoutBlocking", "fd",
fd);
input_event inputs[4];
ssize_t read_size = read(fd, inputs, sizeof(inputs));
if (read_size < 0) {
......
......@@ -23,6 +23,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/devices/device_util_linux.h"
#include "ui/events/event.h"
......@@ -214,6 +215,10 @@ void TouchEventConverterEvdev::OnStopped() {
}
void TouchEventConverterEvdev::OnFileCanReadWithoutBlocking(int fd) {
TRACE_EVENT1("evdev",
"TouchEventConverterEvdev::OnFileCanReadWithoutBlocking", "fd",
fd);
input_event inputs[kNumTouchEvdevSlots * 6 + 1];
ssize_t read_size = read(fd, inputs, sizeof(inputs));
if (read_size < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment