From owner-freebsd-current@FreeBSD.ORG Wed Oct 15 15:34:38 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3636D106568B for ; Wed, 15 Oct 2008 15:34:38 +0000 (UTC) (envelope-from simias.n@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by mx1.freebsd.org (Postfix) with ESMTP id E250F8FC1D for ; Wed, 15 Oct 2008 15:34:37 +0000 (UTC) (envelope-from simias.n@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so653334ywe.13 for ; Wed, 15 Oct 2008 08:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=FDwlRl7mAVtwDLAKG7aoiVJozRxO81n7XYhQJLzhvfk=; b=YA40ur1tm0uyKuUACThpln4sGovA9Je8c/U7iK/m4W1kUNeS4dq1nkpqGpRgN1ndtz A8HidwSjKUWISuUU7QHBbyuraeYEvvp4V9MmY5nnxiicW0Wp9uLOcplVapiiax1Swisk NSSbokE4FdG1sy73+w2TprwBAyYd3J6p7F41E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=YaP2gADXEQea5C8l9zoZDQVrAJfr7CiGvWIws9ZTgl+N4k1QUWE21YlGKhPkwIhaB6 FIePTNQv2feAOdY2RCQ8Gu6Lualszg5OqpN8H4H9XEiPCWGHzgpoMVhWUrf4YK7hFffh VPmt7dAg5Lg4TqaLvrTmkEczgZ/0pm284a/O4= Received: by 10.103.137.19 with SMTP id p19mr635229mun.108.1224084875986; Wed, 15 Oct 2008 08:34:35 -0700 (PDT) Received: from localhost (mol92-6-82-240-252-219.fbx.proxad.net [82.240.252.219]) by mx.google.com with ESMTPS id w5sm266265mue.10.2008.10.15.08.34.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 15 Oct 2008 08:34:34 -0700 (PDT) Date: Wed, 15 Oct 2008 17:34:24 +0200 From: Lionel Flandrin To: Roman Divacky Message-ID: <20081015153424.GA4204@casibsd.elexo.fr.local> References: <20081015090453.GA1995@casibsd.elexo.fr.local> <20081015123953.GA99605@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081015123953.GA99605@freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-current@freebsd.org, Lionel Flandrin Subject: Re: DTrace complains about struct thread X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2008 15:34:38 -0000 On Wed, Oct 15, 2008 at 02:39:53PM +0200, Roman Divacky wrote: > On Wed, Oct 15, 2008 at 11:04:53AM +0200, Lionel Flandrin wrote: > > I tried to play with DTrace on a fresh FreeBSD 7.1, so I followed the > > steps described here: > > http://www.freebsd.org/doc/en/books/handbook/book.html#DTRACE > > > > I added these options to my kernel config: > > ,---- > > | options KDTRACE_HOOKS > > | options DDB_CTF > > | options KDTRACE_FRAME > > `---- > > > > And rebuilt everything with "WITH_CTF=1" > > (http://www.freebsd.org/doc/en/books/handbook/book.html#DTRACE-ENABLE > > says make *WITH_CTF*=1 buildworld and then make *WITH_CFT* afterwards, > > is it a typo? If not I think it should be more explicit because it > > really looks like one). > > > > I restarted the computer, kldloaded the dtraceall module and dtrace -l > > seems to work right: > > ,---- > > | # dtrace -l | wc -l > > | 25825 > > `---- > > > > However, whenever I try to trace something, I get: > > ,---- > > | # dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }' > > | dtrace: invalid probe specifier proc:::exec-success { > > | trace(curpsinfo->pr_psargs); }: > > | "/usr/lib/dtrace/psinfo.d", line 88: > > | failed to resolve type kernel`struct thread * for identifier > > | curthread: Unknown type name > > `---- > > > > Same message with ./hotkernel from the DTraceToolkit and everything > > else I've tried: > > ,---- > > | "/usr/lib/dtrace/psinfo.d", line 88: failed to resolve type > > | kernel`struct thread * for identifier curthread: Unknown type name > > `---- > > > > line 88 of /usr/lib/dtrace/psinfo.d is: > > ,---- > > | inline psinfo_t *curpsinfo = xlate (curthread->td_proc); > > `---- > > > > ,---- > > | # uname -a > > | FreeBSD casibsd 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Tue Oct 14 > > | 11:40:44 CEST 2008 root@casibsd:/usr/obj/usr/src/sys/CASIBSD_CONF > > | amd64 > > `---- > > > > What am I doing wrong? > > if I am not mistaken FreeBSD currently does not support userland tracing. > this might be the cause, though the error message is strange > > roman Mmmh, and I've just noticed that gcc aborts when I try to execute it (but not g++): ,---- | $ /usr/bin/gcc | Abort trap | $ objdump -h /usr/bin/gcc | | /usr/bin/gcc: file format elf64-x86-64 | | Sections: | Idx Name Size VMA LMA File off Algn | 0 .init 00000013 0000000000400100 0000000000400100 00000100 2**2 | CONTENTS, ALLOC, LOAD, READONLY, CODE | 1 .text 0003422e 0000000000400120 0000000000400120 00000120 2**4 | CONTENTS, ALLOC, LOAD, READONLY, CODE | 2 .fini 0000000e 0000000000434350 0000000000434350 00034350 2**2 | CONTENTS, ALLOC, LOAD, READONLY, CODE | 3 .rodata 0001972e 0000000000434360 0000000000434360 00034360 2**5 | CONTENTS, ALLOC, LOAD, READONLY, DATA | 4 .data 000039a8 000000000054e000 000000000054e000 0004daa0 2**5 | CONTENTS, ALLOC, LOAD, DATA | 5 .eh_frame 00005038 00000000005519a8 00000000005519a8 00051448 2**3 | CONTENTS, ALLOC, LOAD, READONLY, DATA | 6 .ctors 00000010 00000000005569e0 00000000005569e0 00056480 2**3 | CONTENTS, ALLOC, LOAD, DATA | 7 .dtors 00000018 00000000005569f0 00000000005569f0 00056490 2**3 | CONTENTS, ALLOC, LOAD, DATA | 8 .jcr 00000008 0000000000556a08 0000000000556a08 000564a8 2**3 | CONTENTS, ALLOC, LOAD, DATA | 9 .bss 00004f40 0000000000556a20 0000000000556a20 000564c0 2**5 | ALLOC | 10 .comment 00003c35 0000000000000000 0000000000000000 000564c0 2**0 | CONTENTS, READONLY | 11 .note.ABI-tag 00000018 00000000004000e8 00000000004000e8 000000e8 2**2 | CONTENTS, ALLOC, LOAD, READONLY, DATA | 12 .SUNW_ctf 00000c4f 0000000000000000 0000000000000000 0005a0f8 2**2 | CONTENTS, READONLY `---- Well, I guess I'll try dtrace again some other day then... -- Lionel Flandrin