All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH RFC 0/1] get_abi.pl: add support for ABI valitation in runtime
Date: Thu, 24 Jun 2021 16:08:09 +0200	[thread overview]
Message-ID: <YNSRyXPEynLCfCig@kroah.com> (raw)
In-Reply-To: <cover.1624014140.git.mchehab+huawei@kernel.org>

On Fri, Jun 18, 2021 at 01:28:36PM +0200, Mauro Carvalho Chehab wrote:
> Hi Greg,
> 
> I was talking today with Jonathan Cameron today about how to ensure that
> the ABI is not missing something.
> 
> While it would be doable to validate the ABI by searching __ATTR and similar
> macros around the driver, this would probably be very complex and would
> take a while to parse.
> 
> Yet, there's one way that should be quick and easier to implement:
> 
> Read the symbols from the current system in runtime, and check if
> everything is declared under Documentation/ABI.

Nice!

> As you know, scripts/get_abi.pl has already a search command, that would
> allow seeking for a symbol inside the ABI. Using a logic similar to that,
> but checking for all symbols under /sys is not hard to implemenent.
> That's what patch 1 does.
> 
> Right now, the results aren't exaustive (I opted this way for the RFC
> version, as otherwise there will be too many symbols that won't match
> the regexes generated from the What:  fields).
> 
> It basically reports results where the sysfs nodename matches one or
> more What, but doesn't match the regex.
> 
> This implementation runs very quick on my desktop: it takes less than
> 2 seconds to run. So, it sounds a good start to help identifying what's
> missing.
> 
> One of the problems with the ABI definitions is how to define wildcards
> there. Different ABI declarations use different notations. For this first
> RFC version, it all the above as wildcards[1]:
> 
> 	<foo>
> 	{foo}
> 	[foo]
> 	/.../
> 	*
> 
> and convert them into:
> 
> 	.*
> 
> [1] perhaps the better would be to just use regex on What:, as this would
>     avoid extra heuristics at get_abi.pl, but this is somewhat OOT from
>     this patch.
> 
> One of the first results is that some /sys symbols that are present
> on *lots* of sysfs nodes, but they aren't properly defined at ABI:
> 
> 	 /sys/.*/(initstate|bind|unbind)
> 
> (there are definitions, but those aren't covering all occurrences)

We should fix that up.

> Another problem it caught is that slab definitions are like:
> 	 /sys/kernel/slab/cache/alloc_calls
> 
> Instead of using a wildcard, like:
> 	/sys/kernel/slab/*/alloc_calls
> or:
> 	/sys/kernel/slab/<cache>/alloc_calls
> 
> So, they don't  match the actual symbols found at the system.

Then we should also fix those up.

> What do you think?

I like this, thanks for doing this.  We should fix up the text files to
match what we have in a format that we can actually test for things.
That will be very helpful to run on some devices so that I can go yell
at driver developers :)

thanks,

greg k-h

      parent reply	other threads:[~2021-06-24 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 11:28 [PATCH RFC 0/1] get_abi.pl: add support for ABI valitation in runtime Mauro Carvalho Chehab
2021-06-18 11:28 ` [PATCH RFC 1/1] get_abi.pl: Check for missing symbols at the ABI specs Mauro Carvalho Chehab
2021-06-24 14:08 ` Greg KH [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=YNSRyXPEynLCfCig@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=corbet@lwn.net \
    --cc=jic23@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.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 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.