Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757403Ab0KLBkZ (ORCPT ); Thu, 11 Nov 2010 20:40:25 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:44771 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756111Ab0KLBkX convert rfc822-to-8bit (ORCPT ); Thu, 11 Nov 2010 20:40:23 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=KOqmWGYJXiNPpyqLpaZHtrMP3CO6colFJfWfz47+zB8837BPhn3fD8Tfh5e2S+JerP kM8BnBBPpQgbG/wxWcr6qudpGvN+PlJGdP+eODECSmhuuuaDqluj4pZDYR3iKNE2IeWm yhj+UETMkGMssFULy2/cg+FCS53oITm6PDjcE= MIME-Version: 1.0 In-Reply-To: <1289478626.2084.73.camel@laptop> References: <20101111091733.GA2929@pulham.picochip.com> <1289477176.2084.64.camel@laptop> <20101111122143.GF2929@pulham.picochip.com> <1289478626.2084.73.camel@laptop> Date: Fri, 12 Nov 2010 09:40:21 +0800 Message-ID: Subject: Re: [Questions] How to run 'perf top' on ARM to profile kernel functions with modules loaded From: Ming Lei To: Peter Zijlstra Cc: Jamie Iles , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2534 Lines: 61 2010/11/11 Peter Zijlstra : > On Thu, 2010-11-11 at 12:21 +0000, Jamie Iles wrote: >> On Thu, Nov 11, 2010 at 01:06:16PM +0100, Peter Zijlstra wrote: >> > On Thu, 2010-11-11 at 09:17 +0000, Jamie Iles wrote: >> > > On Thu, Nov 11, 2010 at 03:52:07PM +0800, Ming Lei wrote: >> > > > 2010/11/11 Ming Lei : >> > > > > Hi, >> > > > > >> > > > > 'perf top' can't display any functions when modules are loaded on ARM. >> > > > >> > > > Sorry, should be can't display any kernel functions when modules are loaded >> > > > on ARM. >> > > I've noticed this myself and I spent a bit of time looking into it last week >> > > but didn't get too far. I did wonder if it was something to do with the map >> > > fixups after loading the modules. If you look at the raw events after a perf >> > > record with 'perf report -D' then the last module has a size that takes it to >> > > 0xFFFFFFFF which overlaps with the rest of the kernel symbols. >> > > >> > > On x86 it looks like the modules are loaded after the kernel image in VM >> > > unlike ARM. >> > >> > Order shouldn't matter, but that overlap is very likely what kills it. >> > That module size is buggy. >> I'm guessing that its in util/symbol.c:__map_groups__fixup_end(): >> >> ? ? ? for (nd = rb_next(prevnd); nd; nd = rb_next(nd)) { >> ? ? ? ? ? ? ? ? prev = curr; >> ? ? ? ? ? ? ? ? curr = rb_entry(nd, struct map, rb_node); >> ? ? ? ? ? ? ? ? prev->end = curr->start - 1; >> ? ? ? ? } >> >> ? ? ? ? /* >> ? ? ? ? ?* We still haven't the actual symbols, so guess the >> ? ? ? ? ?* last map final address. >> ? ? ? ? ?*/ >> ? ? ? ? curr->end = ~0UL; >> >> I've noticed that if I change the symbol_conf.{use_modules,try_vmlinux_path} >> then I can get perf events for kernel symbols from /proc/kallsyms but nothing >> for the modules. > > Hrm,.. depending on how we load things this might be easy or hard to > fix. If we load the module symbols after having loaded the kernel > symbols we can replace ~0ULL with the address before the next symbol. If possible, could you post a patch so that I can verify if the issue is caused by ~0ULL? > If however we load modules first we're in a bind and should look at > changing the load order to make the first suggestion work. > thanks, -- Lei Ming -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/