From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by sourceware.org (Postfix) with ESMTPS id AB0A23858D20 for ; Fri, 21 Apr 2023 20:04:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB0A23858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodji@seketeli.org) by mail.gandi.net (Postfix) with ESMTPSA id 1F5CE240008; Fri, 21 Apr 2023 20:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seketeli.org; s=gm1; t=1682107440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7gU9FqNya23hAgtYjGdDoLi1PguwnTfkszXIiPdrVxQ=; b=Sp+qbslOPfPe4ynyM9ylL2gV038Jmy8Y59cTek02TyxtaVkeAokH66EuLnm4R33Rtsrylz 3Xpn/CpeP+/RzfvANqRmpFAk/owBRFxH9R63/LH8heIrfsnF0H/QVw/Zr6wop6OwBePt4H KZV/Eovpd8XdiAo21qUZlC9ycdpzAXVgUJEm5gL2wYRNoAFcZACcw3Z2k9woQJ7N2i+e0u MdoBIu7GfbWcRDXnsdkFO7A9r6jE50JR1aQMVoiEpd6ommtUYIRZ06PGHE2dl7+pu9WiGQ jlUarFAaxP5MncQVCxmlFZ6cl0nkM1ZtiYI4Aiq8FqovZVLvx+sGS4orjwD3jw== Received: by localhost (Postfix, from userid 1000) id 46951B5078; Fri, 21 Apr 2023 22:03:59 +0200 (CEST) From: Dodji Seketeli To: John Moon Cc: , Trilok Soni , Satya Durga Srinivasu Prabhala Subject: Re: abidiff improvements for kernel UAPI checker Organization: Me, myself and I References: <5363161d-8167-284e-e35d-9a8ef20adea9@quicinc.com> <877cu5t7tw.fsf@seketeli.org> X-Operating-System: CentOS Stream release 9 X-URL: http://www.seketeli.net/~dodji Date: Fri, 21 Apr 2023 22:03:59 +0200 In-Reply-To: <877cu5t7tw.fsf@seketeli.org> (Dodji Seketeli's message of "Fri, 21 Apr 2023 20:21:15 +0200") Message-ID: <87354tt32o.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, Dodji Seketeli a =C3=A9crit: > > I think feature this would not be difficult to add and would indeed be a > useful feature for others, I believe. > > Would it be okay if you'd have to carry a suppression specification > file that would have: > > $ cat filter-enums.suppr > > [suppress_type] > type_kind =3D enum > has_last_enumerator_change_only =3D true > > > Then you'd invoke the tool by doing: > > $ abidiff --suppr filter-enum.suppr binary-version1 binary-version2 > > To get an idea of what suppression specifications do, you can read more > at https://sourceware.org/libabigail/manual/libabigail-concepts.html#supp= ression-specifications. > > Please note that the "has_last_enumerator_change_only" property is not > yet implemented. I'd like to know first if this "user interface" would > fit your use case. If it does then we can go ahead and add it. Actually, I went ahead and played a little with this idea, in case you'd be interested, so I have a patched libabigail tree with the above implemented. The actual property to set in the suppression specification file is "allow_last_enumerator_change_only". Here is an example of what it does: $ cat -n test0-v0.c 1 enum enum_type 2 { 3 E0, 4 E1, 5 E_LAST 6 }; 7 8 struct some_type 9 { 10 enum enum_type m; 11 }; 12 13 void 14 foo(struct some_type* s __attribute__((unused))) 15 { 16 } $ cat -n test0-v1.c 1 enum enum_type 2 { 3 E0, 4 E1, 5 E2, 6 E_LAST 7 }; 8 9 struct some_type 10 { 11 enum enum_type m; 12 }; 13 14 void 15 foo(struct some_type* s __attribute__((unused))) 16 { 17 } $ $ ./build/tools/abidiff test0-v0.o test0-v1.o || echo "exit code: $?" Functions changes summary: 0 Removed, 1 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some indirect sub-type change: [C] 'function void foo(some_type*)' at test0-v0.c:14:1 has some indir= ect sub-type changes: parameter 1 of type 'some_type*' has sub-type changes: in pointed to type 'struct some_type' at test0-v1.c:9:1: type size hasn't changed 1 data member change: type of 'enum_type m' changed: type size hasn't changed 1 enumerator insertion: 'enum_type::E2' value '2' 1 enumerator change: 'enum_type::E_LAST' from value '2' to '3' at test0-v1.c:1:1 exit code: 4 $ cat last-enum-change-only.suppr [suppress_type] type_kind =3D enum allow_last_enumerator_change_only =3D yes $ $ /home/dodji/git/libabigail/filter-last-enumerator-change/build/tools/= abidiff --suppr ./last-enum-change-only.suppr test0-v0.o test0-v1.o && echo= "exit code: $?" Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Add= ed function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable exit code: 0 $ The git tree that you can check you, compile and test at your convenience is https://sourceware.org/git/?p=3Dlibabigail.git;a=3Dshortlog;= h=3Drefs/heads/users/dodji/filter-last-enumerator-change. The patch in question is this one: https://sourceware.org/git/?p=3Dlibabiga= il.git;a=3Dcommit;h=3D239ecaa7dc5de9e9a37650248aa00b5cfc2e578e The git command to use would be: $ git clone -b 'users/dodji/filter-last-enumerator-change' git://sourceware= .org/git/libabigail.git Once you've got the necessary dependencies for your system, I guess compiling the tree would take: $ autoreconf $ configure --prefix=3D $ make -j $ make install Then play with /your/prefix/usr/bin/abidiff. [...] I hope this helps to at least start a productive discussion. Cheers, --=20 Dodji