Skip to content

Commit 9d52727

Browse files
committed
tracing: Have tracing_snapshot_instance_cond() write errors to the appropriate instance
If a trace instance has a failure with its snapshot code, the error message is to be written to that instance's buffer. But currently, the message is written to the top level buffer. Worse yet, it may also disable the top level buffer and not the instance that had the issue. Link: https://lkml.kernel.org/r/[email protected] Cc: [email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ross Zwisler <[email protected]> Fixes: 2824f50 ("tracing: Make the snapshot trigger work with instances") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent f82e7ca commit 9d52727

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kernel/trace/trace.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,22 +1149,22 @@ static void tracing_snapshot_instance_cond(struct trace_array *tr,
11491149
unsigned long flags;
11501150

11511151
if (in_nmi()) {
1152-
internal_trace_puts("*** SNAPSHOT CALLED FROM NMI CONTEXT ***\n");
1153-
internal_trace_puts("*** snapshot is being ignored ***\n");
1152+
trace_array_puts(tr, "*** SNAPSHOT CALLED FROM NMI CONTEXT ***\n");
1153+
trace_array_puts(tr, "*** snapshot is being ignored ***\n");
11541154
return;
11551155
}
11561156

11571157
if (!tr->allocated_snapshot) {
1158-
internal_trace_puts("*** SNAPSHOT NOT ALLOCATED ***\n");
1159-
internal_trace_puts("*** stopping trace here! ***\n");
1160-
tracing_off();
1158+
trace_array_puts(tr, "*** SNAPSHOT NOT ALLOCATED ***\n");
1159+
trace_array_puts(tr, "*** stopping trace here! ***\n");
1160+
tracer_tracing_off(tr);
11611161
return;
11621162
}
11631163

11641164
/* Note, snapshot can not be used when the tracer uses it */
11651165
if (tracer->use_max_tr) {
1166-
internal_trace_puts("*** LATENCY TRACER ACTIVE ***\n");
1167-
internal_trace_puts("*** Can not use snapshot (sorry) ***\n");
1166+
trace_array_puts(tr, "*** LATENCY TRACER ACTIVE ***\n");
1167+
trace_array_puts(tr, "*** Can not use snapshot (sorry) ***\n");
11681168
return;
11691169
}
11701170

0 commit comments

Comments
 (0)