From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17816 invoked by alias); 12 Oct 2005 09:41:09 -0000 Mailing-List: contact systemtap-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sources.redhat.com Received: (qmail 17799 invoked by uid 22791); 12 Oct 2005 09:41:06 -0000 Subject: Bug and question From: Sebastien Decugis To: SystemTAP Organization: Bull S.A. Date: Wed, 12 Oct 2005 09:41:00 -0000 Message-Id: <1129110154.7277.49.camel@decugiss.frec.bull.fr> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) X-MIMETrack: Itemize by SMTP Server on ECN002/FR/BULL(Release 5.0.12 |February 13, 2003) at 12/10/2005 11:54:25, Serialize by Router on ECN002/FR/BULL(Release 5.0.12 |February 13, 2003) at 12/10/2005 11:54:41, Serialize complete at 12/10/2005 11:54:41 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Virus-Scanned: by amavisd-new at frec.bull.fr X-SW-Source: 2005-q4/txt/msg00035.txt.bz2 Hi all, --- bug --- Running the latest snapshot posted on this mailing-list (on saturday), I've run into a bug: when using the "substr" function, 'man stapfuncs' tells that the third argument is an offset, but it appears to be an absolute position. As an example we have: str = "abcdef" sstr = substr(str, 2, 3) here, sstr is "c" whereas it should be "cde" according to man. --- question --- I want to access a structure field of a parameter which is a char table, and I want to display it as a string. Is it possible? Here is what I want to do: * kernel code: struct net_device { char name[LEN]; ... } int dev_put(struct net_device *dev) { ... } * stap code: probe kernel.function("dev_put") { print("device name: " . $dev->name . "\n") } This doesn't work yet, stap complains that $dev->name is of type 'long'... Is there a workaround? I think I only get the 'name' address yet (can be displayed if casted to a string). How can I get the string? Thanks in advance, and SystemTap is a great tool :) Seb. -- Sebastien Decugis Bull S.A.