<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_output.c, branch v3.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-11-13T20:48:40Z</updated>
<entry>
<title>tracing: Format non-nanosec times from tsc clock without a decimal point.</title>
<updated>2012-11-13T20:48:40Z</updated>
<author>
<name>David Sharp</name>
<email>dhsharp@google.com</email>
</author>
<published>2012-11-13T20:18:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8be0709f10e3dd5d7d07933ad61a9f18c4b93ca5'/>
<id>urn:sha1:8be0709f10e3dd5d7d07933ad61a9f18c4b93ca5</id>
<content type='text'>
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 &gt; set_event
$ echo 1 &gt; tracing_on ; sleep 0.0005 ; echo 0 &gt; tracing_on
$ cat trace
          &lt;idle&gt;-0     [000]  6330.555552: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==&gt; 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 ==&gt; next_comm=swapper next_pid=0 next_prio=120
  ...
$ echo 1 &gt; options/latency-format
$ cat trace
  &lt;idle&gt;-0       0 4104553247us+: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==&gt; 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 ==&gt; next_comm=swapper next_pid=0 next_prio=120
  ...
$ echo tsc &gt; trace_clock
$ cat trace
$ echo 1 &gt; tracing_on ; sleep 0.0005 ; echo 0 &gt; tracing_on
$ echo 0 &gt; options/latency-format
$ cat trace
          &lt;idle&gt;-0     [000] 16490053398357: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==&gt; 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 ==&gt; next_comm=swapper next_pid=0 next_prio=120
  ...
echo 1 &gt; options/latency-format
$ cat trace
  &lt;idle&gt;-0       0 91557653238+: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==&gt; 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 ==&gt; 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 &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: David Sharp &lt;dhsharp@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Register the ftrace internal events during early boot</title>
<updated>2012-06-14T19:22:14Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-06-01T01:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7374e82771c6d5a9af2080be46f64a5826c7efb1'/>
<id>urn:sha1:7374e82771c6d5a9af2080be46f64a5826c7efb1</id>
<content type='text'>
All trace events including ftrace internel events (like trace_printk
and function tracing), register functions that describe how to print
their output. The events may be recorded as soon as the ring buffer
is allocated, but they are just raw binary in the buffer. The mapping
of event ids to how to print them are held within a structure that
is registered on system boot.

If a crash happens in boot up before these functions are registered
then their output (via ftrace_dump_on_oops) will be useless:

Dumping ftrace buffer:
---------------------------------
   &lt;...&gt;-1       0.... 319705us : Unknown type 6
---------------------------------

This can be quite frustrating for a kernel developer trying to see
what is going wrong.

There's no reason to register them so late in the boot up process.
They can be registered by early_initcall().

Reported-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix stacktrace of latency tracers (irqsoff and friends)</title>
<updated>2012-04-19T21:00:13Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-04-19T14:31:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=db4c75cbebd7e5910cd3bcb6790272fcc3042857'/>
<id>urn:sha1:db4c75cbebd7e5910cd3bcb6790272fcc3042857</id>
<content type='text'>
While debugging a latency with someone on IRC (mirage335) on #linux-rt (OFTC),
we discovered that the stacktrace output of the latency tracers
(preemptirqsoff) was empty.

This bug was caused by the creation of the dynamic length stack trace
again (like commit 12b5da3 "tracing: Fix ent_size in trace output" was).

This bug is caused by the latency tracers requiring the next event
to determine the time between the current event and the next. But by
grabbing the next event, the iter-&gt;ent_size is set to the next event
instead of the current one. As the stacktrace event is the last event,
this makes the ent_size zero and causes nothing to be printed for
the stack trace. The dynamic stacktrace uses the ent_size to determine
how much of the stack can be printed. The ent_size of zero means
no stack.

The simple fix is to save the iter-&gt;ent_size before finding the next event.

Note, mirage335 asked to remain anonymous from LKML and git, so I will
not add the Reported-by and Tested-by tags, even though he did report
the issue and tested the fix.

Cc: stable@vger.kernel.org # 3.1+
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2012-03-21T20:36:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-21T20:36:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2a0883e4071237d09b604a342c28b96b44a04b3'/>
<id>urn:sha1:e2a0883e4071237d09b604a342c28b96b44a04b3</id>
<content type='text'>
Pull vfs pile 1 from Al Viro:
 "This is _not_ all; in particular, Miklos' and Jan's stuff is not there
  yet."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits)
  ext4: initialization of ext4_li_mtx needs to be done earlier
  debugfs-related mode_t whack-a-mole
  hfsplus: add an ioctl to bless files
  hfsplus: change finder_info to u32
  hfsplus: initialise userflags
  qnx4: new helper - try_extent()
  qnx4: get rid of qnx4_bread/qnx4_getblk
  take removal of PF_FORKNOEXEC to flush_old_exec()
  trim includes in inode.c
  um: uml_dup_mmap() relies on -&gt;mmap_sem being held, but activate_mm() doesn't hold it
  um: embed -&gt;stub_pages[] into mmu_context
  gadgetfs: list_for_each_safe() misuse
  ocfs2: fix leaks on failure exits in module_init
  ecryptfs: make register_filesystem() the last potential failure exit
  ntfs: forgets to unregister sysctls on register_filesystem() failure
  logfs: missing cleanup on register_filesystem() failure
  jfs: mising cleanup on register_filesystem() failure
  make configfs_pin_fs() return root dentry on success
  configfs: configfs_create_dir() has parent dentry in dentry-&gt;d_parent
  configfs: sanitize configfs_create()
  ...
</content>
</entry>
<entry>
<title>constify path argument of trace_seq_path()</title>
<updated>2012-03-21T01:29:40Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-03-15T01:51:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=38eff2892628fa5c4fc8962a17b7296f42833ebe'/>
<id>urn:sha1:38eff2892628fa5c4fc8962a17b7296f42833ebe</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>tracing: Don't use p-&gt;len field to determine output in __print_*() functions</title>
<updated>2012-02-21T16:08:13Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2012-02-21T01:37:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5b34926114e39e12005031269613d2b13194aeba'/>
<id>urn:sha1:5b34926114e39e12005031269613d2b13194aeba</id>
<content type='text'>
If more than one __print_*() function is used in a tracepoint
(__print_flags(), __print_symbols(), etc), then the temp seq buffer will
not be zero on entry. Using the temp seq buffer's length to know if
data has been printed or not in the current function is incorrect and
may produce incorrect results.

Currently, no in-tree tracepoint causes this bug, but new ones may
be created.

Cc: Andrew Vagin &lt;avagin@openvz.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Don't print an extra separator of flags</title>
<updated>2012-02-21T01:33:31Z</updated>
<author>
<name>Andrey Vagin</name>
<email>avagin@openvz.org</email>
</author>
<published>2012-02-19T11:16:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e404b321dbb2d6e438522b7dce9c1d0c6a8c5275'/>
<id>urn:sha1:e404b321dbb2d6e438522b7dce9c1d0c6a8c5275</id>
<content type='text'>
If __print_flags() is used after another __print_*() function, the
temp seq_file buffer will not be empty on entry, and the delimiter will
be printed even though there's just one field. We get something like:

	|S

instead of just:

	S

This is because the length of the temp seq buffer is used to determine
if the delimiter is printed or not. But this algorithm fails when
the seq buffer is not empty on entry, and the delimiter will be printed
because it thinks that a previous field was already printed.

Link: http://lkml.kernel.org/r/1329650167-480655-1-git-send-email-avagin@openvz.org

Signed-off-by: Andrew Vagin &lt;avagin@openvz.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Add irq, preempt-count and need resched info to default trace output</title>
<updated>2011-11-17T14:58:48Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-11-17T14:34:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77271ce4b2c0df0a76ad1cbb6a95b07e1f88c1ea'/>
<id>urn:sha1:77271ce4b2c0df0a76ad1cbb6a95b07e1f88c1ea</id>
<content type='text'>
People keep asking how to get the preempt count, irq, and need resched info
and we keep telling them to enable the latency format. Some developers think
that traces without this info is completely useless, and for a lot of tasks
it is useless.

The first option was to enable the latency trace as the default format, but
the header for the latency format is pretty useless for most tracers and
it also does the timestamp in straight microseconds from the time the trace
started. This is sometimes more difficult to read as the default trace is
seconds from the start of boot up.

Latency format:

 # tracer: nop
 #
 # nop latency trace v1.1.5 on 3.2.0-rc1-test+
 # --------------------------------------------------------------------
 # latency: 0 us, #159771/64234230, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4)
 #    -----------------
 #    | task: -0 (uid:0 nice:0 policy:0 rt_prio:0)
 #    -----------------
 #
 #                  _------=&gt; CPU#
 #                 / _-----=&gt; irqs-off
 #                | / _----=&gt; need-resched
 #                || / _---=&gt; hardirq/softirq
 #                ||| / _--=&gt; preempt-depth
 #                |||| /     delay
 #  cmd     pid   ||||| time  |   caller
 #     \   /      |||||  \    |   /
 migratio-6       0...2 41778231us+: rcu_note_context_switch &lt;-__schedule
 migratio-6       0...2 41778233us : trace_rcu_utilization &lt;-rcu_note_context_switch
 migratio-6       0...2 41778235us+: rcu_sched_qs &lt;-rcu_note_context_switch
 migratio-6       0d..2 41778236us+: rcu_preempt_qs &lt;-rcu_note_context_switch
 migratio-6       0...2 41778238us : trace_rcu_utilization &lt;-rcu_note_context_switch
 migratio-6       0...2 41778239us+: debug_lockdep_rcu_enabled &lt;-__schedule

default format:

 # tracer: nop
 #
 #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
 #              | |       |          |         |
      migration/0-6     [000]    50.025810: rcu_note_context_switch &lt;-__schedule
      migration/0-6     [000]    50.025812: trace_rcu_utilization &lt;-rcu_note_context_switch
      migration/0-6     [000]    50.025813: rcu_sched_qs &lt;-rcu_note_context_switch
      migration/0-6     [000]    50.025815: rcu_preempt_qs &lt;-rcu_note_context_switch
      migration/0-6     [000]    50.025817: trace_rcu_utilization &lt;-rcu_note_context_switch
      migration/0-6     [000]    50.025818: debug_lockdep_rcu_enabled &lt;-__schedule
      migration/0-6     [000]    50.025820: debug_lockdep_rcu_enabled &lt;-__schedule

The latency format header has latency information that is pretty meaningless
for most tracers. Although some of the header is useful, and we can add that
later to the default format as well.

What is really useful with the latency format is the irqs-off, need-resched
hard/softirq context and the preempt count.

This commit adds the option irq-info which is on by default that adds this
information:

 # tracer: nop
 #
 #                              _-----=&gt; irqs-off
 #                             / _----=&gt; need-resched
 #                            | / _---=&gt; hardirq/softirq
 #                            || / _--=&gt; preempt-depth
 #                            ||| /     delay
 #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
 #              | |       |   ||||       |         |
           &lt;idle&gt;-0     [000] d..2    49.309305: cpuidle_get_driver &lt;-cpuidle_idle_call
           &lt;idle&gt;-0     [000] d..2    49.309307: mwait_idle &lt;-cpu_idle
           &lt;idle&gt;-0     [000] d..2    49.309309: need_resched &lt;-mwait_idle
           &lt;idle&gt;-0     [000] d..2    49.309310: test_ti_thread_flag &lt;-need_resched
           &lt;idle&gt;-0     [000] d..2    49.309312: trace_power_start.constprop.13 &lt;-mwait_idle
           &lt;idle&gt;-0     [000] d..2    49.309313: trace_cpu_idle &lt;-mwait_idle
           &lt;idle&gt;-0     [000] d..2    49.309315: need_resched &lt;-mwait_idle

If a user wants the old format, they can disable the 'irq-info' option:

 # tracer: nop
 #
 #           TASK-PID   CPU#      TIMESTAMP  FUNCTION
 #              | |       |          |         |
           &lt;idle&gt;-0     [000]     49.309305: cpuidle_get_driver &lt;-cpuidle_idle_call
           &lt;idle&gt;-0     [000]     49.309307: mwait_idle &lt;-cpu_idle
           &lt;idle&gt;-0     [000]     49.309309: need_resched &lt;-mwait_idle
           &lt;idle&gt;-0     [000]     49.309310: test_ti_thread_flag &lt;-need_resched
           &lt;idle&gt;-0     [000]     49.309312: trace_power_start.constprop.13 &lt;-mwait_idle
           &lt;idle&gt;-0     [000]     49.309313: trace_cpu_idle &lt;-mwait_idle
           &lt;idle&gt;-0     [000]     49.309315: need_resched &lt;-mwait_idle

Requested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Have dynamic size event stack traces</title>
<updated>2011-07-14T20:36:53Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-07-14T20:36:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4a9bd3f134decd6d16ead8d288342d57aad486be'/>
<id>urn:sha1:4a9bd3f134decd6d16ead8d288342d57aad486be</id>
<content type='text'>
Currently the stack trace per event in ftace is only 8 frames.
This can be quite limiting and sometimes useless. Especially when
the "ignore frames" is wrong and we also use up stack frames for
the event processing itself.

Change this to be dynamic by adding a percpu buffer that we can
write a large stack frame into and then copy into the ring buffer.

For interrupts and NMIs that come in while another event is being
process, will only get to use the 8 frame stack. That should be enough
as the task that it interrupted will have the full stack frame anyway.

Requested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Add __print_symbolic_u64 to avoid warnings on 32bit machine</title>
<updated>2011-05-26T02:13:44Z</updated>
<author>
<name>liubo</name>
<email>liubo2009@cn.fujitsu.com</email>
</author>
<published>2011-04-19T01:35:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2fc1b6f0d0a719e1e2a30bf076a3a799feaf6af2'/>
<id>urn:sha1:2fc1b6f0d0a719e1e2a30bf076a3a799feaf6af2</id>
<content type='text'>
Filesystem, like Btrfs, has some "ULL" macros, and when these macros are passed
to tracepoints'__print_symbolic(), there will be 64-&gt;32 truncate WARNINGS during
compiling on 32bit box.

Signed-off-by: Liu Bo &lt;liubo2009@cn.fujitsu.com&gt;
Link: http://lkml.kernel.org/r/4DACE6E0.7000507@cn.fujitsu.com
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
