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 want to say that is how I originally coded it.  But I don't know why I
changed it.  I just don't remember because the original code was written so
long ago.

I agree this is broken.  Sorry for being sloppy.  I just don't recall why I've
made this mistake and don't have the time right now to test it.  I should have
some time later this week.

> 
> 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?

Both good ideas.  If packet->mad is ok to use, which it should be, then I'd
like to record the info there as well as ret.  Again I think I need to spend
some time on this.

Jason, I'll throw up the other patches minus this one later today.

Thanks,
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