tracing: Use swap macro in update_max_tr
Make use of the swap macro and remove unnecessary variable _buf_. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Link: http://lkml.kernel.org/r/20180209175316.GA18720@embeddedgus Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
1a63dcd876
commit
08ae88f810
|
@ -1360,8 +1360,6 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
|
||||||
void
|
void
|
||||||
update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
|
update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
|
||||||
{
|
{
|
||||||
struct ring_buffer *buf;
|
|
||||||
|
|
||||||
if (tr->stop_count)
|
if (tr->stop_count)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1375,9 +1373,7 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
|
||||||
|
|
||||||
arch_spin_lock(&tr->max_lock);
|
arch_spin_lock(&tr->max_lock);
|
||||||
|
|
||||||
buf = tr->trace_buffer.buffer;
|
swap(tr->trace_buffer.buffer, tr->max_buffer.buffer);
|
||||||
tr->trace_buffer.buffer = tr->max_buffer.buffer;
|
|
||||||
tr->max_buffer.buffer = buf;
|
|
||||||
|
|
||||||
__update_max_tr(tr, tsk, cpu);
|
__update_max_tr(tr, tsk, cpu);
|
||||||
arch_spin_unlock(&tr->max_lock);
|
arch_spin_unlock(&tr->max_lock);
|
||||||
|
|
Loading…
Reference in New Issue