summaryrefslogtreecommitdiffstats
path: root/ui/events/latency_info.h
diff options
context:
space:
mode:
authormiletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-11 03:32:38 +0000
committermiletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-11 03:32:38 +0000
commit70a03cc2c0b9debfc491412e9eeafe85e42ff758 (patch)
tree9f027b71392aae235550b72d30ac624e9f8104dd /ui/events/latency_info.h
parentefd37ff98539ec2e13e45cf72f7688629af66cc0 (diff)
downloadchromium_src-70a03cc2c0b9debfc491412e9eeafe85e42ff758.zip
chromium_src-70a03cc2c0b9debfc491412e9eeafe85e42ff758.tar.gz
chromium_src-70a03cc2c0b9debfc491412e9eeafe85e42ff758.tar.bz2
Report LatencyInfo through trace buffer
This CL is the first step in converting to use trace event to collect LatencyInfo. Changes are: 1. Each LatencyInfo will have at most one BEGIN/TERMINATED component. When the BEGIN component is added, an ASYNC_BEGIN trace event is issued. When the TERMINATED component is added, an ASYNC_END trace event is issued, and the LatencyInfo is dumped into the trace buffer. 2. BEGIN component is added to event's LatencyInfo when the event reaches RWH. 3. If events cause renderering to be schedueld in renderer, then the INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT is added when actual frame swap happens. Accordingly, swap_timestamp_ is removed. 4. If events do not cause rendering to be scheduled in renderer, then 4.1) INPUT_EVENT_LATENCY_TERMINATED_MOUSE/GESTURE_COMPONENT is added when the mouse/gesture events are acked from renderer. 4.2) If the acked touch event become gesture event, touch event's LatencInfo are copied into gesture event's LatencyInfo. 4.3) If the acked touch event does not become gesture event, INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT is then added to the touch event's LatencyInfo. This CL is only adding the ability to dump LatencyInfo to trace buffer but don't change the current way LatencyInfo is used so all the telemetry tests are not affected. The complete migration will be in followup CLs. BUG=BUG=246034 TEST=1. telemetry smoothness test still works. 2. Do trace recording with category "benchmark", check that latencyinfo are dumped to "InputLatency"; Review URL: https://codereview.chromium.org/25022003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/events/latency_info.h')
-rw-r--r--ui/events/latency_info.h38
1 files changed, 30 insertions, 8 deletions
diff --git a/ui/events/latency_info.h b/ui/events/latency_info.h
index 8bf5610..d1e6f75 100644
--- a/ui/events/latency_info.h
+++ b/ui/events/latency_info.h
@@ -15,8 +15,11 @@
namespace ui {
enum LatencyComponentType {
+ // ---------------------------BEGIN COMPONENT-------------------------------
+ // BEGIN COMPONENT is when we show the latency begin in chrome://tracing.
// Timestamp when the input event is sent from RenderWidgetHost to renderer.
- INPUT_EVENT_LATENCY_RWH_COMPONENT,
+ INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
+ // ---------------------------NORMAL COMPONENT-------------------------------
// Timestamp when the scroll update gesture event is sent from RWH to
// renderer. In Aura, touch event's LatencyInfo is carried over to the gesture
// event. So gesture event's INPUT_EVENT_LATENCY_RWH_COMPONENT is the
@@ -30,9 +33,25 @@ enum LatencyComponentType {
INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
// Timestamp when the UI event is created.
INPUT_EVENT_LATENCY_UI_COMPONENT,
- // Timestamp when the event is acked from renderer. This is currently set
- // only for touch events.
- INPUT_EVENT_LATENCY_ACKED_COMPONENT
+ // This is special component indicating there is rendering scheduled for
+ // the event associated with this LatencyInfo.
+ INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT,
+ // Timestamp when the touch event is acked.
+ INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT,
+ // ---------------------------TERMINAL COMPONENT-----------------------------
+ // TERMINAL COMPONENT is when we show the latency end in chrome://tracing.
+ // Timestamp when the mouse event is acked from renderer and it does not
+ // cause any rendering scheduled.
+ INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT,
+ // Timestamp when the touch event is acked from renderer and it does not
+ // cause any rendering schedueld and does not generate any gesture event.
+ INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT,
+ // Timestamp when the gesture event is acked from renderer, and it does not
+ // cause any rendering schedueld.
+ INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT,
+ // Timestamp when the frame is swapped (i.e. when the rendering caused by
+ // input event actually takes effect).
+ INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT,
};
struct EVENTS_EXPORT LatencyInfo {
@@ -70,11 +89,13 @@ struct EVENTS_EXPORT LatencyInfo {
// Modifies the current sequence number and adds a certain number of events
// for a specific component.
+ // TODO(miletus): Remove the |dump_to_trace| once we remove MergeWith().
void AddLatencyNumberWithTimestamp(LatencyComponentType component,
int64 id,
int64 component_sequence_number,
base::TimeTicks time,
- uint32 event_count);
+ uint32 event_count,
+ bool dump_to_trace);
// Returns true if the a component with |type| and |id| is found in
// the latency_components and the component is stored to |output| if
@@ -86,9 +107,10 @@ struct EVENTS_EXPORT LatencyInfo {
void Clear();
LatencyMap latency_components;
-
- // This represents the final time that a frame is displayed it.
- base::TimeTicks swap_timestamp;
+ // The unique id for matching the ASYNC_BEGIN/END trace event.
+ int64 trace_id;
+ // Whether a terminal component has been added.
+ bool terminated;
};
} // namespace ui