• erikchen's avatar
    Implement native event observer for linux. · 17a922fb
    erikchen authored
    This CL uses ui::PlatformEventSource observer API to hook into pre and post
    native event dispatch on Linux.
    
    Timestamps for X11 events are in X11 server time. The implementation makes a
    round-trip to the X11 server to obtain a delta, and then uses that delta with
    base::TimeTicks::Now() to convert to a base::TimeTicks.
    
    The overhead from the rount-trip seems reasonable. 99th percentile X11 RTT is
    3ms. 99.9th percentile is 16ms. 99.99th percentile is 40ms. These include the
    time for syscalls to base::TimeTicks::Now().
    
    To further reduce overhead, this CL changes the UMA metric to only be computed
    with 1/1000 frequency, to avoid two calls to base::TimeTicks::Now().
    
    Note: The implementation of native event observer will be turned on via Finch
    experiment to measure overhead.
    
    Change-Id: I786537f093e862a7a19630c9150606a2eb8267d9
    Bug: 859155
    Reviewed-on: https://chromium-review.googlesource.com/1162658Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
    Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
    Commit-Queue: Erik Chen <erikchen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#581304}
    17a922fb
native_event_observer.h 2.97 KB