linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	Xenia Ragiadakou <burzalodowa@gmail.com>,
	OPW Kernel Interns List <opw-kernel-interns@googlegroups.com>,
	linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org,
	Kalle Valo <kvalo@qca.qualcomm.com>
Subject: Re: Help adding trace events to xHCI
Date: Fri, 26 Jul 2013 15:45:58 +0200	[thread overview]
Message-ID: <1374846358.8248.53.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1374844649.6580.24.camel@gandalf.local.home>

On Fri, 2013-07-26 at 09:17 -0400, Steven Rostedt wrote:
> On Fri, 2013-07-26 at 15:06 +0200, Johannes Berg wrote:
> > On Fri, 2013-07-26 at 08:28 -0400, Steven Rostedt wrote:
> 
> > Ah, yes, that'd work. I was considering putting it into the trace event
> > handling itself so I don't have to allocate those buffers and put the
> > handling into every tracepoint, but I don't know how that'd work with
> > interrupts coming in.
> 
> If you create helper functions, it shouldn't be too hard.

True, and I could even export them somewhere to share the buffers
between all the different subsystems that might use this.


> > If we assume that interrupts coming in in the middle of a tracepoint
> > should be rare, we could do something like
> > 
> >  * allocate max buffer in on the tracing ringbuffer page
> >  * write data into it
> >  * if no interrupt came in, reduce reservation
> > 
> > but I'm not sure how to implement step 3 :)
> > 
> 
> It's possible to reduce the ring buffer, it's just not implemented. I'm
> not sure I want to do that either. Interrupts coming in is not so rare
> as it can be any interrupt being traced. This means your tracepoints
> will likely waste a lot of buffer space if you are tracing interrupts as
> well.

Well, right now I can live with allocation 110 bytes for each
tracepoint, this would just optimise it down. If I was in the middle of
writing one such event while an interrupt came in, I'd not be able to
reduce the ring-buffer allocation again. I doubt that an interrupt would
come in much of the time between allocating the new event and
deallocating it partially. The more difficult question would seem to be
whether or not we can reliably detect an interrupt having written
another event.

Also, this would save the memcpy() your scheme had.

Anyway, I'm fine with the current status quo, but if more people want to
trace variable length things like formatted strings I think it might
make sense to add some way of making that more efficient.

johannes


  reply	other threads:[~2013-07-26 13:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51DB0257.1010709@gmail.com>
2013-07-11 16:20 ` Help adding trace events to xHCI Sarah Sharp
2013-07-11 17:08   ` Arend van Spriel
2013-07-11 17:08   ` Johannes Berg
2013-07-11 19:00     ` Sarah Sharp
2013-07-12  4:25       ` Kalle Valo
2013-07-12 16:41         ` Sarah Sharp
2013-07-12 16:55           ` Steven Rostedt
2013-07-15 13:47             ` Jiri Olsa
2013-07-12 17:08           ` Mathieu Desnoyers
2013-07-12 19:35             ` Mark Wielaard
2013-07-15 12:55               ` Mathieu Desnoyers
2013-07-12 18:59           ` Kalle Valo
2013-07-26  9:16       ` Johannes Berg
2013-07-11 19:29     ` Steven Rostedt
2013-07-26  9:19       ` Johannes Berg
2013-07-26 12:28         ` Steven Rostedt
2013-07-26 13:06           ` Johannes Berg
2013-07-26 13:17             ` Steven Rostedt
2013-07-26 13:45               ` Johannes Berg [this message]
2013-07-26 14:05                 ` Steven Rostedt
2013-07-12  4:23     ` Kalle Valo

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=1374846358.8248.53.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=burzalodowa@gmail.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=opw-kernel-interns@googlegroups.com \
    --cc=rostedt@goodmis.org \
    --cc=sarah.a.sharp@linux.intel.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;
as well as URLs for NNTP newsgroup(s).