[PATCH RFC 10/10] dpaa_eth: add trace points

Madalin-Cristian Bucur madalin.bucur at freescale.com
Sat Apr 4 04:29:49 AEDT 2015


> -----Original Message-----
> From: Joe Perches [mailto:joe at perches.com]
>
> On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote:
> > Add trace points on the hot processing path.
> 
> more trivia:
> 
> > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h
> []
> > +#define fd_format_name(format)	{ qm_fd_##format, #format }
> > +#define fd_format_list	\
> > +	fd_format_name(contig),	\
> > +	fd_format_name(sg)
> 
> Are these used anywhere?

Yes, by the Frame Descriptor print:

        /* This is what gets printed when the trace event is triggered */
        TP_printk(TR_FMT,
                  __get_str(name), __entry->fqid, __entry->fd_addr,
                  __print_symbolic(__entry->fd_format, fd_format_list), 		// <-- here
                  __entry->fd_offset, __entry->fd_length, __entry->fd_status)


> > +#define TR_FMT "[%s] fqid=%d, fd: addr=0x%llx, format=%s, off=%u,
> len=%u," \
> > +	" status=0x%08x"
> 
> It's nicer to coalesce string fragments.
> 
> Unless this is intended to be used more than once,
> perhaps it's better to remove it and use the string
> directly instead.
> 
> > +	/* This is what gets printed when the trace event is triggered */
> > +	TP_printk(TR_FMT,
> > +		  __get_str(name), __entry->fqid, __entry->fd_addr,
> > +		  __print_symbolic(__entry->fd_format, fd_format_list),
> > +		  __entry->fd_offset, __entry->fd_length, __entry-
> >fd_status)
> 

Checkpatch seems to be less forgiving if the long string is not in a printk:

WARNING: line over 80 characters
#22: FILE: drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h:47:
+#define TR_FMT "[%s] fqid=%d, fd: addr=0x%llx, format=%s, off=%u, len=%u, status=0x%08x"

Madalin


More information about the Linuxppc-dev mailing list