From patchwork Sat Mar 21 01:50:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 6062841 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E9009F399 for ; Sat, 21 Mar 2015 01:50:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 802C52026D for ; Sat, 21 Mar 2015 01:50:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 621EF20266 for ; Sat, 21 Mar 2015 01:50:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751305AbbCUBuZ (ORCPT ); Fri, 20 Mar 2015 21:50:25 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:36468 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751251AbbCUBuZ (ORCPT ); Fri, 20 Mar 2015 21:50:25 -0400 Received: by labe2 with SMTP id e2so24109659lab.3 for ; Fri, 20 Mar 2015 18:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=rEJsinXn9IGAa3HsmBNsOMD8btYmO3K3rr4rjg4i+XU=; b=UH68ek9jivADZwAPvleNmLyti91etgwdiHtyTXMHFuRza/HCLCJcFUTYme6ftz0hVV 7gEqr3VjWUvmyMcGLKZNeqzdePc8uNYi/HkzNzi2bWJh0vMKXhN8VIbY2MrHOCbffh5x yHtABd2Zc2vekezcnZlIH5vwUU2KVnsW1lttw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rEJsinXn9IGAa3HsmBNsOMD8btYmO3K3rr4rjg4i+XU=; b=MTQP4w1PhAaxujxAlaqssLxe928zoPb9ak2NNyYUHYo6ijDorZFBxqZog4/QEiibzq DrnzaPoD3cOxyYHkcMxlXt4bZfAlnCoXwGaliqGkHlTgo6gCvqzuZxA7mADMwDgDa67d NnnM2p/JBv+dmn8wxFbH7fvENxM5SJQVHc76jMnDyX+WLCFi82G0NYyMxLVBczZ+Lhrh tQIxnIS54qUucOVj895qnH/YmbL7YHqdZOQufU2For7GC94dI/JKCrz0tM8mgdPP01a6 pQHjYIdgEFFWiE63xlLXNEuOs6D0BO2vgw1ehTKD9Ox+lGQrQfgOqulTN0cIOVmtiwqr 1BPg== X-Gm-Message-State: ALoCoQkulY5hv98RZoRM6u0E8dbcV9DWXcvLG4sIliiA0r2n9Xe7dMIrTba8foqhLh4TBc6phuGB X-Received: by 10.112.223.7 with SMTP id qq7mr75389958lbc.81.1426902623438; Fri, 20 Mar 2015 18:50:23 -0700 (PDT) Received: from spencer.imf.au.dk ([130.225.20.51]) by mx.google.com with ESMTPSA id je5sm1256953lac.33.2015.03.20.18.50.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 18:50:22 -0700 (PDT) From: Rasmus Villemoes To: Michal Marek , Andrew Morton Cc: linux-kbuild@vger.kernel.org, Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: include core debug info when DEBUG_INFO_REDUCED Date: Sat, 21 Mar 2015 02:50:01 +0100 Message-Id: <1426902601-13524-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With CONFIG_DEBUG_INFO_REDUCED, we do get quite a lot of debug info (around 22.7 MB for a defconfig+DEBUG_INFO_REDUCED). However, the "basenames must match" rule used by -femit-struct-debug-baseonly option means that we miss some core data structures, such as struct {device, file, inode, mm_struct, page} etc. We can easily get these included as well, while still getting the benefits of CONFIG_DEBUG_INFO_REDUCED (faster build times and smaller individual object files): All it takes is a dummy translation unit including a few strategic headers and compiled with a flag overriding -femit-struct-debug-baseonly. This increases the size of .debug_info by ~0.3%, but these 90 KB contain some rather useful info. Signed-off-by: Rasmus Villemoes --- lib/Makefile | 3 +++ lib/debug_info.c | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 lib/debug_info.c diff --git a/lib/Makefile b/lib/Makefile index 58f74d2dd396..3d788091d60c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -45,6 +45,9 @@ CFLAGS_kobject.o += -DDEBUG CFLAGS_kobject_uevent.o += -DDEBUG endif +obj-$(CONFIG_DEBUG_INFO_REDUCED) += debug_info.o +CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any) + obj-$(CONFIG_GENERIC_IOMAP) += iomap.o obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o diff --git a/lib/debug_info.c b/lib/debug_info.c new file mode 100644 index 000000000000..2edbe27517ed --- /dev/null +++ b/lib/debug_info.c @@ -0,0 +1,27 @@ +/* + * This file exists solely to ensure debug information for some core + * data structures is included in the final image even for + * CONFIG_DEBUG_INFO_REDUCED. Please do not add actual code. However, + * adding appropriate #includes is fine. + */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include