[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150826163018.3c86a35b@gandalf.local.home>
Date: Wed, 26 Aug 2015 16:30:18 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Jeff Layton <jlayton@...chiereds.net>
Cc: Pratyush Anand <panand@...hat.com>, bfields@...ldses.org,
linux-nfs@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
"J. Bruce Fields" <bfields@...hat.com>,
Jeff Layton <jlayton@...marydata.com>,
linux-kernel@...r.kernel.org (open list),
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Trond Myklebust <trond.myklebust@...marydata.com>
Subject: Re: [PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote
On Wed, 26 Aug 2015 06:32:55 -0400
Jeff Layton <jlayton@...chiereds.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists