<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace.c, branch v3.12</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.12</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.12'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-08-22T16:45:24Z</updated>
<entry>
<title>tracing: Make tracing_cpumask available for all instances</title>
<updated>2013-08-22T16:45:24Z</updated>
<author>
<name>Alexander Z Lam</name>
<email>azl@google.com</email>
</author>
<published>2013-08-08T16:47:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ccfe9e42e451232dd17a230d1b4e979c3d15311e'/>
<id>urn:sha1:ccfe9e42e451232dd17a230d1b4e979c3d15311e</id>
<content type='text'>
Allow tracer instances to disable tracing by cpu by moving
the static global tracing_cpumask into trace_array.

Link: http://lkml.kernel.org/r/921622317f239bfc2283cac2242647801ef584f2.1375980149.git.azl@google.com

Cc: Vaibhav Nagarnaik &lt;vnagarnaik@google.com&gt;
Cc: David Sharp &lt;dhsharp@google.com&gt;
Cc: Alexander Z Lam &lt;lambchop468@gmail.com&gt;
Signed-off-by: Alexander Z Lam &lt;azl@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix reset of time stamps during trace_clock changes</title>
<updated>2013-08-03T02:40:09Z</updated>
<author>
<name>Alexander Z Lam</name>
<email>azl@google.com</email>
</author>
<published>2013-08-03T01:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9457158bbc0ee04ecef76862d73eecd8076e9c7b'/>
<id>urn:sha1:9457158bbc0ee04ecef76862d73eecd8076e9c7b</id>
<content type='text'>
Fixed two issues with changing the timestamp clock with trace_clock:

 - The global buffer was reset on instance clock changes. Change this to pass
   the correct per-instance buffer
 - ftrace_now() is used to set buf-&gt;time_start in tracing_reset_online_cpus().
   This was incorrect because ftrace_now() used the global buffer's clock to
   return the current time. Change this to use buffer_ftrace_now() which
   returns the current time for the correct per-instance buffer.

Also removed tracing_reset_current() because it is not used anywhere

Link: http://lkml.kernel.org/r/1375493777-17261-2-git-send-email-azl@google.com

Cc: Vaibhav Nagarnaik &lt;vnagarnaik@google.com&gt;
Cc: David Sharp &lt;dhsharp@google.com&gt;
Cc: Alexander Z Lam &lt;lambchop468@gmail.com&gt;
Cc: stable@vger.kernel.org # 3.10
Signed-off-by: Alexander Z Lam &lt;azl@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Make TRACE_ITER_STOP_ON_FREE stop the correct buffer</title>
<updated>2013-08-03T02:39:29Z</updated>
<author>
<name>Alexander Z Lam</name>
<email>azl@google.com</email>
</author>
<published>2013-08-03T01:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=711e124379e0f889e40e2f01d7f5d61936d3cd23'/>
<id>urn:sha1:711e124379e0f889e40e2f01d7f5d61936d3cd23</id>
<content type='text'>
Releasing the free_buffer file in an instance causes the global buffer
to be stopped when TRACE_ITER_STOP_ON_FREE is enabled. Operate on the
correct buffer.

Link: http://lkml.kernel.org/r/1375493777-17261-1-git-send-email-azl@google.com

Cc: Vaibhav Nagarnaik &lt;vnagarnaik@google.com&gt;
Cc: David Sharp &lt;dhsharp@google.com&gt;
Cc: Alexander Z Lam &lt;lambchop468@gmail.com&gt;
Cc: stable@vger.kernel.org # 3.10
Signed-off-by: Alexander Z Lam &lt;azl@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix fields of struct trace_iterator that are zeroed by mistake</title>
<updated>2013-08-03T02:28:41Z</updated>
<author>
<name>Andrew Vagin</name>
<email>avagin@openvz.org</email>
</author>
<published>2013-08-02T17:16:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ed5467da0e369e65b247b99eb6403cb79172bcda'/>
<id>urn:sha1:ed5467da0e369e65b247b99eb6403cb79172bcda</id>
<content type='text'>
tracing_read_pipe zeros all fields bellow "seq". The declaration contains
a comment about that, but it doesn't help.

The first field is "snapshot", it's true when current open file is
snapshot. Looks obvious, that it should not be zeroed.

The second field is "started". It was converted from cpumask_t to
cpumask_var_t (v2.6.28-4983-g4462344), in other words it was
converted from cpumask to pointer on cpumask.

Currently the reference on "started" memory is lost after the first read
from tracing_read_pipe and a proper object will never be freed.

The "started" is never dereferenced for trace_pipe, because trace_pipe
can't have the TRACE_FILE_ANNOTATE options.

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

Cc: stable@vger.kernel.org # 2.6.30
Signed-off-by: Andrew Vagin &lt;avagin@openvz.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()</title>
<updated>2013-07-26T12:57:32Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-07-24T02:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=09d8091c024ec88d1541d93eb8ddb2bd5cf10c39'/>
<id>urn:sha1:09d8091c024ec88d1541d93eb8ddb2bd5cf10c39</id>
<content type='text'>
Commit a82274151af "tracing: Protect ftrace_trace_arrays list in trace_events.c"
added taking the trace_types_lock mutex in trace_events.c as there were
several locations that needed it for protection. Unfortunately, it also
encapsulated a call to tracing_reset_all_online_cpus() which also takes
the trace_types_lock, causing a deadlock.

This happens when a module has tracepoints and has been traced. When the
module is removed, the trace events module notifier will grab the
trace_types_lock, do a bunch of clean ups, and also clears the buffer
by calling tracing_reset_all_online_cpus. This doesn't happen often
which explains why it wasn't caught right away.

Commit a82274151af was marked for stable, which means this must be
sent to stable too.

Link: http://lkml.kernel.org/r/51EEC646.7070306@broadcom.com

Reported-by: Arend van Spril &lt;arend@broadcom.com&gt;
Tested-by: Arend van Spriel &lt;arend@broadcom.com&gt;
Cc: Alexander Z Lam &lt;azl@google.com&gt;
Cc: Vaibhav Nagarnaik &lt;vnagarnaik@google.com&gt;
Cc: David Sharp &lt;dhsharp@google.com&gt;
Cc: stable@vger.kernel.org # 3.10
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Kill trace_cpu struct/members</title>
<updated>2013-07-24T15:22:53Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-07-23T15:26:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c01fe4593db123c5a72dc36f0400f776e92c954'/>
<id>urn:sha1:9c01fe4593db123c5a72dc36f0400f776e92c954</id>
<content type='text'>
After the previous changes trace_array_cpu-&gt;trace_cpu and
trace_array-&gt;trace_cpu becomes write-only. Remove these members
and kill "struct trace_cpu" as well.

As a side effect this also removes memset(per_cpu_memory, 0).
It was not needed, alloc_percpu() returns zero-filled memory.

Link: http://lkml.kernel.org/r/20130723152613.GA23741@redhat.com

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Change tracing_fops/snapshot_fops to rely on tracing_get_cpu()</title>
<updated>2013-07-24T15:22:53Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-07-23T15:26:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6484c71cbc170634fa131b6d022d86d61686b88b'/>
<id>urn:sha1:6484c71cbc170634fa131b6d022d86d61686b88b</id>
<content type='text'>
tracing_open() and tracing_snapshot_open() are racy, the memory
inode-&gt;i_private points to can be already freed.

Convert these last users of "inode-&gt;i_private == trace_cpu" to
use "i_private = trace_array" and rely on tracing_get_cpu().

v2: incorporate the fix from Steven, tracing_release() must not
    blindly dereference file-&gt;private_data unless we know that
    the file was opened for reading.

Link: http://lkml.kernel.org/r/20130723152610.GA23737@redhat.com

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Change tracing_entries_fops to rely on tracing_get_cpu()</title>
<updated>2013-07-24T15:22:52Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-07-23T15:26:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0bc392ee46d0fd8e6b678457ef71f074f19a03c5'/>
<id>urn:sha1:0bc392ee46d0fd8e6b678457ef71f074f19a03c5</id>
<content type='text'>
tracing_open_generic_tc() is racy, the memory inode-&gt;i_private
points to can be already freed.

1. Change its last user, tracing_entries_fops, to use
   tracing_*_generic_tr() instead.

2. Change debugfs_create_file("buffer_size_kb", data) callers
   to pass "data = tr".

3. Change tracing_entries_read() and tracing_entries_write() to
   use tracing_get_cpu().

4. Kill the no longer used tracing_open_generic_tc() and
   tracing_release_generic_tc().

Link: http://lkml.kernel.org/r/20130723152606.GA23730@redhat.com

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Change tracing_stats_fops to rely on tracing_get_cpu()</title>
<updated>2013-07-24T15:22:52Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-07-23T15:26:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d3435b8a4c3357695e09c5e7a3bf73a19fca5b0'/>
<id>urn:sha1:4d3435b8a4c3357695e09c5e7a3bf73a19fca5b0</id>
<content type='text'>
tracing_open_generic_tc() is racy, the memory inode-&gt;i_private
points to can be already freed.

1. Change one of its users, tracing_stats_fops, to use
   tracing_*_generic_tr() instead.

2. Change trace_create_cpu_file("stats", data) to pass "data = tr".

3. Change tracing_stats_read() to use tracing_get_cpu().

Link: http://lkml.kernel.org/r/20130723152603.GA23727@redhat.com

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Change tracing_buffers_fops to rely on tracing_get_cpu()</title>
<updated>2013-07-24T15:22:51Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-07-23T15:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46ef2be0d1d5ccea0c41bb606143586daadd537c'/>
<id>urn:sha1:46ef2be0d1d5ccea0c41bb606143586daadd537c</id>
<content type='text'>
tracing_buffers_open() is racy, the memory inode-&gt;i_private points
to can be already freed.

Change debugfs_create_file("trace_pipe_raw", data) caller to pass
"data = tr", tracing_buffers_open() can use tracing_get_cpu().

Change debugfs_create_file("snapshot_raw_fops", data) caller too,
this file uses tracing_buffers_open/release.

Link: http://lkml.kernel.org/r/20130723152600.GA23720@redhat.com

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
