/* pre: tracing must be suspended on the current cpu  */
static void trace_bts_cpu(void *arg)
/* pre: tracing must be suspended on the current cpu  */
static void trace_bts_cpu(void *arg)
{
	struct trace_array *tr = (struct trace_array *)arg;
	const struct bts_trace *trace;
	unsigned char *at;
	if (unlikely(!tr))
		return;
	if (unlikely(atomic_read(&tr->data[raw_smp_processor_id()]->disabled)))
		return;
	if (unlikely(!this_tracer))
		return;
	trace = ds_read_bts(this_tracer);
	if (!trace)
		return;
	for (at = trace->ds.top; (void *)at < trace->ds.end;
	     at += trace->ds.size)
		trace_bts_at(trace, at);
	for (at = trace->ds.begin; (void *)at < trace->ds.top;
	     at += trace->ds.size)
		trace_bts_at(trace, at);
}