From: Frederic Weisbecker on 19 May 2010 03:30 On Tue, May 18, 2010 at 03:33:03PM +0200, Peter Zijlstra wrote: > perf_output_addr() will, for space allocated using PO_LINEAR, allow > one to get a linear address for writing its data to. > > Tracepoints tend to want to do this, although when there is need to > multiplex the events it is of course possible that each event will get > different data due to having to construct the event multiple times. > > Signed-off-by: Peter Zijlstra <a.p.zijlstra(a)chello.nl> > --- I'm still not sure what you mean here by this multiplexing. Is this about per cpu multiplexing? There is another problem. We need something like perf_output_discard() in case the filter reject the event (which must be filled for this check to happen). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on 19 May 2010 04:00 On Wed, 2010-05-19 at 09:21 +0200, Frederic Weisbecker wrote: > I'm still not sure what you mean here by this multiplexing. Is > this about per cpu multiplexing? Suppose there's two events attached to the same tracepoint. Will you write the tracepoint twice and risk different data in each, or will you do it once and copy it into each buffer? > There is another problem. We need something like > perf_output_discard() in case the filter reject the event (which > must be filled for this check to happen). Yeah, I utterly hate that, I opted to let anything with a filter take the slow path. Not only would I have to add a discard, but I'd have to decrement the counter as well, which is a big no-no. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Frederic Weisbecker on 19 May 2010 05:10 On Wed, May 19, 2010 at 09:58:02AM +0200, Peter Zijlstra wrote: > On Wed, 2010-05-19 at 09:21 +0200, Frederic Weisbecker wrote: > > > I'm still not sure what you mean here by this multiplexing. Is > > this about per cpu multiplexing? > > Suppose there's two events attached to the same tracepoint. Will you > write the tracepoint twice and risk different data in each, or will you > do it once and copy it into each buffer? The only different data we risk in each is the timestamp, which is something we can probably fetch once before actually filling the buffers. > > There is another problem. We need something like > > perf_output_discard() in case the filter reject the event (which > > must be filled for this check to happen). > > Yeah, I utterly hate that, I opted to let anything with a filter take > the slow path. Not only would I have to add a discard, but I'd have to > decrement the counter as well, which is a big no-no. That makes it complicated. But for now we don't have much other solutions. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Steven Rostedt on 19 May 2010 10:50 On Wed, 2010-05-19 at 09:58 +0200, Peter Zijlstra wrote: > On Wed, 2010-05-19 at 09:21 +0200, Frederic Weisbecker wrote: > > > I'm still not sure what you mean here by this multiplexing. Is > > this about per cpu multiplexing? > > Suppose there's two events attached to the same tracepoint. Will you > write the tracepoint twice and risk different data in each, or will you > do it once and copy it into each buffer? Is this because the same function deals with the same tracepoint, and has difficulty in knowing which event it is dealing with? Note, the shrinking of the TRACE_EVENT() code that I pushed (and I'm hoping makes it to 35 since it lays the ground work for lots of features on top of TRACE_EVENT()), allows you to pass private data to each probe registered to the tracepoint. Letting the same function handle two different activities, or different tracepoints. > > > There is another problem. We need something like > > perf_output_discard() in case the filter reject the event (which > > must be filled for this check to happen). > > Yeah, I utterly hate that, I opted to let anything with a filter take > the slow path. Not only would I have to add a discard, but I'd have to > decrement the counter as well, which is a big no-no. Hmm, this would impact performance on system wide recording of events that are filtered. One would think adding a filter would speed things up, not slow it down. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on 19 May 2010 11:10
On Wed, 2010-05-19 at 10:47 -0400, Steven Rostedt wrote: > On Wed, 2010-05-19 at 09:58 +0200, Peter Zijlstra wrote: > > On Wed, 2010-05-19 at 09:21 +0200, Frederic Weisbecker wrote: > > > > > I'm still not sure what you mean here by this multiplexing. Is > > > this about per cpu multiplexing? > > > > Suppose there's two events attached to the same tracepoint. Will you > > write the tracepoint twice and risk different data in each, or will you > > do it once and copy it into each buffer? > > Is this because the same function deals with the same tracepoint, and > has difficulty in knowing which event it is dealing with? No, but suppose the tracepoint has a racy expression in it. Having to evaluate { assign; } multiple times could yield different results, which in turn means you have to run the filter multiple times too, etc.. Although I suppose you could delay the commit of the first even and copy from there into the next events, but that might give rather messy code. > Note, the shrinking of the TRACE_EVENT() code that I pushed (and I'm > hoping makes it to 35 since it lays the ground work for lots of features > on top of TRACE_EVENT()), allows you to pass private data to each probe > registered to the tracepoint. Letting the same function handle two > different activities, or different tracepoints. tracepoint_probe_register() is useless, it requires scheduling. I currently register a probe on pref_event creation and then maintain a per-cpu hlist of active events. > > > There is another problem. We need something like > > > perf_output_discard() in case the filter reject the event (which > > > must be filled for this check to happen). > > > > Yeah, I utterly hate that, I opted to let anything with a filter take > > the slow path. Not only would I have to add a discard, but I'd have to > > decrement the counter as well, which is a big no-no. > > Hmm, this would impact performance on system wide recording of events > that are filtered. One would think adding a filter would speed things > up, not slow it down. Depends, actually running the filter and backing out might take more time than simply logging it, esp if you've already done all of the work and only lack a commit. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |