From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 9 21:18:09 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D25E585B for ; Tue, 9 Apr 2013 21:18:09 +0000 (UTC) (envelope-from jrisom@gmail.com) Received: from mail-ia0-x230.google.com (mail-ia0-x230.google.com [IPv6:2607:f8b0:4001:c02::230]) by mx1.freebsd.org (Postfix) with ESMTP id A3A97EB1 for ; Tue, 9 Apr 2013 21:18:09 +0000 (UTC) Received: by mail-ia0-f176.google.com with SMTP id i1so6602715iaa.7 for ; Tue, 09 Apr 2013 14:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=nQQUXZThu7JHKO2QU65NUIodzQzZXj52KG6WzYwwxgA=; b=nBd8lyAE9GMNHR2ETvR4DL/+Wk74Vrz+ohEZ8R8RdBjsxTGZAXny4pFahA3x+RB2qa PoX4WJxG+0s5muEHJtwO7zC1SMWT62ydLG66Rjxpy3nwq2OPuqCa79c1T2EPXq3K4chH 006t0TYAQKBx2/N/WWbG6TAc+WzM27lGuiUfgDEJ2toTTo8ymeUzxmldpeejglYrHCrH 8TZ8r4icKHFL2+rhbwe33Cu+h4fQMJFo6vsv+4yHXLSNtCLLEvVLqtghqIZqr1BaF4kT DAxgGq7nmxcQ8SWaE3LWlEPouqf+j3Gv/jzeiofc6IArN5QHvDV0OinomB6wKPvqF06O 568g== X-Received: by 10.50.181.201 with SMTP id dy9mr11427492igc.18.1365542289344; Tue, 09 Apr 2013 14:18:09 -0700 (PDT) Received: from [192.168.1.34] (c-98-212-197-211.hsd1.il.comcast.net. [98.212.197.211]) by mx.google.com with ESMTPS id hi4sm26992702igc.6.2013.04.09.14.18.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Apr 2013 14:18:08 -0700 (PDT) Message-ID: <51648588.7010209@gmail.com> Date: Tue, 09 Apr 2013 16:18:00 -0500 From: Joshua Isom User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: GSOC 2013 project " Kernel Size Reduction for Embedded System " References: <516452C7.7040607@mu.org> <92799D4C-797C-4304-B299-DD1DBA49CFFC@FreeBSD.org> In-Reply-To: <92799D4C-797C-4304-B299-DD1DBA49CFFC@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2013 21:18:09 -0000 On 4/9/2013 1:47 PM, Edward Tomasz NapieraƂa wrote: > In order to optimize - in this case for size - we need a way to measure > what should we focus on, and it looks like we don't have it yet. > > Would it be possible to write a tool - e.g. by instrumenting LLVM - that > would make it possible to calculate, for every function in the call graph, > the amount of code in that function and everything it "pulls in", i.e. all > the code paths that it might call. When we have that, clustering the graph > should give us some idea what to focus on. > > Or perhaps such a tool already exists? > Would clang's LTO help for size? I know work's starting on the bsd elftools ld, but I doubt it has any LTO support yet. Running -Os on the kernel as a whole instead of object files could probably help a lot also. I might try to set it up and see a size comparision. Also, what about the userland? Linux got popular for embedded partly for busybox and uclibc. If Linux didn't exist, someone would have ported minix instead.