From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: Hidden symbol when debugging hypervisor Date: Wed, 30 Apr 2014 12:28:55 +0100 Message-ID: <5360DE77.7060509@citrix.com> References: <2039026.XfIYG36Q6e@amur> <5360C1DC.9020707@eu.citrix.com> <5360C4D3.3010000@ts.fujitsu.com> <5360CB60.7000704@eu.citrix.com> <5360EAB7020000780000DB75@g0-1-119.ukb-fw-asa.gns.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5360EAB7020000780000DB75@g0-1-119.ukb-fw-asa.gns.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , Juergen Gross , Dietmar Hahn , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 30/04/14 11:21, Jan Beulich wrote: >>>> On 30.04.14 at 12:07, wrote: >> On 04/30/2014 10:39 AM, Juergen Gross wrote: >>> On 30.04.2014 11:26, George Dunlap wrote: >>>> On 04/30/2014 10:02 AM, Dietmar Hahn wrote: >>>>> Hi, >>>>> >>>>> while debugging a vmcore with the crash tool I stumpled over a >>>>> little problem. >>>>> I wanted to look at the "struct csched_private" of credit scheduler >>>>> and got >>>>> the contents of the "struct csched_private" of credit2. >>>>> The debug informations of the hypervisor contain 2 entries >>>>> <1>: Abbrev Number: 8 (DW_TAG_structure_type) >>>>> DW_AT_name : (indirect string, offset: 0x9d8d): >>>>> csched_private >>>>> and >>>>> <1>: Abbrev Number: 25 (DW_TAG_structure_type) >>>>> DW_AT_name : (indirect string, offset: 0x9d8d): >>>>> csched_private >>>>> >>>>> The first is credit and the second credit2. It seems in the crash >>>>> command the >>>>> second entry wins :-(. >>>>> >>>>> Maybe crash has the possibility somewhere to get access to the >>>>> second structure >>>>> (I couldn't find it) but for simplicity it would be better to have >>>>> different >>>>> names >>>>> I think. >>>>> Are there any reasons not to rename >>>>> struct csched_private -> struct c2sched_private >>>>> or whatever? >>>> No reasons at all -- the naming is an artifact of development. Feel >>>> free to >>>> send a patch renaming it. >>> I tried it once: >>> http://lists.xen.org/archives/html/xen-devel/2013-02/msg02255.html >>> >>> Jan didn't like it. >> It looks like he was only thinking about backtraces, not about cscope or >> about debugging core dumps. Jan, do you have another solution for >> those, or shall we go ahead and change the names? > If you're happy with the names getting changed, so be it. I have no > alternative suggestion. I simply would have expected that in year > 2014 tools can deal with situations like this (i.e. find the applicable > type rather than the first, last, or a random one). Dwarf debug info > certainly has all the necessary information for that to happen. > > Jan That is impossible in this situation (if I have understood it correctly). In memory, sched_priv is a void pointer, and Dietmar has asked crash to interpret it as a 'struct csched_private'. It is plausible that crash could ask "do you mean a struct csched_private from sched_credit.c or from sched_credit2.c". I have encountered similar problems generating stack traces with the Xen Crashdump Analyser, which only has System.map available. xen.git/xen$ cat System.map | cut -d ' ' -f 3 | sort | uniq -d | wc -l 78 Having duplicate symbol names for different symbols is confusing at the very least, and trivial to avoid. I reckon that most if not all of those 78 duplicate symbols can, and should be, deduplicated. Renaming credit -> credit2 will amend about 1/4 of that list. ~Andrew