From: Pratyush Anand <panand@redhat.com>
To: Jeff Layton <jlayton@poochiereds.net>
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>,
open list <linux-kernel@vger.kernel.org>,
Trond Myklebust <trond.myklebust@primarydata.com>
Subject: Re: [PATCH 1/2] net: sunrpc: fix tracepoint Warning: unknown op '->'
Date: Wed, 26 Aug 2015 17:22:25 +0530 [thread overview]
Message-ID: <20150826115225.GF13340@dhcppc13.redhat.com> (raw)
In-Reply-To: <20150826063103.6f036582@tlielax.poochiereds.net>
Hi Jeff,
Thanks for your review comments.
On 26/08/2015:06:31:03 AM, Jeff Layton wrote:
> On Tue, 25 Aug 2015 11:34:19 +0530
> Pratyush Anand <panand@redhat.com> wrote:
> > TP_fast_assign(
> > __entry->xprt = xprt;
> > + __entry->addr =
> > + xprt ? (struct sockaddr *)&xprt->xpt_remote : NULL;
>
> I don't get it. It's not safe to save a pointer to xprt and dereference
> that in a tracepoint (and I understand why that is), but it is safe to
> save a pointer to a structure embedded inside of xprt? Shouldn't you be
> saving a copy of the entire sockaddr struct instead?
As far as "saving of a pointer to a structure embedded inside of xprt" is
concerned, I do not see any issue.
Its your take that what you want to print as your tracepoint print output. I
might be missing something.. However, I do not see any value addition in
printing address of a structure(located in ring buffer) where xprt->xpt_remote
has been copied.
>
> Ahh, ok -- I think I see the confusion. %pIScp does not print the
> address of the sockaddr, but instead dereferences the pointer and
> prints it as a formatted address string. See pointer() in
> lib/vsprintf.c. You do want to save off a copy of the structure instead.
In my opinion, saving of structure would only be necessary if you want to access
element of the structure xprt->xpt_remote.
~Pratyush
next prev parent reply other threads:[~2015-08-26 11:52 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 [this message]
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
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=20150826115225.GF13340@dhcppc13.redhat.com \
--to=panand@redhat.com \
--cc=bfields@fieldses.org \
--cc=bfields@redhat.com \
--cc=jlayton@poochiereds.net \
--cc=jlayton@primarydata.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=mingo@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