kernel_optimize_test/arch
David Sharp 8be0709f10 tracing: Format non-nanosec times from tsc clock without a decimal point.
With the addition of the "tsc" clock, formatting timestamps to look like
fractional seconds is misleading. Mark clocks as either in nanoseconds or
not, and format non-nanosecond timestamps as decimal integers.

Tested:
$ cd /sys/kernel/debug/tracing/
$ cat trace_clock
[local] global tsc
$ echo sched_switch > set_event
$ echo 1 > tracing_on ; sleep 0.0005 ; echo 0 > tracing_on
$ cat trace
          <idle>-0     [000]  6330.555552: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=29964 next_prio=120
           sleep-29964 [000]  6330.555628: sched_switch: prev_comm=bash prev_pid=29964 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
  ...
$ echo 1 > options/latency-format
$ cat trace
  <idle>-0       0 4104553247us+: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=29964 next_prio=120
   sleep-29964   0 4104553322us+: sched_switch: prev_comm=bash prev_pid=29964 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
  ...
$ echo tsc > trace_clock
$ cat trace
$ echo 1 > tracing_on ; sleep 0.0005 ; echo 0 > tracing_on
$ echo 0 > options/latency-format
$ cat trace
          <idle>-0     [000] 16490053398357: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=31128 next_prio=120
           sleep-31128 [000] 16490053588518: sched_switch: prev_comm=bash prev_pid=31128 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
  ...
echo 1 > options/latency-format
$ cat trace
  <idle>-0       0 91557653238+: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=31128 next_prio=120
   sleep-31128   0 91557843399+: sched_switch: prev_comm=bash prev_pid=31128 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
  ...

v2:
Move arch-specific bits out of generic code.
v4:
Fix x86_32 build due to 64-bit division.

Google-Bug-Id: 6980623
Link: http://lkml.kernel.org/r/1352837903-32191-2-git-send-email-dhsharp@google.com

Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: David Sharp <dhsharp@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2012-11-13 15:48:40 -05:00
..
alpha tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
arm tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
arm64 tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
avr32 tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
blackfin tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
c6x tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
cris tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
frv tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
h8300 tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
hexagon tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
ia64 tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
m32r tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
m68k tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
microblaze tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
mips tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
mn10300 tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
openrisc tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
parisc tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
powerpc tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
s390 tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
score tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
sh tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
sparc tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
tile tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
um tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
unicore32 tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
x86 tracing: Format non-nanosec times from tsc clock without a decimal point. 2012-11-13 15:48:40 -05:00
xtensa tracing,x86: Add a TSC trace_clock 2012-11-13 15:48:27 -05:00
.gitignore
Kconfig Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux 2012-10-14 13:39:34 -07:00