<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_events_trigger.c, branch v4.5</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=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-01-13T04:04:15Z</updated>
<entry>
<title>Merge tag 'trace-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace</title>
<updated>2016-01-13T04:04:15Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-01-13T04:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c17488d06666153a14dd3f21bd10eba58383f6c1'/>
<id>urn:sha1:c17488d06666153a14dd3f21bd10eba58383f6c1</id>
<content type='text'>
Pull tracing updates from Steven Rostedt:
 "Not much new with tracing for this release.  Mostly just clean ups and
  minor fixes.

  Here's what else is new:

   - A new TRACE_EVENT_FN_COND macro, combining both _FN and _COND for
     those that want both.

   - New selftest to test the instance create and delete

   - Better debug output when ftrace fails"

* tag 'trace-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (24 commits)
  ftrace: Fix the race between ftrace and insmod
  ftrace: Add infrastructure for delayed enabling of module functions
  x86: ftrace: Fix the comments for ftrace_modify_code_direct()
  tracing: Fix comment to use tracing_on over tracing_enable
  metag: ftrace: Fix the comments for ftrace_modify_code
  sh: ftrace: Fix the comments for ftrace_modify_code()
  ia64: ftrace: Fix the comments for ftrace_modify_code()
  ftrace: Clean up ftrace_module_init() code
  ftrace: Join functions ftrace_module_init() and ftrace_init_module()
  tracing: Introduce TRACE_EVENT_FN_COND macro
  tracing: Use seq_buf_used() in seq_buf_to_user() instead of len
  bpf: Constify bpf_verifier_ops structure
  ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too
  ftrace: Remove use of control list and ops
  ftrace: Fix output of enabled_functions for showing tramp
  ftrace: Fix a typo in comment
  ftrace: Show all tramps registered to a record on ftrace_bug()
  ftrace: Add variable ftrace_expected for archs to show expected code
  ftrace: Add new type to distinguish what kind of ftrace_bug()
  tracing: Update cond flag when enabling or disabling a trigger
  ...
</content>
</entry>
<entry>
<title>kernel/*: switch to memdup_user_nul()</title>
<updated>2016-01-04T15:27:55Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-12-24T05:13:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=70f6cbb6f9c95535acd327d1ac1ce5fd078cff1e'/>
<id>urn:sha1:70f6cbb6f9c95535acd327d1ac1ce5fd078cff1e</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>tracing: Update cond flag when enabling or disabling a trigger</title>
<updated>2015-11-25T20:24:14Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tom.zanussi@linux.intel.com</email>
</author>
<published>2015-11-23T19:51:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e4a4d75700da67c1209c151d5f11a309c3b8367'/>
<id>urn:sha1:4e4a4d75700da67c1209c151d5f11a309c3b8367</id>
<content type='text'>
When a trigger is enabled, the cond flag should be set beforehand,
otherwise a trigger that's expecting to process a trace record
(e.g. one with post_trigger set) could be invoked without one.

Likewise a trigger's cond flag should be reset after it's disabled,
not before.

Link: http://lkml.kernel.org/r/a420b52a67b1c2d3cab017914362d153255acb99.1448303214.git.tom.zanussi@linux.intel.com

Signed-off-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Signed-off-by: Daniel Wagner &lt;daniel.wagner@bmw-carit.de&gt;
Reviewed-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Reviewed-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Tested-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Rename ftrace_raw_##call event structures to trace_event_raw_##call</title>
<updated>2015-05-14T01:48:40Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-05-13T19:27:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a7237765730a10d429736f47ac4b89779ec6c534'/>
<id>urn:sha1:a7237765730a10d429736f47ac4b89779ec6c534</id>
<content type='text'>
The name "ftrace" really refers to the function hook infrastructure. It
is not about the trace_events. The ftrace_raw_##call structures are built
by macros for trace events. They have nothing to do with function tracing.
Rename them.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Rename FTRACE_EVENT_FL_* flags to EVENT_FILE_FL_*</title>
<updated>2015-05-13T19:24:57Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-05-13T19:12:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d6ad960a71f0b36d95d74ef93285733b9f62f59'/>
<id>urn:sha1:5d6ad960a71f0b36d95d74ef93285733b9f62f59</id>
<content type='text'>
The name "ftrace" really refers to the function hook infrastructure. It
is not about the trace_events. The FTRACE_EVENT_FL_* flags are flags to
do with the trace_event files in the tracefs directory. They are not related
to function tracing. Rename them to a more descriptive name.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Rename ftrace_event_name() to trace_event_name()</title>
<updated>2015-05-13T18:20:14Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-05-13T18:20:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=687fcc4aee4567df14e31e82d6993418b826f408'/>
<id>urn:sha1:687fcc4aee4567df14e31e82d6993418b826f408</id>
<content type='text'>
The name "ftrace" really refers to the function hook infrastructure. It
is not about the trace_events. ftrace_event_name() returns the name of
an event tracepoint, has nothing to do with function tracing. Rename it
to trace_event_name().

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Rename ftrace_event_file to trace_event_file</title>
<updated>2015-05-13T18:05:16Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-05-05T14:09:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f1d2f8210195c8c309d424a77dbf06a6d2186f4'/>
<id>urn:sha1:7f1d2f8210195c8c309d424a77dbf06a6d2186f4</id>
<content type='text'>
The name "ftrace" really refers to the function hook infrastructure. It
is not about the trace_events. The structure ftrace_event_file is really
about trace events and not "ftrace". Rename it to trace_event_file.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>trace: Replace single-character seq_puts with seq_putc</title>
<updated>2014-11-14T12:55:55Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-11-08T20:42:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1177e4364154a00baf2c9eb72fd960f0c5a8de84'/>
<id>urn:sha1:1177e4364154a00baf2c9eb72fd960f0c5a8de84</id>
<content type='text'>
Printing a single character to a seqfile might as well be done with
seq_putc instead of seq_puts; this avoids a strlen() call and a memory
access. It also shaves another few bytes off the generated code.

Link: http://lkml.kernel.org/r/1415479332-25944-4-git-send-email-linux@rasmusvillemoes.dk

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Replace seq_printf by simpler equivalents</title>
<updated>2014-11-14T02:32:19Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-11-08T20:42:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fa6f0cc751d377af3f4f1484bceb47dc10163753'/>
<id>urn:sha1:fa6f0cc751d377af3f4f1484bceb47dc10163753</id>
<content type='text'>
Using seq_printf to print a simple string or a single character is a
lot more expensive than it needs to be, since seq_puts and seq_putc
exist.

These patches do

  seq_printf(m, s) -&gt; seq_puts(m, s)
  seq_printf(m, "%s", s) -&gt; seq_puts(m, s)
  seq_printf(m, "%c", c) -&gt; seq_putc(m, c)

Subsequent patches will simplify further.

Link: http://lkml.kernel.org/r/1415479332-25944-2-git-send-email-linux@rasmusvillemoes.dk

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Use rcu_dereference_sched() for trace event triggers</title>
<updated>2014-05-03T03:12:42Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2014-05-02T17:30:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=561a4fe851ccab9dd0d14989ab566f9392d9f8b5'/>
<id>urn:sha1:561a4fe851ccab9dd0d14989ab566f9392d9f8b5</id>
<content type='text'>
As trace event triggers are now part of the mainline kernel, I added
my trace event trigger tests to my test suite I run on all my kernels.
Now these tests get run under different config options, and one of
those options is CONFIG_PROVE_RCU, which checks under lockdep that
the rcu locking primitives are being used correctly. This triggered
the following splat:

===============================
[ INFO: suspicious RCU usage. ]
3.15.0-rc2-test+ #11 Not tainted
-------------------------------
kernel/trace/trace_events_trigger.c:80 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
4 locks held by swapper/1/0:
 #0:  ((&amp;(&amp;j_cdbs-&gt;work)-&gt;timer)){..-...}, at: [&lt;ffffffff8104d2cc&gt;] call_timer_fn+0x5/0x1be
 #1:  (&amp;(&amp;pool-&gt;lock)-&gt;rlock){-.-...}, at: [&lt;ffffffff81059856&gt;] __queue_work+0x140/0x283
 #2:  (&amp;p-&gt;pi_lock){-.-.-.}, at: [&lt;ffffffff8106e961&gt;] try_to_wake_up+0x2e/0x1e8
 #3:  (&amp;rq-&gt;lock){-.-.-.}, at: [&lt;ffffffff8106ead3&gt;] try_to_wake_up+0x1a0/0x1e8

stack backtrace:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.15.0-rc2-test+ #11
Hardware name:                  /DG965MQ, BIOS MQ96510J.86A.0372.2006.0605.1717 06/05/2006
 0000000000000001 ffff88007e083b98 ffffffff819f53a5 0000000000000006
 ffff88007b0942c0 ffff88007e083bc8 ffffffff81081307 ffff88007ad96d20
 0000000000000000 ffff88007af2d840 ffff88007b2e701c ffff88007e083c18
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff819f53a5&gt;] dump_stack+0x4f/0x7c
 [&lt;ffffffff81081307&gt;] lockdep_rcu_suspicious+0x107/0x110
 [&lt;ffffffff810ee51c&gt;] event_triggers_call+0x99/0x108
 [&lt;ffffffff810e8174&gt;] ftrace_event_buffer_commit+0x42/0xa4
 [&lt;ffffffff8106aadc&gt;] ftrace_raw_event_sched_wakeup_template+0x71/0x7c
 [&lt;ffffffff8106bcbf&gt;] ttwu_do_wakeup+0x7f/0xff
 [&lt;ffffffff8106bd9b&gt;] ttwu_do_activate.constprop.126+0x5c/0x61
 [&lt;ffffffff8106eadf&gt;] try_to_wake_up+0x1ac/0x1e8
 [&lt;ffffffff8106eb77&gt;] wake_up_process+0x36/0x3b
 [&lt;ffffffff810575cc&gt;] wake_up_worker+0x24/0x26
 [&lt;ffffffff810578bc&gt;] insert_work+0x5c/0x65
 [&lt;ffffffff81059982&gt;] __queue_work+0x26c/0x283
 [&lt;ffffffff81059999&gt;] ? __queue_work+0x283/0x283
 [&lt;ffffffff810599b7&gt;] delayed_work_timer_fn+0x1e/0x20
 [&lt;ffffffff8104d3a6&gt;] call_timer_fn+0xdf/0x1be^M
 [&lt;ffffffff8104d2cc&gt;] ? call_timer_fn+0x5/0x1be
 [&lt;ffffffff81059999&gt;] ? __queue_work+0x283/0x283
 [&lt;ffffffff8104d823&gt;] run_timer_softirq+0x1a4/0x22f^M
 [&lt;ffffffff8104696d&gt;] __do_softirq+0x17b/0x31b^M
 [&lt;ffffffff81046d03&gt;] irq_exit+0x42/0x97
 [&lt;ffffffff81a08db6&gt;] smp_apic_timer_interrupt+0x37/0x44
 [&lt;ffffffff81a07a2f&gt;] apic_timer_interrupt+0x6f/0x80
 &lt;EOI&gt;  [&lt;ffffffff8100a5d8&gt;] ? default_idle+0x21/0x32
 [&lt;ffffffff8100a5d6&gt;] ? default_idle+0x1f/0x32
 [&lt;ffffffff8100ac10&gt;] arch_cpu_idle+0xf/0x11
 [&lt;ffffffff8107b3a4&gt;] cpu_startup_entry+0x1a3/0x213
 [&lt;ffffffff8102a23c&gt;] start_secondary+0x212/0x219

The cause is that the triggers are protected by rcu_read_lock_sched() but
the data is dereferenced with rcu_dereference() which expects it to
be protected with rcu_read_lock(). The proper reference should be
rcu_dereference_sched().

Cc: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
