Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756785AbbHZLwa (ORCPT ); Wed, 26 Aug 2015 07:52:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52673 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbbHZLw3 (ORCPT ); Wed, 26 Aug 2015 07:52:29 -0400 Date: Wed, 26 Aug 2015 17:22:25 +0530 From: Pratyush Anand To: Jeff Layton Cc: bfields@fieldses.org, rostedt@goodmis.org, linux-nfs@vger.kernel.org, Ingo Molnar , "J. Bruce Fields" , Jeff Layton , open list , Trond Myklebust Subject: Re: [PATCH 1/2] net: sunrpc: fix tracepoint Warning: unknown op '->' Message-ID: <20150826115225.GF13340@dhcppc13.redhat.com> References: <20150826063103.6f036582@tlielax.poochiereds.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150826063103.6f036582@tlielax.poochiereds.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1598 Lines: 40 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 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/