/* * Collect the trace on the current cpu and write it into the ftrace buffer. * * pre: bts_tracer_lock must be locked */ 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; ds_suspend_bts(this_tracer); trace = ds_read_bts(this_tracer); if (!trace) goto out; 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); out: ds_resume_bts(this_tracer); }
static void trace_bts_cpu(void *arg) { struct trace_array *tr = (struct trace_array *) arg; const struct bts_trace *trace; unsigned char *at; if (!this_tracer) return; ds_suspend_bts(this_tracer); trace = ds_read_bts(this_tracer); if (!trace) goto out; for (at = trace->ds.top; (void *)at < trace->ds.end; at += trace->ds.size) trace_bts_at(tr, trace, at); for (at = trace->ds.begin; (void *)at < trace->ds.top; at += trace->ds.size) trace_bts_at(tr, trace, at); out: ds_resume_bts(this_tracer); }