Skip to content

Commit c6ced22

Browse files
rostedtchucklever
authored andcommitted
tracing: Update print fmt check to handle new __get_sockaddr() macro
A helper macro was added to make reading socket addresses easier in trace events. It pairs %pISpc with __get_sockaddr() that reads the socket address from the ring buffer into a human readable format. The boot up check that makes sure that trace events do not reference pointers to memory that can later be freed when the trace event is read, incorrectly flagged this as a delayed reference. Update the check to handle "__get_sockaddr" and not report an error on it. Link: https://lore.kernel.org/all/20220125160505.068dbb52@canb.auug.org.au/ Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent d07c9ad commit c6ced22

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

kernel/trace/trace_events.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ static void test_event_printk(struct trace_event_call *call)
384384
if (!(dereference_flags & (1ULL << arg)))
385385
goto next_arg;
386386

387+
/* Check for __get_sockaddr */;
388+
if (str_has_prefix(fmt + i, "__get_sockaddr(")) {
389+
dereference_flags &= ~(1ULL << arg);
390+
goto next_arg;
391+
}
392+
387393
/* Find the REC-> in the argument */
388394
c = strchr(fmt + i, ',');
389395
r = strstr(fmt + i, "REC->");

0 commit comments

Comments
 (0)