On Tue, Feb 26, 2019 at 01:13:17AM -0500, Steven Rostedt wrote: > On Mon, 25 Feb 2019 21:52:46 -0800 > Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > > On Mon, Feb 25, 2019 at 11:36:40AM -0500, Steven Rostedt wrote: > > > On Sun, 24 Feb 2019 21:11:59 -0800 > > > ira.weiny@xxxxxxxxx wrote: > > > > > > > > +static void create_mad_addr_info(struct ib_mad_send_wr_private *mad_send_wr, > > > > + struct ib_mad_qp_info *qp_info, > > > > + u32 *dlid, u8 *sl, u16 *pkey, u32 *rqpn, > > > > + u32 *rqkey) > > > > +{ > > > > > > Instead of passing in a bunch of addresses, you may be able to pass in > > > the entry structure directly. > > > > > > struct trace_event_raw_ib_mad_send_template *entry > > > > > > (defined from DECLARE_EVENT_CLASS(name, ... > > > > > > struct trace_event_raw_##name .. ) > > > > > > And just assign everything as: > > > > > > entry->dlid = x, ... > > > > raw_tracepoint requires all args to fit into u64. > > bpf prog cannot access it otherwise. > > Also struct by value is pretty slow on some archs. > > Pointer to struct is always preferred. > > I meant passing in the pointer, not the value. It wouldn't make sense > otherwise, because the entire point of create_mad_addr_info(), is to > update the __entry structure. How would passing in the value do that? > > > 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? Ira > > -- Steve > >