[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160613072050.GA19180@sisyphus.home.austad.us>
Date: Mon, 13 Jun 2016 09:20:50 +0200
From: Henrik Austad <henrik@...tad.us>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
alsa-devel@...r.kernel.org, netdev@...r.kernel.org,
Henrik Austad <haustad@...co.com>,
"David S. Miller" <davem@...emloft.net>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [very-RFC 6/8] Add TSN event-tracing
On Sun, Jun 12, 2016 at 10:22:01PM -0400, Steven Rostedt wrote:
> On Sun, 12 Jun 2016 23:25:10 +0200
> Henrik Austad <henrik@...tad.us> wrote:
>
> > > > +#include <linux/if_ether.h>
> > > > +#include <linux/if_vlan.h>
> > > > +/* #include <linux/skbuff.h> */
> > > > +
> > > > +/* FIXME: update to TRACE_CLASS to reduce overhead */
> > >
> > > I'm curious to why I didn't do this now. A class would make less
> > > duplication of typing too ;-)
> >
> > Yeah, I found this in a really great article written by some tracing-dude,
> > I hear he talks really, really fast!
>
> I plead the 5th!
>
> >
> > https://lwn.net/Articles/381064/
> >
> > > > +TRACE_EVENT(tsn_buffer_write,
> > > > +
> > > > + TP_PROTO(struct tsn_link *link,
> > > > + size_t bytes),
> > > > +
> > > > + TP_ARGS(link, bytes),
> > > > +
> > > > + TP_STRUCT__entry(
> > > > + __field(u64, stream_id)
> > > > + __field(size_t, size)
> > > > + __field(size_t, bsize)
> > > > + __field(size_t, size_left)
> > > > + __field(void *, buffer)
> > > > + __field(void *, head)
> > > > + __field(void *, tail)
> > > > + __field(void *, end)
> > > > + ),
> > > > +
> > > > + TP_fast_assign(
> > > > + __entry->stream_id = link->stream_id;
> > > > + __entry->size = bytes;
> > > > + __entry->bsize = link->used_buffer_size;
> > > > + __entry->size_left = (link->head - link->tail) % link->used_buffer_size;
> > >
> > > Move this logic into the print statement, since you save head and tail.
> >
> > Ok, any particular reason?
>
> Because it removes calculations during the trace. The calculations done
> in TP_printk() are done at the time of reading the trace, and
> calculations done in TP_fast_assign() are done during the recording and
> hence adding more overhead to the trace itself.
Aha! that makes sense, thanks!
(/me goes and updates the tracing-part)
-Henrik
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists