Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761473AbYGOCSt (ORCPT ); Mon, 14 Jul 2008 22:18:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754305AbYGOCSO (ORCPT ); Mon, 14 Jul 2008 22:18:14 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:58428 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761356AbYGOCSM (ORCPT ); Mon, 14 Jul 2008 22:18:12 -0400 Date: Mon, 14 Jul 2008 22:18:09 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: "Eric W. Biederman" cc: Andrew Morton , Randy Dunlap , Elias Oltmanns , LKML , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Clark Williams , Linus Torvalds , Jon Masters Subject: Re: [PATCH -v2] ftrace: Documentation In-Reply-To: Message-ID: References: <87zlop7bp6.fsf@denkblock.local> <20080710132832.38cc5048.randy.dunlap@oracle.com> <20080711121655.05810822.akpm@linux-foundation.org> <20080711153740.b86acadd.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2193 Lines: 59 On Mon, 14 Jul 2008, Eric W. Biederman wrote: > > > > Bare with me, I'm new to the namespace concept of pids. > > Sure. Just bare with me as I am new to the concept of ftrace. Yep, understood. But you can get a good understanding by reading this document ;-) > > >> So it would not be hard to capture the pid namespace in mount or > >> even look at current to get it (although the last is a little odd). > > > >>From userspace or from with the kernel (doing the trace) > > > >> > >> I'm not at all certain if it makes sense. If this is something > >> an ordinary user could use then we definitely want to do something. > >> > >> Is tracing possible without inserting kernel modules? > > > > The tracer is built into the kernel (no module needed). > > Ok. So this is something simpler to use then SystemTap. Yeah. Yes, very similar. SystemTap may even hook into ftrace, and vice versa. > > It sounds like it is reasonable or at least semi reasonable to use > this as an unprivileged user. Currently only root can do the traces. Since some of the tracing can hurt the performance of the system. > > The easiest model to think of this in is a chroot that does pids as > well as the filesystem. In which case if you are inside one and > you use the tracer. You want pids that are meaningful in your > subset of userspace, and not the global ones. Some tracers do a trace at every function call. This uses the gcc -pg option to set up the start of each function to call profiling code. Dynamic ftrace is a on the fly code modification to maintain good performance while tracing is disabled. Because of this being such a high critical path, can I get the namespace pid information directly from the task structure. Any function that is called must also be careful to not fall back into the tracer. The trace deals with self recursion, but functions that call back to the tracer cause a bigger performance impact while tracing. -- Steve -- 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/