[Intel-gfx] Need to remove char pointers from trace events

Steven Rostedt rostedt at goodmis.org
Wed Jul 10 15:59:47 UTC 2019


On Wed, 10 Jul 2019 18:45:24 +0300
Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:

> > 	    TP_printk("pipe %c, plane %s, frame=%u, scanline=%u",
> > 		      pipe_name(__entry->pipe), __entry->name,
> > 		      __entry->frame, __entry->scanline)
> > 
> > 
> > The issue here is that you record a pointer address to "plane->name"
> > and then sometime in the distant future access that same address.
> > There's usually no guarantee that the contents at that address will
> > exist when the buffer is read.  
> 
> The only way those can disappear is if the device goes away. But I have
> no problem going with your patch. Want to provide a proper commit message
> for it?

Sure, but does that mean the trace data will go away with the device?
If not, then you still have the issue.

Also note that perf and trace-cmd will not know how to read that data
either, so adding it to the ring buffer gives them access.

I'll send a patch next, thanks!

-- Steve

> 
> > 
> > The proper way to record strings, is to record the string into the ring
> > buffer itself, and not rely on it existing hours or days later.
> > 


More information about the Intel-gfx mailing list