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.