<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace, branch v3.10.9</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace?h=v3.10.9</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace?h=v3.10.9'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-08-15T05:59:07Z</updated>
<entry>
<title>tracing: Fix reset of time stamps during trace_clock changes</title>
<updated>2013-08-15T05:59:07Z</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.amat.us/linux/commit/?id=e88512e77c0a22fc860cfb1100920cb1ca3705d3'/>
<id>urn:sha1:e88512e77c0a22fc860cfb1100920cb1ca3705d3</id>
<content type='text'>
commit 9457158bbc0ee04ecef76862d73eecd8076e9c7b upstream.

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

Signed-off-by: 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: Alexander Z Lam &lt;lambchop468@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Use flag buffer_disabled for irqsoff tracer</title>
<updated>2013-08-15T05:59:07Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-07-01T19:58:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2fd821ee4dd784a940d6840ebc85ecc8d7b80744'/>
<id>urn:sha1:2fd821ee4dd784a940d6840ebc85ecc8d7b80744</id>
<content type='text'>
commit 10246fa35d4ffdfe472185d4cbf9c2dfd9a9f023 upstream.

If the ring buffer is disabled and the irqsoff tracer records a trace it
will clear out its buffer and lose the data it had previously recorded.

Currently there's a callback when writing to the tracing_of file, but if
tracing is disabled via the function tracer trigger, it will not inform
the irqsoff tracer to stop recording.

By using the "mirror" flag (buffer_disabled) in the trace_array, that keeps
track of the status of the trace_array's buffer, it gives the irqsoff
tracer a fast way to know if it should record a new trace or not.
The flag may be a little behind the real state of the buffer, but it
should not affect the trace too much. It's more important for the irqsoff
tracer to be fast.

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Make TRACE_ITER_STOP_ON_FREE stop the correct buffer</title>
<updated>2013-08-15T05:59:07Z</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.amat.us/linux/commit/?id=e25d45868ca209a7d13772ed313a99ea0f9194d6'/>
<id>urn:sha1:e25d45868ca209a7d13772ed313a99ea0f9194d6</id>
<content type='text'>
commit 711e124379e0f889e40e2f01d7f5d61936d3cd23 upstream.

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

Signed-off-by: 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: Alexander Z Lam &lt;lambchop468@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Fix fields of struct trace_iterator that are zeroed by mistake</title>
<updated>2013-08-15T05:59:07Z</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.amat.us/linux/commit/?id=2d7ddf0a8fa2cffded6b8785f16e0c08c66f5007'/>
<id>urn:sha1:2d7ddf0a8fa2cffded6b8785f16e0c08c66f5007</id>
<content type='text'>
commit ed5467da0e369e65b247b99eb6403cb79172bcda upstream.

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

Signed-off-by: Andrew Vagin &lt;avagin@openvz.org&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()</title>
<updated>2013-08-04T08:50:44Z</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.amat.us/linux/commit/?id=c62771c88704f0814d0fead60eadc0397a5e832f'/>
<id>urn:sha1:c62771c88704f0814d0fead60eadc0397a5e832f</id>
<content type='text'>
commit 09d8091c024ec88d1541d93eb8ddb2bd5cf10c39 upstream.

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;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Kill the unbalanced tr-&gt;ref++ in tracing_buffers_open()</title>
<updated>2013-08-04T08:50:43Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-07-19T15:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e55679914313bbfc003dcdf8ff74a16dec2fe24d'/>
<id>urn:sha1:e55679914313bbfc003dcdf8ff74a16dec2fe24d</id>
<content type='text'>
commit e70e78e3c83b536730e31231dd9b979768d8df3c upstream.

tracing_buffers_open() does trace_array_get() and then it wrongly
inrcements tr-&gt;ref again under trace_types_lock. This means that
every caller leaks trace_array:

	# cd /sys/kernel/debug/tracing/
	# mkdir instances/X
	# true &lt; instances/X/per_cpu/cpu0/trace_pipe_raw
	# rmdir instances/X
	rmdir: failed to remove `instances/X': Device or resource busy

Link: http://lkml.kernel.org/r/20130719153644.GA18899@redhat.com

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Miscellaneous fixes for trace_array ref counting</title>
<updated>2013-08-04T08:50:42Z</updated>
<author>
<name>Alexander Z Lam</name>
<email>azl@google.com</email>
</author>
<published>2013-07-18T18:18:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e45ccd09b53e4cd60941891ad6992579ebc78024'/>
<id>urn:sha1:e45ccd09b53e4cd60941891ad6992579ebc78024</id>
<content type='text'>
commit f77d09a384676bde6445413949d9d2c508ff3e62 upstream.

Some error paths did not handle ref counting properly, and some trace files need
ref counting.

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

Signed-off-by: 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: Alexander Z Lam &lt;lambchop468@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Fix error handling to ensure instances can always be removed</title>
<updated>2013-08-04T08:50:41Z</updated>
<author>
<name>Alexander Z Lam</name>
<email>azl@google.com</email>
</author>
<published>2013-07-11T00:34:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a33eb1f5e1ae58418d9853c794a40d340605d752'/>
<id>urn:sha1:a33eb1f5e1ae58418d9853c794a40d340605d752</id>
<content type='text'>
commit 609e85a70bcd0eedf4ec60639dbcfb1ab011e054 upstream.

Remove debugfs directories for tracing instances during creation if an error
occurs causing the trace_array for that instance to not be added to
ftrace_trace_arrays. If the directory continues to exist after the error, it
cannot be removed because the respective trace_array is not in
ftrace_trace_arrays.

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

Signed-off-by: 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: Alexander Z Lam &lt;lambchop468@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Add trace_array_get/put() to event handling</title>
<updated>2013-07-25T21:07:43Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-07-02T19:30:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fc82a11a9ce5ddc1cc49ac7bb2a099b9b18b85c0'/>
<id>urn:sha1:fc82a11a9ce5ddc1cc49ac7bb2a099b9b18b85c0</id>
<content type='text'>
commit 8e2e2fa47129532a30cff6c25a47078dc97d9260 upstream.

Commit a695cb58162 "tracing: Prevent deleting instances when they are being read"
tried to fix a race between deleting a trace instance and reading contents
of a trace file. But it wasn't good enough. The following could crash the kernel:

 # cd /sys/kernel/debug/tracing/instances
 # ( while :; do mkdir foo; rmdir foo; done ) &amp;
 # ( while :; do echo 1 &gt; foo/events/sched/sched_switch 2&gt; /dev/null; done ) &amp;

Luckily this can only be done by root user, but it should be fixed regardless.

The problem is that a delete of the file can happen after the write to the event
is opened, but before the enabling happens.

The solution is to make sure the trace_array is available before succeeding in
opening for write, and incerment the ref counter while opened.

Now the instance can be deleted when the events are writing to the buffer,
but the deletion of the instance will disable all events before the instance
is actually deleted.

Reported-by: Alexander Lam &lt;azl@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Fix race between deleting buffer and setting events</title>
<updated>2013-07-25T21:07:43Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-07-02T18:48:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=68cebd265c91873277cf100e7ac1d047c6598ddf'/>
<id>urn:sha1:68cebd265c91873277cf100e7ac1d047c6598ddf</id>
<content type='text'>
commit 2a6c24afab70dbcfee49f4c76e1511eec1a3298b upstream.

While analyzing the code, I discovered that there's a potential race between
deleting a trace instance and setting events. There are a few races that can
occur if events are being traced as the buffer is being deleted. Mostly the
problem comes with freeing the descriptor used by the trace event callback.
To prevent problems like this, the events are disabled before the buffer is
deleted. The problem with the current solution is that the event_mutex is let
go between disabling the events and freeing the files, which means that the events
could be enabled again while the freeing takes place.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
