OSDN Git Service

atrace: don't use sendfile.
authorJosh Gao <jmgao@google.com>
Tue, 11 Apr 2017 22:21:13 +0000 (15:21 -0700)
committerJosh Gao <jmgao@google.com>
Tue, 11 Apr 2017 22:32:07 +0000 (15:32 -0700)
commitd3d36e71f274a1f6df1eb77db5a6abfb12035c75
treefcdb2cf5f8fe42ab7dbfdb858b0ca3d2121d80b1
parentb7003ce5d41a014a32a81995c1e4e9f6f4c237bd
atrace: don't use sendfile.

sendfile appears to have horrendous performance when used with the
ftrace output file, being up to 100x slower than the naive read/write
loop.

Switch to doing that instead, speeding up atrace from:

    $ atrace --async_start sched freq; sleep 1; time atrace --async_stop > dummy
    c apturing trace...    0m08.93s real     0m00.08s user     0m07.98s system

to:

    $ atrace --async_start sched freq; sleep 1; time atrace --async_stop > dummy
    capturing trace...    0m00.78s real     0m00.07s user     0m00.21s system

Bug: http://b/37164190
Test: atrace --async_start sched freq; sleep 1; time atrace --async_stop > dummy
Change-Id: I22fe1871e263867f9ac54c8f5b474df824b4bc69
cmds/atrace/atrace.cpp