mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
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 10:39:13 -0400	[thread overview]
Message-ID: <1312900753.18583.251.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <87obzy8xrd.fsf@skywalker.in.ibm.com>

On Tue, 2011-08-09 at 19:58 +0530, Aneesh Kumar K.V wrote:
> On Tue, 09 Aug 2011 08:53:15 -0400, Steven Rostedt <srostedt@redhat.com> wrote:

> > > +	    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.
> > 
> 
> Any suggestion on how to get this pretty printing of the hex data. I can
> update print_hex_dump_bytes to dump the hex data to a buffer. But not
> sure where i can free the buffer after using that in TP_printk. 

By making it very ugly :)

	TP_printk("clnt %lu %s(tag = %d)\n%.8x: "
		"%02x %02x %02x %02x %02x %02x %02x %02x %02x "
		"%02x %02x %02x %02x %02x %02x %02x %02x %02x\n"
		"%.8x: "
		"%02x %02x %02x %02x %02x %02x %02x %02x %02x "
		"%02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
		(long)__entry->clnt, show_9p_op(__entry->type),
		__entry->tag, 0,
		__entry->line1[0], __entry->line1[1],
		__entry->line1[2], __entry->line1[3],
		__entry->line1[4], __entry->line1[5],
		__entry->line1[6], __entry->line1[7],
		__entry->line1[8], __entry->line1[9],
		__entry->line1[10], __entry->line1[11],
		__entry->line1[12], __entry->line1[13],
		__entry->line1[14], __entry->line1[15],
		16,
		__entry->line2[0], __entry->line2[1],
		__entry->line2[2], __entry->line2[3],
		__entry->line2[4], __entry->line2[5],
		__entry->line2[6], __entry->line2[7],
		__entry->line2[8], __entry->line2[9],
		__entry->line2[10], __entry->line2[11],
		__entry->line2[12], __entry->line2[13],
		__entry->line2[14], __entry->line2[15])


Like I said, it's not pretty, but it saves buffer space and moves the
slow copy out of the fast path.

-- Steve




      reply	other threads:[~2011-08-09 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09 11:52 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
2011-08-09 14:28       ` Aneesh Kumar K.V
2011-08-09 14:39         ` Steven Rostedt [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=1312900753.18583.251.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --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=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

all inboxes | Powered by JetHome®