aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/blktrace.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 95f89faca73e..a7f7ff5db38b 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -110,7 +110,7 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...)
110 unsigned long flags; 110 unsigned long flags;
111 char *buf; 111 char *buf;
112 112
113 if (blk_tr) { 113 if (blk_tracer_enabled) {
114 va_start(args, fmt); 114 va_start(args, fmt);
115 ftrace_vprintk(fmt, args); 115 ftrace_vprintk(fmt, args);
116 va_end(args); 116 va_end(args);
@@ -169,7 +169,7 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
169 pid_t pid; 169 pid_t pid;
170 int cpu, pc = 0; 170 int cpu, pc = 0;
171 171
172 if (unlikely(bt->trace_state != Blktrace_running || 172 if (unlikely(bt->trace_state != Blktrace_running &&
173 !blk_tracer_enabled)) 173 !blk_tracer_enabled))
174 return; 174 return;
175 175
@@ -185,7 +185,7 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
185 return; 185 return;
186 cpu = raw_smp_processor_id(); 186 cpu = raw_smp_processor_id();
187 187
188 if (blk_tr) { 188 if (blk_tracer_enabled) {
189 tracing_record_cmdline(current); 189 tracing_record_cmdline(current);
190 190
191 pc = preempt_count(); 191 pc = preempt_count();
@@ -235,7 +235,7 @@ record_it:
235 if (pdu_len) 235 if (pdu_len)
236 memcpy((void *) t + sizeof(*t), pdu_data, pdu_len); 236 memcpy((void *) t + sizeof(*t), pdu_data, pdu_len);
237 237
238 if (blk_tr) { 238 if (blk_tracer_enabled) {
239 trace_buffer_unlock_commit(blk_tr, event, 0, pc); 239 trace_buffer_unlock_commit(blk_tr, event, 0, pc);
240 return; 240 return;
241 } 241 }
@@ -267,8 +267,7 @@ int blk_trace_remove(struct request_queue *q)
267 if (!bt) 267 if (!bt)
268 return -EINVAL; 268 return -EINVAL;
269 269
270 if (bt->trace_state == Blktrace_setup || 270 if (bt->trace_state != Blktrace_running)
271 bt->trace_state == Blktrace_stopped)
272 blk_trace_cleanup(bt); 271 blk_trace_cleanup(bt);
273 272
274 return 0; 273 return 0;
@@ -1273,7 +1272,6 @@ static int blk_trace_setup_queue(struct request_queue *q, dev_t dev)
1273 bt->dev = dev; 1272 bt->dev = dev;
1274 bt->act_mask = (u16)-1; 1273 bt->act_mask = (u16)-1;
1275 bt->end_lba = -1ULL; 1274 bt->end_lba = -1ULL;
1276 bt->trace_state = Blktrace_running;
1277 1275
1278 old_bt = xchg(&q->blk_trace, bt); 1276 old_bt = xchg(&q->blk_trace, bt);
1279 if (old_bt != NULL) { 1277 if (old_bt != NULL) {