unsigned long flags;
char *buf;
- if (blk_tr) {
+ if (blk_tracer_enabled) {
va_start(args, fmt);
ftrace_vprintk(fmt, args);
va_end(args);
pid_t pid;
int cpu, pc = 0;
- if (unlikely(bt->trace_state != Blktrace_running ||
+ if (unlikely(bt->trace_state != Blktrace_running &&
!blk_tracer_enabled))
return;
return;
cpu = raw_smp_processor_id();
- if (blk_tr) {
+ if (blk_tracer_enabled) {
tracing_record_cmdline(current);
pc = preempt_count();
if (pdu_len)
memcpy((void *) t + sizeof(*t), pdu_data, pdu_len);
- if (blk_tr) {
+ if (blk_tracer_enabled) {
trace_buffer_unlock_commit(blk_tr, event, 0, pc);
return;
}
if (!bt)
return -EINVAL;
- if (bt->trace_state == Blktrace_setup ||
- bt->trace_state == Blktrace_stopped)
+ if (bt->trace_state != Blktrace_running)
blk_trace_cleanup(bt);
return 0;
bt->dev = dev;
bt->act_mask = (u16)-1;
bt->end_lba = -1ULL;
- bt->trace_state = Blktrace_running;
old_bt = xchg(&q->blk_trace, bt);
if (old_bt != NULL) {