Re: [PATCH V5 1/6] IB/MAD: Add send path trace points

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

 



On Tue, Feb 26, 2019 at 01:33:30PM -0500, Steven Rostedt wrote:
> On Tue, 26 Feb 2019 08:19:56 -0800
> Ira Weiny <ira.weiny@xxxxxxxxx> wrote:
> 
> 
> > > Instead of:
> > > 
> > > +		create_mad_addr_info(wr, qp_info,
> > > +				     &__entry->dlid, &__entry->sl,
> > > +				     &__entry->pkey, &__entry->rqpn,
> > > +				     &__entry->rqkey);
> > > 
> > > You do:
> > > 
> > > 	create_mad_addr_info(wr, qp_info, __entry);
> > > 
> > > And then in that function you assign the values directly to the structure.  
> > 
> > Is there any reason this is preferred over what I did?  I'm not seeing the
> > benefit?
> > 
> 
> Matters if gcc optimizes it into a static inline (which you may not
> want, because that goes directly into the code that calls the trace
> points, for each event in that class. Thus, I believe it is a true
> function call. In which, it is passing 7 arguments, on x86, that
> requires storing on the stack, and takes time to set up and tear down.
> 
> Passing the function pointer directly, makes it only use 3 arguments
> (all in registers) and is much faster, especially, if this is a fast
> path).
> 
> Do a disassemble of both approaches to see what I mean.

Right...  However, this results in quite the chicken and the egg problem
because calling create_mad_addr_info() within the definition of
trace_event_raw_ib_mad_send_template results in errors that I'm
declaring the structure in the parameter list...

:-/

I've tried moving create_mad_addr_info() around a bit and a couple of things
with void pointers but the best I can get is that I'm dereferencing an
incomplete type because the output of the preprocessor always seems to put at
least 1 call of create_mad_addr_info() prior to the struct definition.

Is there an example of this somewhere?  This code is not that performance
critical but I am curious at this point.

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