From owner-freebsd-dtrace@FreeBSD.ORG Thu Jan 9 20:50:47 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C6AD483 for ; Thu, 9 Jan 2014 20:50:47 +0000 (UTC) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B84701DAB for ; Thu, 9 Jan 2014 20:50:40 +0000 (UTC) Received: from [66.196.81.172] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 09 Jan 2014 20:44:53 -0000 Received: from [98.139.211.203] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 09 Jan 2014 20:44:53 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 09 Jan 2014 20:44:53 -0000 X-Yahoo-Newman-Id: 72630.22785.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: QkGNyRQVM1nNoPD6hVWCcEmejk2raqsVFXSCAy6bB.4_jlF ZHgHBim0qhU02Xvmi4jfC.ZNtohpvE08iZxU7cGo3D3Nxcju.M3UHip02Wgp HdQ8heEf1xHzmFXha0dwjvEfatp0kJPbl55m3TuoJpKAfA_ccmMDerBErlyN C5FtFJp5N.8SGrvFe.HQMYqnydUzZ7Rf_wbLM.MK0k_sWsm_LQ9L98s4AtE4 lNw11taOeloohiz_F6p0cTbRN5_bFQMhmPqe_yBebTqo622sivCsy.ID6aNQ Js4rBwOz1GXK1rGeA8kC8E8WBRKpcSj5noJ0ibN3yC8OKVlKXXY7O1Dzwctt HEnvkQ5ERrV1jPDU4nAEov6BgM..cZW5.TScVRgEASQwzcydan1PyxZd5bxZ d2_4LFZ7TyIdVZbm5L6rElVh8ufxQtmm9XAwxCZltXdCRCODkPz4MqD0q2tD 4Z58labQoBGNybioaB9Kzw_ACfV2zyfJkrCrbFjwXgOfgqq4vjcs.cBPVOIy ARtKEg0iGgoatwl_V_rBhP4ni3l0dkbtDy0WQCv3JFVF1CmzwfWMDILeWhch Ruhmn_4e9Kt9nNHq5BcacZeYmh3Rwi2RXp2qDp8duXYAqqE4zfuX7ePLlxkv FStGW7N9hwbpt.F9YDAFlhkVxZtcMwsxQSaokRgWY25adyA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp212.mail.bf1.yahoo.com with SMTP; 09 Jan 2014 12:44:53 -0800 PST Message-ID: <52CF0A42.6090601@FreeBSD.org> Date: Thu, 09 Jan 2014 15:44:50 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Robert Mustacchi , freebsd-dtrace@freebsd.org Subject: Re: CTF vs dwarf4 References: <52CEEE3B.7010400@FreeBSD.org> <52CEFA91.3090301@joyent.com> In-Reply-To: <52CEFA91.3090301@joyent.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2014 20:50:47 -0000 Hi Robert; On 09.01.2014 14:37, Robert Mustacchi wrote: > On 1/9/14 10:45 , Pedro Giffuni wrote: >> Hello; >> >> Just thought I'd point out, for those not following toolchain@, that >> there are issues with newer compilers using dwarf4 by default[1]. >> >> It looks like instead of waiting for the elftoolchain project to catch >> up with the dwarf standard we could be using dwarf support from LLVM >> instead though [2]. >> >> Apparently the linux dtrace port is having similar issues. Another task >> for the Dtrace TODO list I guess, but perhaps the Illumos guys following >> the list may have some input. > As one of the illumos folk following the list, I can kind of describe > what at least some of us would like to do with CTF. It's worth > mentioning that we're still using gcc4.4 so we're not in a realm where > DWARF4 is a concern for us yet. I'm not familiar with all the > differences yet, so I'm not sure how useful the rest of this e-mail will be. Great to have you here! > Currently I've been retooling ctfconvert + ctfmerge to be actually > implemented in terms of libctf to make it easier for other things to > actually consume, such as more long term illumos ld(1) and ideally the > compilers themselves. None of this code is finished or in illumos yet. > That really means that I have a slightly more useful merge (and as a > result diff) written, and convert is kind of a work in progress. As a side note ... completely unrelated to the issue at hand. I don't know much about how DTrace uses dwarf, but I had some contact with the Oracle guys doing the linux port and I think they are doing something drastically different to illumos (and FreeBSD). They are avoiding the issue of getting DTrace in the kernel and they are using dwarf2 instead of the stabs-like format supported by CTF. Their stuff is in a GIT repository somewhere but I would have to dig deep in my private email for the finer details. They were likely to have problems with dwarf4 too. > Probably the simplest way forward that we can all leverage is writing a > new ctfconvert in terms of DWARF4 that can exist side by side the old > one. eg. if you have an older compiler with dwarf2 (or you're still > stuck with stabs or some other language has its own exquisite format), > that'll still work. illumos last updated libdwarf in 2011. If there's a > newer libdwarf that has better DWARF4 support or we need to come up with > something else, let's make sure not to duplicate effort. I recall Illumos is using SGI's libdwarf which we have avoiding using mainly because it's copyleft but I recall there were also some implementation details that made it undesirable. I haven't followed the SGI libdwarf but when I last tried to update the pre-packaged port I noticed it was becoming more difficult to port to non-linux (that may have been solved though). Some FreeBSD developers reimplemented libelf and libdwarf specifically to use it in DTrace: http://sourceforge.net/p/elftoolchain/wiki/libdwarf/ Their implementation is very clean and portable and it's basically what we have been using but we have to update it and I am not sure about their dwarf4 support. If illumos and freebsd can use the same libdwarf than that would be good. OTOH, with llvm having support for dwarf4 it would certainly be tempting to try to integrate what we can with the toolchain. I don't see illumos advancing much in the llvm direction though, so this option would be good for FreeBSD but probably not for illumos. FreeBSD 10+ has moved to llvm/clang already and, as noted in the previous posting, FreeBSD 11 is using the latest clang with dwarf4 so the issue became urgent. Pedro.