Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214177

Re: [PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote
Date 2015-08-26 22:40 +0200
Message-ID <q1PEe-89i-17@gated-at.bofh.it> (permalink)
References <q1fAJ-6pU-7@gated-at.bofh.it> <q1fAJ-6pU-5@gated-at.bofh.it> <q1GhA-38h-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 26 Aug 2015 06:32:55 -0400
Jeff Layton <jlayton@poochiereds.net> wrote:

 
> >  	TP_fast_assign(
> > -		__entry->xprt = xprt,
> > -		xprt ? memcpy(&__entry->ss, &xprt->xpt_remote, sizeof(__entry->ss)) : memset(&__entry->ss, 0, sizeof(__entry->ss));
> > +		__entry->xprt = xprt;
> > +		__entry->addr =
> > +			xprt ? (struct sockaddr *)&xprt->xpt_remote : NULL;
> 
> NAK, this is wrong. %pIScp will dereference that address so you don't

Ug, I hate that printk option. It can be dangerous.

> want to pass a NULL pointer to it. We do want to save a copy of the
> sockaddr.

Save just enough for what you need to print out. Don't waste any space
on the ring buffer that isn't necessary.

-- Steve

> 
> >  		__entry->flags = xprt ? xprt->xpt_flags : 0;
> >  	),
> >  
> >  	TP_printk("xprt=0x%p addr=%pIScp flags=%s", __entry->xprt,
> > -		(struct sockaddr *)&__entry->ss,
> > -		show_svc_xprt_flags(__entry->flags))
> > +		__entry->addr, show_svc_xprt_flags(__entry->flags))
> >  );
> >  
> >  TRACE_EVENT(svc_wake_up,
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote Pratyush Anand <panand@redhat.com> - 2015-08-25 08:10 +0200
  Re: [PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote Jeff Layton <jlayton@poochiereds.net> - 2015-08-26 12:40 +0200
    Re: [PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote Steven Rostedt <rostedt@goodmis.org> - 2015-08-26 22:40 +0200

csiph-web