Linux-Sparse Archive on lore.kernel.org
 help / color / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-sparse@vger.kernel.org, Alexey Gladkov <gladkov.alexey@gmail.com>
Subject: Re: [PATCH] dissect: use struct symbol::visited/inspected instead of ::examined/evaluated
Date: Wed, 29 Jul 2020 17:48:48 +0200
Message-ID: <20200729154848.pauuih2m2jszs5lx@ltop.local> (raw)
In-Reply-To: <20200729153413.GB4360@redhat.com>

On Wed, Jul 29, 2020 at 05:34:13PM +0200, Oleg Nesterov wrote:
> On 07/29, Luc Van Oostenryck wrote:
> >
> > The dissect client uses struct symbol's fields 'examined' & 'evaluated'
> > to avoid reprocessing the same symbols. But these fields are used
> > internally by sparse for type examination & evaluation and despite
> > dissect not doing these operations explicitly, they can be done
> > implicitly
> 
> Yes. For example, test_dissect.c calls show_typename() and this can
> lead to examine/evaluate.
> 
> I didn't bother to fix this because test_dissect.c is the very basic
> debugging tool.
> 
> > So, add a new field to struct symbol: 'inspected' and use it, as
> > well as the existing 'visited', instead of 'evaluated' & 'examined'.
> 
> Thanks! Looks good to me.
> 
> > Note: when used on the kernel, this patch avoids a lot of warnings:
> > 	"warning: r_member bad sym type=7 kind=0"
> > 	"warning: r_member bad mem->kind = 0"
> >       and creates substantially more normal output.
> 
> So this is test-dissect, sindex should be fine even without this patch.

Yes, I only used test-dissect but sindex should be affected too.
The real problem is that, even without the show_typename() from
test-dissect, some symbols can already be examined by __sparse().
In this case dissect.c:examine_sym_node() will be a no-op because
node->examined will already be set. One of the symptoms is node->kind
having a value of 0.

I'll clarify the commit message.

-- Luc

      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 14:51 Luc Van Oostenryck
2020-07-29 15:34 ` Oleg Nesterov
2020-07-29 15:48   ` Luc Van Oostenryck [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=20200729154848.pauuih2m2jszs5lx@ltop.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=gladkov.alexey@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=oleg@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

Linux-Sparse Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-sparse/0 linux-sparse/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-sparse linux-sparse/ https://lore.kernel.org/linux-sparse \
		linux-sparse@vger.kernel.org
	public-inbox-index linux-sparse

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-sparse


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git