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: > > > > > INGENIC JZ4780 DMA Driver > > > M: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@xxxxxxxxxx> > > > diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c > > > index e742a6a2c138..d5cd90fecda7 100644 > > > --- a/drivers/infiniband/core/mad.c > > > +++ b/drivers/infiniband/core/mad.c > > > @@ -3,7 +3,7 @@ > > > * Copyright (c) 2005 Intel Corporation. All rights reserved. > > > * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved. > > > * Copyright (c) 2009 HNR Consulting. All rights reserved. > > > - * Copyright (c) 2014 Intel Corporation. All rights reserved. > > > + * Copyright (c) 2014,2018 Intel Corporation. All rights reserved. > > > * > > > * This software is available to you under a choice of one of two > > > * licenses. You may choose to be licensed under the terms of the GNU > > > @@ -51,6 +51,41 @@ > > > #include "opa_smi.h" > > > #include "agent.h" > > > > > > +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. -- Steve