Return-Path: Date: Tue, 24 Feb 2015 09:49:40 -0500 From: Steven Rostedt To: Trond Myklebust Cc: James Hogan , Jeff Layton , "J. Bruce Fields" , Linux Kernel Mailing List , Ingo Molnar , Stable Tree Mailing List Subject: Re: [PATCH] sunrpc: Fix trace events to store data in the struct Message-ID: <20150224094940.63323081@gandalf.local.home> In-Reply-To: References: <1424778476-28242-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: On Tue, 24 Feb 2015 08:36:48 -0500 Trond Myklebust wrote: > > diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h > > index b9c1dc6c825a..47dfcaebfaaf 100644 > > --- a/include/trace/events/sunrpc.h > > +++ b/include/trace/events/sunrpc.h > > @@ -503,18 +503,22 @@ TRACE_EVENT(svc_xprt_do_enqueue, > > > > TP_STRUCT__entry( > > __field(struct svc_xprt *, xprt) > > - __field(struct svc_rqst *, rqst) > > + __field_struct(struct sockaddr_storage, ss) > > + __field(unsigned long, flags); > > + __field(int, pid) > > ), > > > > TP_fast_assign( > > __entry->xprt = xprt; > > - __entry->rqst = rqst; > > + xprt ? memcpy(&__entry->ss, &xprt->xpt_remote, sizeof(__entry->ss)) : memset(&__entry->ss, 0, sizeof(__entry->ss)); > > How could xprt ever be NULL here, and even if it was, why the esoteric > C instead of a simple 'if' statement? If it can never be NULL here, then we do not need the conditional. -- Steve