Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Christopher Li <sparse@chrisli.org>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] sparse: option to print compound global data symbol info
Date: Wed, 24 Jan 2018 22:15:32 -0800	[thread overview]
Message-ID: <6c5e4947-0ca7-0ca7-17fa-42c8162e4556@infradead.org> (raw)
In-Reply-To: <CANeU7Qk=WERUJY9Px1NE__AxxXKMzGMbP1CRLYEUQF8C3KGpJw@mail.gmail.com>

On 01/23/2018 02:46 AM, Christopher Li wrote:
> On Sat, Jan 20, 2018 at 8:27 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>> On Sat, Jan 20, 2018 at 07:36:24PM -0800, Randy Dunlap wrote:
>>> From: Randy Dunlap <rdunlap@infradead.org>
>>> with help from Linus. (many moons ago)
>>>
>>> sparse addition to print all compound/composite global data symbols
>>> with their sizes and alignment.
>>>
>>> usage: -list-symbols
>>> Example: (in kernel tree)
>>>   make C=2 CF="-list-symbols" arch/x86_64/kernel/smpboot.o
>>>   arch/x86/kernel/smpboot.c:99:1: struct cpuinfo_x86 [addressable] [noderef] [toplevel] <asn:3>cpu_info: compound size 240, alignment 8
>>
>> If this only lists compound symbols, it seems a bit strange to me
>> to use '-list-symbols' as the option name. Maybe you could go one
>> step further an have '-list-symbols=compound' and if needed it can
>> be extended to '-list-symbols=all'.
> 
> I think maybe it can be group with the "-v<debug>" options. e.g. "-vcompound".
> After all it is showing some debug information very similar to "-ventry".
> 

OK, thanks for that.  I was a bit hung up on where to go with that.

>>
>> Not really needed as it's already included indirectly but it
>> won't hurt, of course.
>> ...
>>
>> Not needed since already declared in lib.h.
> 
> Agree here and other Luc's feedback, so I skip the duplication.
> 
>>
>>> +static void list_all_symbols(struct symbol_list *list)
>>> +{
>>> +     struct symbol *sym;
>>> +
>>> +     FOR_EACH_PTR(list, sym) {
>>> +             /* Only show arrays, structures, unions, enums, & typedefs */
> 
> This comment is a bit confusing for me. It mention "Only show ... *enums*"
> 
>>
>>> +             if (sym->type == SYM_FN || sym->type == SYM_ENUM)
>>> +                     continue;
>>> +             if (!sym->ctype.base_type)
>>> +                     continue;
>>> +             if (sym->ctype.base_type->type == SYM_FN)
>>> +                     continue;
>>> +             if (sym->ctype.base_type->type == SYM_ENUM)
>>> +                     continue;
> 
> Here it skips enums. Not consistent with previous comment
> about showing enums. Am I missing something obvious?

Nope.  I have already corrected that locally a few days ago.

thanks.
-- 
~Randy

      reply	other threads:[~2018-01-25  6:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21  3:36 [PATCH] sparse: option to print compound global data symbol info Randy Dunlap
2018-01-21  4:27 ` Luc Van Oostenryck
2018-01-23 10:46   ` Christopher Li
2018-01-25  6:15     ` Randy Dunlap [this message]

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=6c5e4947-0ca7-0ca7-17fa-42c8162e4556@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=sparse@chrisli.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox