Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e23b8ad8 authored by Markus Metzger's avatar Markus Metzger Committed by Ingo Molnar
Browse files

x86, ftrace, hw-branch-tracer: reset trace buffer on close



Reset the ftrace buffer on close. Since we use cyclic buffers, the
trace is not contiguous, anyway.

Signed-off-by: default avatarMarkus Metzger <markus.t.metzger@intel.com>
Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b1818748
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -274,6 +274,11 @@ static void trace_bts_prepare(struct trace_iterator *iter)
	mutex_unlock(&bts_tracer_mutex);
	mutex_unlock(&bts_tracer_mutex);
}
}


static void trace_bts_close(struct trace_iterator *iter)
{
	tracing_reset_online_cpus(iter->tr);
}

void trace_hw_branch_oops(void)
void trace_hw_branch_oops(void)
{
{
	mutex_lock(&bts_tracer_mutex);
	mutex_lock(&bts_tracer_mutex);
@@ -292,7 +297,8 @@ struct tracer bts_tracer __read_mostly =
	.print_line	= bts_trace_print_line,
	.print_line	= bts_trace_print_line,
	.start		= bts_trace_start,
	.start		= bts_trace_start,
	.stop		= bts_trace_stop,
	.stop		= bts_trace_stop,
	.open		= trace_bts_prepare
	.open		= trace_bts_prepare,
	.close		= trace_bts_close
};
};


__init static int init_bts_trace(void)
__init static int init_bts_trace(void)