* [bug report] tracing: Have persistent ring buffer print syscalls normally
@ 2025-10-31 5:37 Dan Carpenter
2025-10-31 12:35 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-10-31 5:37 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-trace-kernel
Hello Steven Rostedt,
Commit 25bd47a59275 ("tracing: Have persistent ring buffer print
syscalls normally") from Oct 28, 2025 (linux-next), leads to the
following Smatch static checker warning:
kernel/trace/trace.c:4273 print_trace_fmt()
warn: if statement not indented
kernel/trace/trace.c
4260 if (trace_seq_has_overflowed(s))
4261 return TRACE_TYPE_PARTIAL_LINE;
4262
4263 if (event) {
4264 if (tr->trace_flags & TRACE_ITER_FIELDS)
4265 return print_event_fields(iter, event);
4266 /*
4267 * For TRACE_EVENT() events, the print_fmt is not
4268 * safe to use if the array has delta offsets
4269 * Force printing via the fields.
4270 */
4271 if ((tr->text_delta)) {
4272 /* ftrace and system call events are still OK */
--> 4273 if ((event->type > __TRACE_LAST_TYPE) &&
4274 !is_syscall_event(event))
I feel like there was a line of code here that was accidentally left out
of the commit.
4275 return print_event_fields(iter, event);
Or we could add another tab here, but my guess is there is a missing
statement.
4276 }
4277 return event->funcs->trace(iter, sym_flags, event);
4278 }
4279
4280 trace_seq_printf(s, "Unknown type %d\n", entry->type);
4281
4282 return trace_handle_return(s);
4283 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] tracing: Have persistent ring buffer print syscalls normally
2025-10-31 5:37 [bug report] tracing: Have persistent ring buffer print syscalls normally Dan Carpenter
@ 2025-10-31 12:35 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2025-10-31 12:35 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-trace-kernel
On Fri, 31 Oct 2025 08:37:09 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:
> 4271 if ((tr->text_delta)) {
> 4272 /* ftrace and system call events are still OK */
> --> 4273 if ((event->type > __TRACE_LAST_TYPE) &&
> 4274 !is_syscall_event(event))
>
> I feel like there was a line of code here that was accidentally left out
> of the commit.
Or one was added ;-)
>
> 4275 return print_event_fields(iter, event);
>
> Or we could add another tab here, but my guess is there is a missing
> statement.
The commit that caused this had:
@@ -4251,10 +4268,12 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
* safe to use if the array has delta offsets
* Force printing via the fields.
*/
- if ((tr->text_delta) &&
- event->type > __TRACE_LAST_TYPE)
+ if ((tr->text_delta)) {
+ /* ftrace and system call events are still OK */
+ if ((event->type > __TRACE_LAST_TYPE) &&
+ !is_syscall_event(event))
return print_event_fields(iter, event);
-
+ }
return event->funcs->trace(iter, sym_flags, event);
}
I broke the original if statement into two if statements so that it would
look better when I added another conditional. I just forgot to increase the
indentation of the if block.
Thus, a new tab is needed.
Thanks,
-- Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-31 12:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 5:37 [bug report] tracing: Have persistent ring buffer print syscalls normally Dan Carpenter
2025-10-31 12:35 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox