From owner-freebsd-hackers@FreeBSD.ORG Mon May 31 17:52:41 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12EAD1065679 for ; Mon, 31 May 2010 17:52:41 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id D74BD8FC17 for ; Mon, 31 May 2010 17:52:40 +0000 (UTC) Received: by pwj1 with SMTP id 1so211205pwj.13 for ; Mon, 31 May 2010 10:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=7aQAQ/ycwWooWaznAAfHXJrkJqGzRwiqrqvbexVMFC0=; b=HtC/xbq4WFCHnFGanqrzD05VTI5/HraHy1ZqQne9tQJ8WZ4oF6AA4tVikAHK8zObpb STqjZsV2MW68gS2o/oy4PnUzvUKYwuRyho/oBCNcExvV2m16HRTMH40WnFOc3/9FBjo6 byqhP4bm+sRf9HcuOLNzWzBTjuoP8yE58FI1w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=w/P9VXr3f8QXmL/bLiULN9Gx1u+TpvFKyvpl2xQ0GP10d5LFpVt8QHSmkA22aRfJkA B60yRMvDIi91Kr+yu6CzvyhUFfxPzue2UI3T1NaYkg2CxUwGcsLWlSwhbKaOsCv5aKy2 9Oy+hYIwxhInyLA7Giismu1gBmffXmtvc4CVU= MIME-Version: 1.0 Received: by 10.141.91.9 with SMTP id t9mr3560127rvl.53.1275328360183; Mon, 31 May 2010 10:52:40 -0700 (PDT) Sender: artemb@gmail.com Received: by 10.141.40.4 with HTTP; Mon, 31 May 2010 10:52:40 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 May 2010 10:52:40 -0700 X-Google-Sender-Auth: o_frld8eM13G9cKndZPS9cdHAJs Message-ID: From: Artem Belevich To: Shrikanth Kamath Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: DTrace and CTF data X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 17:52:41 -0000 >>> If I do a 'objdump' on the kernel.debug binary I do not see any CTF sec= tions showing up? Reference to 'objdump' combined with the fact that 80% of the message was dedicated to disassembly suggested that by "CTF section" you actually meant "probe". > If the CTFCONVERT ran successfully I should be able to see a=A0.SUNW_ctf > section when I run objdump --section-headers. Now it's clear that you indeed are looking for .SUNW_ctf section. My apologies for assuming too much. I should've asked to clarify the question first. > So if I ran the CTFCONVERT=A0utility on a *binary*, it should append CTF = sections to it should it not ? It should, provided it's run properely and that there's something to append. For what it's worth, .SUNW_ctf *is* present in my kernel built with WITH_CTF=3D1: $ objdump --section-headers /boot/kernel/kernel |grep SUNW 24 .SUNW_ctf 00044fe5 0000000000000000 0000000000000000 0062f01c 2= **2 That said, FBT provider may figure out function location based on plain old ELF symbols. For that CTF may not be needed. However, it may not be able to provide function and argument types if CTF info is not present. What does "dtrace -l -f kernel_function -v" show? Does it display proper info about argument types for entry/exit? --Artem On Mon, May 31, 2010 at 9:44 AM, Shrikanth Kamath w= rote: > Thanks Artem, but I was actually asking about the CTF info, I always thou= ght > the > probes used the CTF info for *knowing* where to instrument. So if I ran t= he > CTFCONVERT > utility on a *binary*, it should append CTF sections to it should it not = ? > If the CTFCONVERT ran successfully I should be able to see a=A0.SUNW_ctf > section when I run objdump --section-headers. But since this was not ther= e > in the binary > but still FBT was able to instrument the *entry* of the function I was > curious does FBT provider > need the CTF info for function entry/return ? > > -- > Shrikanth R K > > On Mon, May 31, 2010 at 2:21 AM, Artem Belevich wrote: >> >> You may be confusing CTF info and the probes. Those are different things= . >> >> CTF info just describes data types and variable/function location. >> DTrace later uses it to figure out where and how to install the >> probes. >> >> Probes are installed dynamically, at runtime when DTrace program is >> run. That's why you see it with kgdb on the live kernel once probe has >> been installed. >> DTrace does not modify your original kernel binary, so you will not >> see any probes there. >> >> --Artem >> >> >> >> On Sun, May 30, 2010 at 12:10 PM, Shrikanth Kamath >> wrote: >> > I have a query about the FBT provider in DTrace, does FBT provider not >> > need >> > the CTF info for the /kernel binary... >> > >> > I have this observation, when I disassemble say a 'kernel_funtion' , I >> > see >> > the function is not instrumented... >> > >> > (kgdb) disassemble kernel_function >> > Dump of assembler code for function kernel_function: >> > 0xc04aa05d : push =A0 %ebp >> > 0xc04aa05e : mov =A0 =A0%esp,%ebp >> > 0xc04aa060 : sub =A0 =A0$0x2c,%esp >> > >> > >> > Now after I did a 'fbt::kernel_function:entry', if I disassemble the >> > 'kernel_function'... >> > >> > (kgdb) disassemble kernel_function >> > Dump of assembler code for function kernel_function: >> > 0xc04aa05d : lock mov %esp,%ebp =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 <=3D=3D >> > FBT >> > instrumentation >> > 0xc04aa060 : sub =A0 =A0$0x2c,%esp >> > >> > If I do a 'objdump' on the kernel.debug binary I do not see any CTF >> > sections >> > showing up? >> > >> > >> > -- >> > Shrikanth R K >> > _______________________________________________ >> > freebsd-hackers@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> > To unsubscribe, send any mail to >> > "freebsd-hackers-unsubscribe@freebsd.org" >> > > >