From patchwork Wed Oct 23 03:18:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 3085891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B21949F372 for ; Wed, 23 Oct 2013 03:19:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC5BB202EA for ; Wed, 23 Oct 2013 03:19:28 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB61C202EC for ; Wed, 23 Oct 2013 03:19:27 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYoyg-0000fp-HE; Wed, 23 Oct 2013 03:19:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYoye-0002P7-3T; Wed, 23 Oct 2013 03:19:20 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYoya-0002Om-FZ for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2013 03:19:17 +0000 Received: by mail-pa0-f46.google.com with SMTP id rd3so14506pab.33 for ; Tue, 22 Oct 2013 20:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=AE7HwAdjx3oaKQaMJDSiDGD/Pvul7buwwKvRuOkBVYM=; b=bl3ifsfR1fVX/GG8yKwNlblcBC99Fqmo7f95ZPddMMg5s7Mpvu/gBx9FevTV6RsKQ3 CUYMBxSOmPHT0RtwK/hVWK5am4KvWahzOwq0u5uvXiANzC+eEm5bc/DImhngLPU/bwxW HJCPP/oCV2LxIXXqUukUXGKS1SbzQ6m4TL/hOFjGhVeDr9BhRM+FudeKYq2qsB/0sSY3 VQj0A+bLZqGdWK3UOLI7NmKo5sJxt4adhWBwl5X48vRFSn5Hx68+pMPTwnaAvr6dST0g 5NPaAFFjUgQ7ZCY0IhQ5apOdThGjZRdwD1grn2JN+uNPBblIzNOEil45gzmzwbtV2WCn FUEA== X-Received: by 10.68.171.226 with SMTP id ax2mr932538pbc.45.1382498334810; Tue, 22 Oct 2013 20:18:54 -0700 (PDT) Received: from localhost ([183.49.44.94]) by mx.google.com with ESMTPSA id rv9sm1090432pbc.4.2013.10.22.20.18.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 22 Oct 2013 20:18:53 -0700 (PDT) From: Ming Lei To: Andrew Morton , linux-kernel@vger.kernel.org Subject: [RFC PATCH] kernel/kallsyms.c: only show legal kernel symbol Date: Wed, 23 Oct 2013 11:18:40 +0800 Message-Id: <1382498320-26594-1-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131022_231916_645592_E768FC83 X-CRM114-Status: GOOD ( 12.68 ) X-Spam-Score: -2.0 (--) Cc: Ming Lei , Chen Gang , Rusty Russell , Russell King , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 Address of non-module kernel symbol should always be located from CONFIG_PAGE_OFFSET on, so only show these legal kernel symbols in /proc/kallsyms. On ARM, some symbols(see below) may drop in relocatable code, so perf can't parse kernel symbols any more from /proc/kallsyms, this patch fixes the problem. 00000000 t __vectors_start 00000020 A cpu_v7_suspend_size 00001000 t __stubs_start 00001004 t vector_rst 00001020 t vector_irq 000010a0 t vector_dabt 00001120 t vector_pabt 000011a0 t vector_und 00001220 t vector_addrexcptn 00001224 t vector_fiq 00001224 T vector_fiq_offset The issue can be fixed in scripts/kallsyms.c too, but looks this approach is easier. Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: Rusty Russell Cc: Chen Gang Signed-off-by: Ming Lei --- kernel/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 3127ad5..184f271 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -543,7 +543,7 @@ static int s_show(struct seq_file *m, void *p) tolower(iter->type); seq_printf(m, "%pK %c %s\t[%s]\n", (void *)iter->value, type, iter->name, iter->module_name); - } else + } else if (iter->value >= CONFIG_PAGE_OFFSET) seq_printf(m, "%pK %c %s\n", (void *)iter->value, iter->type, iter->name); return 0;