All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
	Sam Ravnborg <sam@ravnborg.org>, Andrew Morton <akpm@osdl.org>,
	Steven Rostedt <srostedt@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kallsyms, tracing: output more proper symbol name
Date: Wed, 11 Mar 2009 13:05:19 +0000	[thread overview]
Message-ID: <49B7B70F.5010908@grupopie.com> (raw)
In-Reply-To: <20090311094621.GA13543@elte.hu>

Ingo Molnar wrote:
> * Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
> 
>> +#define VMLINUX_SYMBOL(_sym_) #_sym_
>> +
>> +static const char *hide_symbols[] = {
>> +	/* misc symbols */
>> +	"_text",
>> +	"_stext",
>> +	"_etext",
>> +	"_sinittext",
>> +	"_einittext",
>> +
>> +	/* symbols from include/asm-generic/vmlinux.lds.h */
>> +	VMLINUX_SYMBOL(__start_mcount_loc),
>> +	VMLINUX_SYMBOL(__stop_mcount_loc),
[...]
>> +	VMLINUX_SYMBOL(__early_initcall_end),
>> +	VMLINUX_SYMBOL(__per_cpu_start),
>> +	VMLINUX_SYMBOL(__per_cpu_end)
>> +};
> 
> I like how you try to solve this at symbol table generation 
> time.

Yes, this is the proper way to do it.

> Instead of this hardcoded table, couldnt we use some more 
> flexible and more future-proof method? Such as ordering 
> same-address symbols by underscores:
> 
>   [same address]
> 
>   non-underscore symbols first        XYZ
>   single-undescroe symbols second     _XYZ
>   double-underscore symbols third     __XYZ
> 
> that way the scheme would be more or less self-maintaining as an 
> underscore already carries a "this is a special, internal 
> symbol" notion.

I agree with this approach, but to be on the side we should skim through
the alias and see if this works for most symbols or not.

I just did this for the symbols on my running kernel and it seems to
work. The hierarchy for '_' and '__' is in fact necessary:

> ffffffff80447418 T __sched_text_start
> ffffffff80447418 t sleep_on_common
> ffffffff80449830 T __lock_text_start
> ffffffff80449830 T __sched_text_end
> ffffffff80449830 T _spin_trylock
> ffffffff80453d50 R __stop___ex_table
> ffffffff80453d50 T __start_notes
> ffffffff8045b000 R __start_rodata
> ffffffff8045b000 R linux_banner

or that "_spin_trylock" might be displayed incorrectly as
"__sched_text_end" or something like that.

-- 
Paulo Marques - www.grupopie.com

"Who is general Failure and why is he reading my disk?"

  parent reply	other threads:[~2009-03-11 14:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11  9:37 [PATCH] kallsyms, tracing: output more proper symbol name Lai Jiangshan
2009-03-11  9:46 ` Ingo Molnar
2009-03-11 10:29   ` Frederic Weisbecker
2009-03-11 13:05   ` Paulo Marques [this message]
2009-03-12  2:43     ` Lai Jiangshan
2009-03-12 15:32       ` Paulo Marques
2009-03-13  7:10         ` [PATCH V3] " Lai Jiangshan
2009-03-13  9:27           ` Lai Jiangshan
2009-03-13 19:25             ` Paulo Marques
2009-03-13 19:40             ` Sam Ravnborg
2009-03-13 20:07               ` Andrew Morton
2009-03-13 20:34                 ` Paulo Marques
2009-03-14  8:54                 ` Ingo Molnar
2009-03-14  8:57           ` [tip:tracing/ftrace] " Lai Jiangshan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49B7B70F.5010908@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=akpm@osdl.org \
    --cc=fweisbec@gmail.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sam@ravnborg.org \
    --cc=srostedt@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.