diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blktrace.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/block/blktrace.c b/block/blktrace.c index 8e52f24cc8f9..834cd84037b2 100644 --- a/block/blktrace.c +++ b/block/blktrace.c | |||
@@ -187,19 +187,15 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, | |||
187 | cpu = raw_smp_processor_id(); | 187 | cpu = raw_smp_processor_id(); |
188 | 188 | ||
189 | if (blk_tr) { | 189 | if (blk_tr) { |
190 | struct trace_entry *ent; | ||
191 | tracing_record_cmdline(current); | 190 | tracing_record_cmdline(current); |
192 | 191 | ||
193 | event = ring_buffer_lock_reserve(blk_tr->buffer, | 192 | pc = preempt_count(); |
194 | sizeof(*t) + pdu_len); | 193 | event = trace_buffer_lock_reserve(blk_tr, TRACE_BLK, |
194 | sizeof(*t) + pdu_len, | ||
195 | 0, pc); | ||
195 | if (!event) | 196 | if (!event) |
196 | return; | 197 | return; |
197 | 198 | t = ring_buffer_event_data(event); | |
198 | ent = ring_buffer_event_data(event); | ||
199 | t = (struct blk_io_trace *)ent; | ||
200 | pc = preempt_count(); | ||
201 | tracing_generic_entry_update(ent, 0, pc); | ||
202 | ent->type = TRACE_BLK; | ||
203 | goto record_it; | 199 | goto record_it; |
204 | } | 200 | } |
205 | 201 | ||
@@ -241,12 +237,7 @@ record_it: | |||
241 | memcpy((void *) t + sizeof(*t), pdu_data, pdu_len); | 237 | memcpy((void *) t + sizeof(*t), pdu_data, pdu_len); |
242 | 238 | ||
243 | if (blk_tr) { | 239 | if (blk_tr) { |
244 | ring_buffer_unlock_commit(blk_tr->buffer, event); | 240 | trace_buffer_unlock_commit(blk_tr, event, 0, pc); |
245 | if (pid != 0 && | ||
246 | !(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC) && | ||
247 | (trace_flags & TRACE_ITER_STACKTRACE) != 0) | ||
248 | __trace_stack(blk_tr, 0, 5, pc); | ||
249 | trace_wake_up(); | ||
250 | return; | 241 | return; |
251 | } | 242 | } |
252 | } | 243 | } |