On Thu, Feb 25, 2021 at 6:31 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > Here's nothing special about %s in TP_printk. It uses the same code as > printk() and what other string formatters use. > > What is special is that the print is on data that is stored from a previous > time. Well, technically that's not actually limited to just %s, although that's the common case. All our magic "%p*" formats do the same thing: they print out not the argument _value_, but something that the pointer value points to. So "%pD" takes a "struct file *" pointer, and follows it to the dentry, and then from the dentry to the name. So it will in fact follow pointers even more than "%s" does. It might indeed be worth having a warning for TP_printk() about any of the formats that follow a pointer, exactly because of the whole "by the time it actually prints, the pointer may be long gone". Linus