Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp547779pxb; Thu, 9 Sep 2021 06:54:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBxKL5GtbUMscPQ1GDL5jWGiLqjTfDB1ZvTgfCfNbMb4k8XXnSjvqY4LbaCnFxDpjufa9v X-Received: by 2002:a17:906:b46:: with SMTP id v6mr463064ejg.262.1631195684856; Thu, 09 Sep 2021 06:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631195684; cv=none; d=google.com; s=arc-20160816; b=joOc6KtgdtCd7xlxDB2CACvFh5qseFm1TDTgIeBTWYn1dLEYcQaV1/aQKBSqzd37z/ OwcqTuy0c9U7dSOVXXMcW3IUwx3KLwsTJCZwmKLVk9egmOjMtSoP4M8386/9R3UX7wDh OG+5MkKttl0h9DepdUlap9vDVwtqGB3H82n9SikO1DZjJvdq6dsjz5KqMNXJQTSY30Ws oHg1w9P8AxHw4r7nqbriJAINgdTdWw8cdX1MUKRr1iWW6dhu6mG4niMAH7nowHODE/E8 5HLQTSkPXzFX6/Pshm4hoiHtclZlm4VQBtIjy8gzvHkqGtwzcxe/SN9iQMmDrZRWSZ/4 EgFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QcZd4TQAUPGX9Ru36p1xEzoeB+51hlbypme6oEqGdwY=; b=q+AGgdh8ev2Hr6LaiOpn2bulDzaCJNJbyw7/TNANgTpjaVRdqrn1CzO3/+9ka/DGFj vnsdiVtVdSiqFeXdvkMRyvrJpGOVgVPYU/Gwh7VYlMXNeei1rgM2I8B4tGdVAk2Ns+Yt cmmlyOx84kByvqcXq1xhdvcJxm0+42qf3pb+tBxmWgdH+LxmaCovPTjGrxNg+C/pIihU CNFQRQqT+emArT7wC+N8i6XFnCXx7+mhFpbNH1V7zcJ/V4nU7zp7qCRl85cp28Afp0nb 5JXgDiBz38UpRO7zYIKLT+Z9Kr4WW2zJwPZWhqgmz9wfSx4kGPBjlAo7y/4FfSqUdFds DBYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0CRAFxiZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si1188682edx.158.2021.09.09.06.54.18; Thu, 09 Sep 2021 06:54:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0CRAFxiZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354256AbhIINxR (ORCPT + 99 others); Thu, 9 Sep 2021 09:53:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:38060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238647AbhIINwN (ORCPT ); Thu, 9 Sep 2021 09:52:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C66B460041; Thu, 9 Sep 2021 13:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631195463; bh=9nVW5b9CIZO8paiwj2IcNBcJlmc8azfXpVGaorx2PoM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0CRAFxiZS4HATnPqHRQ5opfDmDlB+Dfo989YpBV2bc+BAk91QDpOyEA7mJViyEfFt uymiKP/rVMkYOAQesVKHWRqffJbnGMAtNYbvqo6pJLA/NkuAhbCGNBuAGj9+ThYXe7 4mXgoU/5ftg5CrUHR7D3+mdcd1d8IffjeUw2qBKE= Date: Thu, 9 Sep 2021 15:51:00 +0200 From: Greg KH To: Mauro Carvalho Chehab Cc: Linux Doc Mailing List , linux-kernel@vger.kernel.org, Jonathan Corbet , Anton Vorontsov , Colin Cross , John Fastabend , KP Singh , Kees Cook , Martin KaFai Lau , Song Liu , Tony Luck , Yonghong Song , bpf@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 0/9] get_abi.pl: Check for missing symbols at the ABI specs Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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] > 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