Re: [RDMA for-next v2 1/6] IB/MAD: Add send path trace points

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

 



On Wed, 19 Dec 2018 22:31:00 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:


> > index 000000000000..8c08eaefbc08
> > --- /dev/null
> > +++ b/include/trace/events/ib_mad.h
> > @@ -0,0 +1,193 @@
> > +/*
> > + * Copyright (c) 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
> > + * General Public License (GPL) Version 2, available from the file
> > + * COPYING in the main directory of this source tree, or the
> > + * OpenIB.org BSD license below:  
> 
> Please use:
> 
> // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
> 
> At the top of the file, and do not add other License text in the file.
>


> > +#undef TRACE_SYSTEM
> > +#define TRACE_SYSTEM ib_mad
> > +
> > +#if !defined(_TRACE_IB_MAD_H) || defined(TRACE_HEADER_MULTI_READ)
> > +#define _TRACE_IB_MAD_H
> > +
> > +#include <linux/tracepoint.h>
> > +#include <rdma/ib_mad.h>
> > +
> > +DECLARE_EVENT_CLASS(ib_mad_send_template,
> > +	TP_PROTO(struct ib_mad_send_wr_private *wr, struct rdma_mad_trace_addr *addr),
> > +	TP_ARGS(wr, addr),
> > +
> > +	TP_STRUCT__entry(
> > +		__array(char,           dev_name, IB_DEVICE_NAME_MAX)  
> 
> IB_DEVICE_NAME_MAX is 64 bytes. That's quite a bit, and much bigger
> than what it would be normally. Using __string() which is dynamic is a
> better option.
> 
> > +		__field(u8,             port_num)
> > +		__field(u32,            qp_num)  
> 
> Order of fields by size matters, because architectures will likely pad
> them wasting ring buffer space.
> 
> Group u8 by 4 or 8, and try to keep pointers and u64 on 8 byte
> alignments (assuming a 64 bit architecture.)
> 
> The current order will produce a lot of unnecessary padding by the
> compiler.
> 

These comments go for the next 4 patches that have the same issues.

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