void __trace_note_message(struct blk_trace *bt, const char *fmt, ...) { int n; va_list args; unsigned long flags; char *buf; if (unlikely(bt->trace_state != Blktrace_running && !blk_tracer_enabled)) return; /* * If the BLK_TC_NOTIFY action mask isn't set, don't send any note * message to the trace. */ if (!(bt->act_mask & BLK_TC_NOTIFY)) return; local_irq_save(flags); buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); va_start(args, fmt); n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); va_end(args); trace_note(bt, 0, BLK_TN_MESSAGE, buf, n); local_irq_restore(flags); }
static void trace_note_time(struct blk_trace *bt) { struct timespec now; unsigned long flags; u32 words[2]; getnstimeofday(&now); words[0] = now.tv_sec; words[1] = now.tv_nsec; local_irq_save(flags); trace_note(bt, 0, BLK_TN_TIMESTAMP, words, sizeof(words)); local_irq_restore(flags); }
void __trace_note_message(struct blk_trace *bt, const char *fmt, ...) { int n; va_list args; unsigned long flags; char *buf; local_irq_save(flags); buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); va_start(args, fmt); n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); va_end(args); trace_note(bt, 0, BLK_TN_MESSAGE, buf, n); local_irq_restore(flags); }
/* * Send out a notify for this process, if we haven't done so since a trace * started */ static void trace_note_tsk(struct blk_trace *bt, struct task_struct *tsk) { tsk->btrace_seq = blktrace_seq; trace_note(bt, tsk->pid, BLK_TN_PROCESS, tsk->comm, sizeof(tsk->comm)); }