From owner-freebsd-current@freebsd.org Mon Sep 14 10:09:08 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5950A0391E for ; Mon, 14 Sep 2015 10:09:07 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward5h.mail.yandex.net (forward5h.mail.yandex.net [IPv6:2a02:6b8:0:f05::5]) by mx1.freebsd.org (Postfix) with ESMTP id A32F810B4; Mon, 14 Sep 2015 10:09:07 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web1h.yandex.ru (web1h.yandex.ru [IPv6:2a02:6b8:0:f05::11]) by forward5h.mail.yandex.net (Yandex) with ESMTP id 62EBED0063A; Mon, 14 Sep 2015 13:08:58 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web1h.yandex.ru (Yandex) with ESMTP id C34321CE2842; Mon, 14 Sep 2015 13:08:57 +0300 (MSK) Received: by web1h.yandex.ru with HTTP; Mon, 14 Sep 2015 13:08:56 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Mark Johnston Cc: FreeBSD CURRENT In-Reply-To: <20150913205333.GA2444@muskytusk> References: <738721442150603@web6j.yandex.ru> <20150913205333.GA2444@muskytusk> Subject: Re: kernel dtrace and current MIME-Version: 1.0 Message-Id: <363291442225336@web1h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 14 Sep 2015 13:08:56 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 14 Sep 2015 10:09:08 -0000 13.09.2015, 23:54, "Mark Johnston" : > On Sun, Sep 13, 2015 at 04:23:23PM +0300, Alexander V. Chernikov wrote: >> šHello all, >> >> šI keep running in >> š"dtrace: failed to compile script: "/usr/lib/dtrace/psinfo.d", line 39: failed to copy type of 'pr_uid': Type information is in parent and unavailable" >> šmessage more and more often while trying to trace different -current kernels. >> >> šTypically the reason besides that is the number of types embedded in kernel CTF: >> šctfdump -S /boot/kernel/kernel | awk '$0~/of types/{print$6}' >> š37160 >> >> šWe are bound to 32k of types by CTF format (and numbers above 32k (e.g.w/ highest bit set) are considered "child" types with the information stored in "parent"). >> šctfmerge ignores this fact and instead of yelling emits type indices above 32k. On the other hand, libctf sees such indices while parsing sections and since there is no >> š"parent" for kernel, it emits the error above and stops. >> >> šThankfully, r287234 really improved the situation for ctfmerge, but there are still several thousands of identical structures and the total number is close to 32k. > > r281797 and r287234 should have fixed most instances of duplicate type > definitions. At the moment, amd64 GENERIC and GENERIC-NODEBUG have > roughly 25K types in their respective CTF containers; there is a small > handful of duplicates, but at least some of them are legitimate (some > pairs of drivers redefine the same types, e.g. aac(4)/aacraid(4) or > mps(4)/mpr(4)). > > Could you post a config that results in the large number of duplicates > you mention above? I did clean buildworld/installworld w/ clean buildkernel and the situation is really much better now: I've got only 27633 types, with 493 duplicates, so it is not _that_ close. (So I suppose that for some reason I got old ctfmerge) My config for that kernel: include GENERIC nomakeoptions DEBUG makeoptions DEBUG="-O2 -gdwarf-2" options KTR options KTR_MASK=(0) options KDB_TRACE options KDB_UNATTENDED options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER options MROUTING > >> šPersonally I solved this by removing unneeded devices from GENERIC-inherited configs. >> šI wonder, however if this can be handled better. > > FWIW, removing old drivers from GENERIC would be straightforward if we > could auto-load KLDs based on device IDs. > >> šE.g. either show better error in dtrace(1) or make ctfmerge fail causing kernel build to stop (since we asked for dtrace but in reality it wouldn't work), or remove some stale devices from GENERIC, or .something totally different? > > One more radical option is to extend the width of CTF type IDs. I've > been holding off on doing this for a few reasons: > - Doing so would change the binary format, making us incompatible with > ššthe reference CTF code in illumos. > - Type IDs are embedded in quite a few places in the various CTF > ššstructures, so enlarging them from 16 bits to 32 bits will bloat > ššCTF containers somewhat. > - I was under the impression that r287234 addressed the problem > ššsufficiently for now. > > If type ID space is still a problem post-r287234, I think it's time to > just go ahead and change the format. But first I'd like to understand > the cause of the duplication you're seeing.