Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765542AbZDCLvy (ORCPT ); Fri, 3 Apr 2009 07:51:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759275AbZDCLvm (ORCPT ); Fri, 3 Apr 2009 07:51:42 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:42431 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754394AbZDCLvl (ORCPT ); Fri, 3 Apr 2009 07:51:41 -0400 Date: Fri, 3 Apr 2009 13:51:00 +0200 From: Ingo Molnar To: Steven Rostedt Cc: Tom Zanussi , linux-kernel@vger.kernel.org, Andrew Morton , Thomas Gleixner , Peter Zijlstra , Frederic Weisbecker , Steven Rostedt Subject: Re: [PATCH 4/4] tracing/filters: use ring_buffer_discard_commit for discarded events Message-ID: <20090403115100.GH31399@elte.hu> References: <20090402052721.013878388@goodmis.org> <20090402053522.834546042@goodmis.org> <1238663187.6621.13.camel@bookworm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1863 Lines: 45 * Steven Rostedt wrote: > > [ 240.462396] [] trace_function+0xab/0xc0 > > Oo, you have trace filters in trace_function. I'm not sure we want > that. If we do, please make it a separate function register. That > is, the function tracer is such a extreme hot path, that I would > like to avoid as many branch conditionals as possible. With the > dynamic function tracing, we can pick functions that do conditions > when we want them, and we can pick those that do not. If you look > at some of the register_ftrace_function callers, you will see > where I've picked different functions to be called by the tracer > depending on what the options are. Actually, i like Tom's idea very much: as it allows pretty flexible context based filtering - not just function based filtering. So we could filter for: - a specific PID - or a pattern of ->comm strings ['bash' or 'sshd' or 'hackbench'] - or we could filter for non-zero preempt-counts (i.e. critical sections only). So this extends the function symbol based regexp mechanism in a quite natural way, and it would be sad to not do this just because it's ... arguably hard to implement robustly ;-) The filter expression predicaments are pre-constructed and static at the point of execution, so they rely on no external facility other than some internal C code. So it should be possible to do this. And if the tracepoint causes runtime overhead .. we need to optimize that. We could register a different, filter-aware mcount callback depending on whether there's any filter defined there. Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/