public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Pekka Enberg <penberg@kernel.org>,
	v9fs-developer@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] net/9p: Convert net/9p protocol dumps to tracepoints
Date: Tue, 09 Aug 2011 08:53:15 -0400	[thread overview]
Message-ID: <1312894395.3064.23.camel@fedora> (raw)
In-Reply-To: <87r54u92ok.fsf@skywalker.in.ibm.com>

On Tue, 2011-08-09 at 18:12 +0530, Aneesh Kumar K.V wrote:

> +#define P9_PROTO_DUMP_SZ (16 * 3 + 2 + 16 + 1)

Wow, you're making your event have 67 byte arrays, two of them.

> +TRACE_EVENT(9p_protocol_dump,
> +	    TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu),
> +
> +	    TP_ARGS(clnt, pdu),
> +
> +	    TP_STRUCT__entry(
> +		    __field(	__u64,		clnt				)
> +		    __field(	__u8,		type				)
> +		    __field(	__u16,		tag				)
> +		    __array(	unsigned char,	line1,	P9_PROTO_DUMP_SZ	)
> +		    __array(	unsigned char,	line2,	P9_PROTO_DUMP_SZ	)
> +		    ),

Wouldn't it be better to put this as two unsigned char arrays of 16
bytes?

> +
> +	    TP_fast_assign(
> +		    const u8 *ptr   =  pdu->sdata;
> +		    __entry->clnt   =  (__u64)clnt;
> +		    __entry->type   =  pdu->id;
> +		    __entry->tag    =  pdu->tag;
> +		    hex_dump_to_buffer(ptr, 16, 16,
> +				       1, __entry->line1, P9_PROTO_DUMP_SZ, true);
> +		    hex_dump_to_buffer(ptr + 16, 16, 16,
> +				       1, __entry->line2, P9_PROTO_DUMP_SZ, true);
> +		    ),
> +
> +	    TP_printk("clnt %lu %s(tag = %d)\n%.8x: %s\n%.8x: %s\n",
> +		      (long)__entry->clnt, show_9p_op(__entry->type),
> +		      __entry->tag, 0, __entry->line1, 16 , __entry->line2)

Yeah, you would need to make the above ugly to print out the array, but
it's not that hard. And you will be saving 102 bytes per event in the
ring buffer, which is very expensive real-estate. Not to mention the
time it takes to copy all that.

-- Steve



  reply	other threads:[~2011-08-09 12:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09 11:52 [PATCH] net/9p: Convert net/9p protocol dumps to tracepoints Aneesh Kumar K.V
2011-08-09 11:58 ` Pekka Enberg
2011-08-09 12:42   ` Aneesh Kumar K.V
2011-08-09 12:53     ` Steven Rostedt [this message]
2011-08-09 14:28       ` Aneesh Kumar K.V
2011-08-09 14:39         ` 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=1312894395.3064.23.camel@fedora \
    --to=srostedt@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    /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