perf: Add ioctl to return current time value

To co-relate user space events with the perf events stream
a current (as in: "what time(stamp) is it now?") time value
must be made available.

This patch adds a perf ioctl that makes this possible.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
perf header: move perf_header__getbuffer64 up in header.c

Needed in next patch. Code move only.

Signed-off-by: David Ahern <dsahern@gmail.com>
perf: add reference time as feature in header

Adds perf_clock to time-of-day references to env in the header.
Adds the infrastructure within header.c to write out the reference
times and read them back.

Signed-off-by: David Ahern <dsahern@gmail.com>
perf session: add method for creating perf_clock to tod reference

Uses the ioctl to get a perf_clock timestamp.

Signed-off-by: David Ahern <dsahern@gmail.com>
perf record: add time-of-day option

When added to perf-record calls the perf-session method to get a
perf_clock to time-of-day reference.

Signed-off-by: David Ahern <dsahern@gmail.com>
perf script: add time-of-day option for displaying events

Leverages reference time stored in session header to convert perf_clock
timestamps to time-of-day. Default format is %H:%M:%S and the format can
be changed via the --tod argument to any string recognized by strftime.

This version does *not* use any tracepoints to keep the correlation
between perf_clock and time-of-day up to date.

Signed-off-by: David Ahern <dsahern@gmail.com>