linux-kernel.vger.kernel.org archive mirror
 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>,
	Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>, Kees Cook <keescook@chromium.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Tony Luck <tony.luck@intel.com>, Yonghong Song <yhs@fb.com>,
	bpf@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 0/9] get_abi.pl: Check for missing symbols at the ABI specs
Date: Thu, 9 Sep 2021 15:51:00 +0200	[thread overview]
Message-ID: <YToRRMhYfdnzFyMB@kroah.com> (raw)
In-Reply-To: <cover.1631112725.git.mchehab+huawei@kernel.org>

On Wed, Sep 08, 2021 at 04:58:47PM +0200, Mauro Carvalho Chehab wrote:
> Hi Greg,
> 
> Sometime ago, I discussed with Jonathan Cameron about providing 
> a way check that the ABI documentation is incomplete.
> 
> 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.
> 
> So, I ended by implementing a new feature at scripts/get_abi.pl
> which does a check on the sysfs contents of a running system:
> it reads everything under /sys and reads the entire ABI from
> Documentation/ABI. It then warns for symbols that weren't found,
> optionally showing possible candidates that might be misdefined.
> 
> I opted to place it on 3 patches:
> 
> The first patch adds the basic logic. It runs really quicky (up to 2
> seconds), but it doesn't use sysfs softlinks.
> 
> Patch 2 adds support for also parsing softlinks. It slows the logic,
> with now takes ~40 seconds to run on my desktop (and ~23
> seconds on a HiKey970 ARM board). There are space there for
> performance improvements, by using a more sophisticated
> algorithm, at the expense of making the code harder to
> understand. I ended opting to use a simple implementation
> for now, as ~40 seconds sounds acceptable on my eyes.
> 
> Patch 3 adds an optional parameter to allow filtering the results
> using a regex given by the user.
> 
> One of the problems with the current ABI definitions is that several
> symbols define wildcards, on non-standard ways. The more commonly
> wildcards used there are:
> 
> 	<foo>
> 	{foo}
> 	[foo]
> 	X
> 	Y
> 	Z
> 	/.../
> 
> The script converts the above wildcards into (somewhat relaxed)
> regexes.
> 
> There's one place using  "(some description)". This one is harder to
> parse, as parenthesis are used by the parsing regexes. As this happens
> only on one file, patch 4 addresses such case.
> 
> Patch 5 to 9 fix some other ABI troubles I identified.
> 
> In long term, perhaps the better would be to just use regex on What:
> fields, as this would avoid extra heuristics at get_abi.pl, but this is
> OOT from this patch, and would mean a large number of changes.

This is cool stuff, thanks for doing this!

I'll look at it more once 5.15-rc1 is out, thanks.

greg k-h

  parent reply	other threads:[~2021-09-09 13:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 14:58 [PATCH 0/9] get_abi.pl: Check for missing symbols at the ABI specs Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 1/9] scripts: " Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 2/9] scripts: get_abi.pl: detect softlinks Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 3/9] scripts: get_abi.pl: add an option to filter undefined results Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 4/9] ABI: sysfs-bus-usb: better document variable argument Mauro Carvalho Chehab
2021-09-13 11:55   ` Heikki Krogerus
2021-09-08 14:58 ` [PATCH 5/9] ABI: sysfs-module: better document module name parameter Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 6/9] ABI: sysfs-tty: " Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 7/9] ABI: sysfs-kernel-slab: use a wildcard for the cache name Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 8/9] ABI: security: fix location for evm and ima_policy Mauro Carvalho Chehab
2021-09-09 13:48   ` Mimi Zohar
2021-09-09 14:11     ` Mauro Carvalho Chehab
2021-09-08 14:58 ` [PATCH 9/9] ABI: sysfs-module: document initstate Mauro Carvalho Chehab
2021-09-09 13:51 ` Greg KH [this message]
2021-09-14 14:24   ` [PATCH 0/9] get_abi.pl: Check for missing symbols at the ABI specs Mauro Carvalho Chehab

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=YToRRMhYfdnzFyMB@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=anton@enomsg.org \
    --cc=bpf@vger.kernel.org \
    --cc=ccross@android.com \
    --cc=corbet@lwn.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=keescook@chromium.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=tony.luck@intel.com \
    --cc=yhs@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).