mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@poochiereds.net>
To: Pratyush Anand <panand@redhat.com>
Cc: bfields@fieldses.org, rostedt@goodmis.org,
	linux-nfs@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	"J. Bruce Fields" <bfields@redhat.com>,
	Jeff Layton <jlayton@primarydata.com>,
	linux-kernel@vger.kernel.org (open list),
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Trond Myklebust <trond.myklebust@primarydata.com>
Subject: Re: [PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote
Date: Wed, 26 Aug 2015 06:32:55 -0400	[thread overview]
Message-ID: <20150826063255.3cdd5475@tlielax.poochiereds.net> (raw)
In-Reply-To: <3e2f763f7701d7ff6915b52a3c80fd1f550ae951.1440482404.git.panand@redhat.com>

On Tue, 25 Aug 2015 11:34:20 +0530
Pratyush Anand <panand@redhat.com> wrote:

> TP_printk() for svc_xprt_dequeue intends to print address of
> xprt->xpt_remote, however it prints address of another structure where
> xprt->xpt_remote has been copied.
> 
> This patch fixes the above behaviour.
> 
> Signed-off-by: Pratyush Anand <panand@redhat.com>
> ---
>  include/trace/events/sunrpc.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
> index 937e482d80e9..37b6af1a911a 100644
> --- a/include/trace/events/sunrpc.h
> +++ b/include/trace/events/sunrpc.h
> @@ -556,19 +556,19 @@ TRACE_EVENT(svc_xprt_dequeue,
>  
>  	TP_STRUCT__entry(
>  		__field(struct svc_xprt *, xprt)
> -		__field_struct(struct sockaddr_storage, ss)
> +		__field(struct sockaddr *, addr)
>  		__field(unsigned long, flags)
>  	),
>  
>  	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
want to pass a NULL pointer to it. We do want to save a copy of the
sockaddr.

>  		__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,


-- 
Jeff Layton <jlayton@poochiereds.net>

  reply	other threads:[~2015-08-26 10:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1440482404.git.panand@redhat.com>
2015-08-25  6:04 ` [PATCH 1/2] net: sunrpc: fix tracepoint Warning: unknown op '->' Pratyush Anand
2015-08-25 14:02   ` Steven Rostedt
2015-08-26 10:31   ` Jeff Layton
2015-08-26 11:52     ` Pratyush Anand
2015-08-26 12:01       ` Jeff Layton
2015-08-26 12:11         ` Pratyush Anand
2015-08-25  6:04 ` [PATCH 2/2] net: sunrpc: fix trace print of &xprt->xpt_remote Pratyush Anand
2015-08-26 10:32   ` Jeff Layton [this message]
2015-08-26 20:30     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150826063255.3cdd5475@tlielax.poochiereds.net \
    --to=jlayton@poochiereds.net \
    --cc=bfields@fieldses.org \
    --cc=bfields@redhat.com \
    --cc=jlayton@primarydata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=panand@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®