Re: [PATCH] sunrpc: Fix trace events to store data in the struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 24 Feb 2015 08:36:48 -0500
Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> 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
 

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]