All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 01/10] SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status
Date: Fri, 24 Jun 2016 14:28:37 -0400	[thread overview]
Message-ID: <20160624182837.GH3287@fieldses.org> (raw)
In-Reply-To: <1466780152-7154-1-git-send-email-trond.myklebust@primarydata.com>

On Fri, Jun 24, 2016 at 10:55:43AM -0400, Trond Myklebust wrote:
> There is no guarantee that either the request or the svc_xprt exist
> by the time we get round to printing the trace message.

Thanks.  I'll also add:

  Cc: stable@vger.kernel.org
  Fixes: 83a712e0afef "sunrpc: add some tracepoints around ..."

--b.

> 
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
>  include/trace/events/sunrpc.h | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
> index 003dca933803..e82493d07a86 100644
> --- a/include/trace/events/sunrpc.h
> +++ b/include/trace/events/sunrpc.h
> @@ -455,20 +455,22 @@ TRACE_EVENT(svc_recv,
>  	TP_ARGS(rqst, status),
>  
>  	TP_STRUCT__entry(
> -		__field(struct sockaddr *, addr)
>  		__field(__be32, xid)
>  		__field(int, status)
>  		__field(unsigned long, flags)
> +		__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
>  	),
>  
>  	TP_fast_assign(
> -		__entry->addr = (struct sockaddr *)&rqst->rq_addr;
>  		__entry->xid = status > 0 ? rqst->rq_xid : 0;
>  		__entry->status = status;
>  		__entry->flags = rqst->rq_flags;
> +		memcpy(__get_dynamic_array(addr),
> +			&rqst->rq_addr, rqst->rq_addrlen);
>  	),
>  
> -	TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s", __entry->addr,
> +	TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s",
> +			(struct sockaddr *)__get_dynamic_array(addr),
>  			be32_to_cpu(__entry->xid), __entry->status,
>  			show_rqstp_flags(__entry->flags))
>  );
> @@ -480,22 +482,23 @@ DECLARE_EVENT_CLASS(svc_rqst_status,
>  	TP_ARGS(rqst, status),
>  
>  	TP_STRUCT__entry(
> -		__field(struct sockaddr *, addr)
>  		__field(__be32, xid)
> -		__field(int, dropme)
>  		__field(int, status)
>  		__field(unsigned long, flags)
> +		__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
>  	),
>  
>  	TP_fast_assign(
> -		__entry->addr = (struct sockaddr *)&rqst->rq_addr;
>  		__entry->xid = rqst->rq_xid;
>  		__entry->status = status;
>  		__entry->flags = rqst->rq_flags;
> +		memcpy(__get_dynamic_array(addr),
> +			&rqst->rq_addr, rqst->rq_addrlen);
>  	),
>  
>  	TP_printk("addr=%pIScp rq_xid=0x%x status=%d flags=%s",
> -		__entry->addr, be32_to_cpu(__entry->xid),
> +		(struct sockaddr *)__get_dynamic_array(addr),
> +		be32_to_cpu(__entry->xid),
>  		__entry->status, show_rqstp_flags(__entry->flags))
>  );
>  
> -- 
> 2.7.4

      parent reply	other threads:[~2016-06-24 18:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 14:55 [PATCH 01/10] SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status Trond Myklebust
2016-06-24 14:55 ` [PATCH 02/10] SUNRPC: Don't allocate a full sockaddr_storage for tracing Trond Myklebust
2016-06-24 14:55   ` [PATCH 03/10] SUNRPC: Add a tracepoint for server socket out-of-space conditions Trond Myklebust
2016-06-24 14:55     ` [PATCH 04/10] SUNRPC: Add tracepoints for dropped and deferred requests Trond Myklebust
2016-06-24 14:55       ` [PATCH 05/10] SUNRPC: lock the socket while detaching it Trond Myklebust
2016-06-24 14:55         ` [PATCH 06/10] SUNRPC: Call the default socket callbacks instead of open coding Trond Myklebust
2016-06-24 14:55           ` [PATCH 07/10] SUNRPC: Micro optimisation for svc_data_ready Trond Myklebust
2016-06-24 14:55             ` [PATCH 08/10] SUNRPC: Add a server side per-connection limit Trond Myklebust
2016-06-24 14:55               ` [PATCH 09/10] SUNRPC: Change TCP socket space reservation Trond Myklebust
2016-06-24 14:55                 ` [PATCH 10/10] SUNRPC: Remove unused callback xpo_adjust_wspace() Trond Myklebust
2016-06-24 21:18                 ` [PATCH 09/10] SUNRPC: Change TCP socket space reservation J. Bruce Fields
2016-06-24 21:31                   ` Trond Myklebust
2016-07-06 20:17                     ` Fields Bruce
2016-07-06 19:53                 ` J. Bruce Fields
2016-07-06 20:11                   ` Trond Myklebust
2016-07-06 20:30                     ` Fields Bruce
2016-06-24 21:15               ` [PATCH 08/10] SUNRPC: Add a server side per-connection limit J. Bruce Fields
2016-06-24 21:24                 ` Trond Myklebust
2016-07-06 16:16               ` J. Bruce Fields
2016-06-24 21:06         ` [PATCH 05/10] SUNRPC: lock the socket while detaching it J. Bruce Fields
2016-06-24 21:21           ` Trond Myklebust
2016-06-24 18:28 ` J. Bruce Fields [this message]

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=20160624182837.GH3287@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.