lkml.org 
[lkml]   [2015]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sunrpc: Fix trace events to store data in the struct
On Tue, 24 Feb 2015 08:36:48 -0500
Trond Myklebust <trond.myklebust@primarydata.com> 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




\
 
 \ /
  Last update: 2015-02-24 16:01    [W:0.072 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site