CHROMIUM: Add CLOCK_SYSTEM_TRACE to export the trace clock to user space.
authorSam Leffler <sleffler@chromium.org>
Thu, 26 Apr 2012 23:54:35 +0000 (16:54 -0700)
committerOlof Johansson <olof@lixom.net>
Fri, 1 Jun 2012 06:55:00 +0000 (23:55 -0700)
commit46b9cb0cc80c1ddaceb7d9026908948362574009
treeb77730dc0b270f4bb625fa03da333139711bebc4
parentfcb66d76a59dbb3440caa7365415e872eab37fe3
CHROMIUM: Add CLOCK_SYSTEM_TRACE to export the trace clock to user space.

Add a new clock type CLOCK_SYSTEM_TRACE to retrieve the current trace
clock value (if CONFIG_TRACING is not defined then CLOCK_SYSTEM_TRACE
returns the same value as CLOCK_MONOTONIC_RAW).  This allows user event
tracing to timestamp data with the same clock as the kernel.  This is
in-lieu of sending event data through trace_write (which is not a viable
option when there are lots of user-space events).

BUG=chromium-os:27809
TEST=manual:run test app to collect trace time and compare to data generated by the system (e.g. reading from trace)

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: If2167ed99291e05f8c298638f4118b10b3e710f8
Reviewed-on: https://gerrit.chromium.org/gerrit/21404
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
include/linux/kernel.h
include/linux/time.h
kernel/posix-timers.c
kernel/trace/trace.c