From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12458 invoked by alias); 24 Oct 2008 15:27:32 -0000 Received: (qmail 12447 invoked by uid 22791); 24 Oct 2008 15:27:31 -0000 X-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from qw-out-1920.google.com (HELO qw-out-1920.google.com) (74.125.92.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Oct 2008 15:26:56 +0000 Received: by qw-out-1920.google.com with SMTP id 9so333968qwj.26 for ; Fri, 24 Oct 2008 08:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=twTbet2CPP2y4Ui8Hj6FolbL91P4TN0SiaebE4aFC88=; b=xU/nGlvsD9kqOogE2L0BdskxPGJ29Q9/5/xJ69r64qtylGpI5R23bNvKPPfEG7ZwqM G9sNdZ5WL+gL8NxDmF27O6JOlihBcHQAqW+bg3wDeCUQjSpID80loFx4/Qd+t5urHKjF dbHmb1dZoALUkA+yJzI6LmtlGgBnIy2b3xlKc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ixLgmfK4a3RXzIB0TicIfsk5BfB5IuDBuBRzuedv2o4biuNkBBL1oh8aiREoBaHnHw QizhIG7dLGEFaOBbu/M1H4tJVdgAn1Szupcr/DKrm0JFQ0OelNHRvmrWFd3QbqXf1dfA gYnt+d/+o0AHCUoGBPi7ooUy5UrKFwe1uF2XA= Received: by 10.215.67.14 with SMTP id u14mr2795265qak.3.1224862013601; Fri, 24 Oct 2008 08:26:53 -0700 (PDT) Received: by 10.215.101.8 with HTTP; Fri, 24 Oct 2008 08:26:53 -0700 (PDT) Message-ID: Date: Fri, 24 Oct 2008 15:27:00 -0000 From: "=?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?=" To: "Frank Ch. Eigler" Subject: Re: [PATCH 5/5] tracing/ftrace: Introduce the big kernel lock tracer Cc: "Steven Rostedt" , "Ingo Molnar" , linux-kernel@vger.kernel.org, systemtap@sources.redhat.com In-Reply-To: <20081024150239.GB20768@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48F10B0B.406@gmail.com> <20081024143744.GA20768@redhat.com> <20081024150239.GB20768@redhat.com> Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2008-q4/txt/msg00202.txt.bz2 2008/10/24 Frank Ch. Eigler : > That's what we do with the systemtap script, where kernel "handling" > consists of "running the machine code". > >> But have the user application interface be very simple, and perhaps >> even use perl or python. > > perl and python are pretty big procedural languages, and are not > easily compiled down to compact & quickly executed machine code. (I > take it no one is suggesting including a perl or python VM in the > kernel.) Plus, debugger-flavoured event-handling programming style > would not look nearly as compact in perl/python as in systemtap, which > is small and domain-specific. > > - FChE > Actually what I thought is a style like this (Python like): probe = Systemtap.probeFunc("lock_kernel") probe.captureUtime("utime")) probe.captureBacktrace("trace") probe.trace() For an obvious set of batch work like that, that could be possible, perhaps even easy to implement an Api... When the object calls trace(), the userspace Systemtap analyse the list of work to do and then translate into commands in kernel space. And the script could wait for events and then do its own processing with the captured events (do some operations on delays, on output....). for event in probe.getEvent(): #blocking print event["utime"] trace = event["trace"] #Systemtap.trace object with specific fields and a default string repr print trace It would be interpreted by Python itself, and you just have to capture commands and works sent through Api. Then, when the kernel has something to give, you just have to place it in the appripriate object and transmit it to the script which is waiting. Processing and output with the data are done by the python script. So actually, the python script only needs to ask you what data to capture. It's its own responsability to do wathever it wants with. What do you think?