Re: [PATCH V6 4/6] IB/UMAD: Add umad trace points

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 18, 2019 at 01:38:58PM -0400, Steven Rostedt wrote:
> On Mon, 18 Mar 2019 02:10:07 -0700
> Ira Weiny <ira.weiny@xxxxxxxxx> wrote:
> 
> > On Mon, Mar 18, 2019 at 11:45:43AM -0400, Steven Rostedt wrote:
> > > On Mon, 18 Mar 2019 11:44:00 -0400
> > > Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> > >   
> > > > On Sun, 17 Mar 2019 12:59:48 -0700
> > > > ira.weiny@xxxxxxxxx wrote:
> > > >   
> > > > > From: Ira Weiny <ira.weiny@xxxxxxxxx>
> > > > > 
> > > > > Trace MADs going to/from user space.
> > > > > 
> > > > > CC: Hal Rosenstock <hal@xxxxxxxxxxxxxxxxxx>
> > > > > CC: Alexei Starovoitov <ast@xxxxxxxxxx>
> > > > > CC: Leon Romanovsky <leon@xxxxxxxxxx>
> > > > > CC: Jason Gunthorpe <jgg@xxxxxxxx>
> > > > > CC: "Ruhl, Michael J" <michael.j.ruhl@xxxxxxxxx>
> > > > > CC: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
> > > > > Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>    
> > > > 
> > > > For the tracing aspect.
> > > > 
> > > > Reviewed-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
> > > >   
> > > 
> > > Note, it needs to have the __user fixed. So I take this back.  
> > 
> > Yea I was not sure about that and how best to fix it...
> >
> 
> 
> 	if (packet->recv_wc)
> 		ret = copy_recv_mad(file, buf, packet, count);
> 	else
> 		ret = copy_send_mad(file, buf, packet, count);
> 
> Looking at that code, in both cases buf contains the content of packet:
> 
> 	if (copy_to_user(buf, &packet->mad, hdr_size(file)))
> 		return -EFAULT;
> 
> and the payload.
> 
> Why not use the contents of packet and payload?
> 
> I would also put in the ret into the tracepoint and make the tracepoint
> a TRACE_EVENT_CONDITIONAL() and only record when ret is not negative.
> 
> Or just place the tracepoint in the copy_send/recv_mad() functions?

Yea that turned out to be easier because packet->mad was not all that was
needed.

V7 sent with this fix rather than splitting the series.  Just seemed more
reasonable to get it done...

Ira

> 
> -- Steve



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux