From owner-freebsd-dtrace@FreeBSD.ORG Fri Sep 6 23:21:26 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A61C1B1; Fri, 6 Sep 2013 23:21:26 +0000 (UTC) (envelope-from kshrikanth@juniper.net) Received: from db8outboundpool.messaging.microsoft.com (mail-db8lp0184.outbound.messaging.microsoft.com [213.199.154.184]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B36824AC; Fri, 6 Sep 2013 23:21:24 +0000 (UTC) Received: from mail43-db8-R.bigfish.com (10.174.8.237) by DB8EHSOBE007.bigfish.com (10.174.4.70) with Microsoft SMTP Server id 14.1.225.22; Fri, 6 Sep 2013 22:20:51 +0000 Received: from mail43-db8 (localhost [127.0.0.1]) by mail43-db8-R.bigfish.com (Postfix) with ESMTP id DD8C64400CA; Fri, 6 Sep 2013 22:20:50 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.224.54; KIP:(null); UIP:(null); IPV:NLI; H:P-EMF01-SAC.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zzzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de097hz2fh2a8h839hf0ah107ah1288h12a5h12a9h12bdh12e5h137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1b2fh1fb3h1d0ch1d2eh1d3fh1ef4h1dc1h1dfeh1dffh1e1dh1fe8h1ff5h1155h) Received-SPF: pass (mail43-db8: domain of juniper.net designates 66.129.224.54 as permitted sender) client-ip=66.129.224.54; envelope-from=kshrikanth@juniper.net; helo=P-EMF01-SAC.jnpr.net ; SAC.jnpr.net ; Received: from mail43-db8 (localhost.localdomain [127.0.0.1]) by mail43-db8 (MessageSwitch) id 1378506049241358_31858; Fri, 6 Sep 2013 22:20:49 +0000 (UTC) Received: from DB8EHSMHS021.bigfish.com (unknown [10.174.8.236]) by mail43-db8.bigfish.com (Postfix) with ESMTP id 370B94600B4; Fri, 6 Sep 2013 22:20:49 +0000 (UTC) Received: from P-EMF01-SAC.jnpr.net (66.129.224.54) by DB8EHSMHS021.bigfish.com (10.174.4.31) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 6 Sep 2013 22:20:49 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF01-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Fri, 6 Sep 2013 15:20:48 -0700 Received: from svl-junos-d025.juniper.net (svl-junos-d025.juniper.net [172.17.29.93]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r86MKmL04267; Fri, 6 Sep 2013 15:20:48 -0700 (PDT) (envelope-from kshrikanth@magenta.juniper.net) Received: from svl-junos-d025.juniper.net (svl-junos-d025.juniper.net [172.17.29.93]) by svl-junos-d025.juniper.net (8.14.3/8.14.4) with ESMTP id r86MKmrO040877; Fri, 6 Sep 2013 15:20:48 -0700 (PDT) (envelope-from kshrikanth@svl-junos-d025.juniper.net) Received: (from kshrikanth@localhost) by svl-junos-d025.juniper.net (8.14.3/8.14.3/Submit) id r86MKmPC040872; Fri, 6 Sep 2013 15:20:48 -0700 (PDT) (envelope-from kshrikanth) Date: Fri, 6 Sep 2013 15:20:48 -0700 Message-ID: <201309062220.r86MKmPC040872@svl-junos-d025.juniper.net> To: , From: Subject: Glitch in ctfconvert MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: juniper.net X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: kshrikanth@juniper.net X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 06 Sep 2013 23:21:26 -0000 There is a glitch with ctfconvert builds the .SUNW_ctf section. It affects debugging the kernel modules with FBT provider of DTrace. I observe that the CTF sections built for the kernel modules have a problem if module symtab stripped or if the symbol table has symbols reordered. This messes up the FBT probes and shows wrong function name against a set of arguments. I presume the ctf mapping of a function to its arguments is done this way after looking at ctfdump code. func_name from symtab arguments dump from ctf_data_t ^ ^ |___symidx____ctfdump_____________| The detais are fetched from two different places. So when ctfconvert is run the function arguments are mapped with a particular symbol order. Post the linker stage the symbols may get reordered. Or if a strip utility is run the symtab may be removed completely. When first ctfconvert is run on module.kld symbol_X (idx 1) <-> [args set a in ctf_data_t] symbol_Y (idx 2) <-> [args set b in ctf_data_t] if symbols get re-arranged post the linker stage symbol_Y (idx 1) <-> [args set a in ctf_data_t] symbol_X (idx 2) <-> [args set b in ctf_data_t] which means symbol_Y now has args set of symbol_X Or if 'strip' is run it has totally junk shown against symbol_Y and symbol_X. Overall this affects when we do a Function Boundary Tracing on the functions to inspect arguments. From owner-freebsd-dtrace@FreeBSD.ORG Fri Sep 6 23:49:57 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 647BAD1; Fri, 6 Sep 2013 23:49:57 +0000 (UTC) (envelope-from shrikanth07@gmail.com) Received: from mail-vc0-x22c.google.com (mail-vc0-x22c.google.com [IPv6:2607:f8b0:400c:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1808327E7; Fri, 6 Sep 2013 23:49:57 +0000 (UTC) Received: by mail-vc0-f172.google.com with SMTP id m17so2616780vca.17 for ; Fri, 06 Sep 2013 16:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=nx9j1tPvNPZKopY+Lr9A0v33BXahgpY9iygPVsigij0=; b=znnNyS1LzAP8pQfiPYrqbQRfsq/cnHAXzpjziqo3V5L4OFF2L+Iy+QYpi+pX+8gLQH sGWomN9OSaCSSxXOZ7BtrJd0BkPokXT+MrnavjYACAhdB/9/suyw0rzO1I3NXURxHdFL TJYeHn5BqdCK5K1WIw2W6KTdQZUhYmzPhCBsLKx3TZZzzq1y7rcZ2TM2hztTey4jkqJx Xl7RLerwkaUd8M/KgYBvVZnPdukcjquJ5gbWOV/IHSgeXWRm0Lgx0AW7gvcPiQhFSdQk poZdBwk82nk5EfdcQlcvTEceQnZJg4fFGFcWlit2P+izLD87F+nN+0FoiI5pMbBeztti PSng== MIME-Version: 1.0 X-Received: by 10.58.198.13 with SMTP id iy13mr4799048vec.11.1378511396144; Fri, 06 Sep 2013 16:49:56 -0700 (PDT) Received: by 10.59.1.70 with HTTP; Fri, 6 Sep 2013 16:49:56 -0700 (PDT) Date: Fri, 6 Sep 2013 16:49:56 -0700 Message-ID: Subject: Glitch in ctfconvert From: Shrikanth Kamath To: freebsd-hackers@freebsd.org, freebsd-dtrace@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 06 Sep 2013 23:49:57 -0000 There is a glitch with ctfconvert builds the .SUNW_ctf section. It affects debugging the kernel modules with FBT provider of DTrace. I observe that the CTF sections built for the kernel modules have a problem if module symtab stripped or if the symbol table has symbols reordered. This messes up the FBT probes and shows wrong function name against a set of arguments. I presume the ctf mapping of a function to its arguments is done this way after looking at ctfdump code. func_name from symtab arguments dump from ctf_data_t ^ ^ |___symidx____ctfdump_____________| The detais are fetched from two different places. So when ctfconvert is run the function arguments are mapped with a particular symbol order. Post the linker stage the symbols may get reordered. Or if a strip utility is run the symtab may be removed completely. When first ctfconvert is run on module.kld symbol_X (idx 1) <-> [args set a in ctf_data_t] symbol_Y (idx 2) <-> [args set b in ctf_data_t] if symbols get re-arranged post the linker stage symbol_Y (idx 1) <-> [args set a in ctf_data_t] symbol_X (idx 2) <-> [args set b in ctf_data_t] which means symbol_Y now has args set of symbol_X Or if 'strip' is run it has totally junk shown against symbol_Y and symbol_X. Overall this affects when we do a Function Boundary Tracing on the functions to inspect arguments.