From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 0418F3858D38 for ; Fri, 22 Sep 2023 20:02:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0418F3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38MJsIrv021131; Fri, 22 Sep 2023 20:02:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=yDrZaSLS4Zgjuu52ouGsbUhh7wsVbzXYtVppEvkCkmg=; b=h2ZrAp9eQ1YRJx4hTJHbRq0m2No13+/ClMv/kExhPp4NfZ/fIbM7AboaE9ROxTb913we jdIi+yRC3lEtMc7gW/FSv/ZhwzVZ6PnKZWiNkjjFTi82HUYfd2rGDX1d8UBH0rgROpjU XxlazPEMOa4cZJ/EHVCBb3+MiIycmYT7oJCOVPgiS1MxD89nwkzxJC4VK2h2kqGWy9I+ kzZW9Syv3ia1KSLfZmOpPmqm95E1Bebjtd5ZDn2du0cSShlpDoSGISUVG0frmP6UqaF1 CqskbgzTBH3m4YhcuJ14rrTOtaMuWbpoVmQo5DOmuREBcPAiBMNy3f2TfxpVzDs/5qNS Pg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t8u9haw4w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 20:02:39 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38MK2cuC015169 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 20:02:38 GMT Received: from [10.110.122.174] (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 22 Sep 2023 13:02:37 -0700 Message-ID: <78d1c98d-5863-4b1c-a0e9-9e5088be1d12@quicinc.com> Date: Fri, 22 Sep 2023 13:02:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: abidiff improvements for kernel UAPI checker Content-Language: en-US To: Dodji Seketeli CC: , Trilok Soni , "Satya Durga Srinivasu Prabhala" References: <5363161d-8167-284e-e35d-9a8ef20adea9@quicinc.com> <877cu5t7tw.fsf@seketeli.org> <87354tt32o.fsf@seketeli.org> <340b33bd-2b43-9f99-58e1-f1b77a51b48a@quicinc.com> <87fs36e8sr.fsf@seketeli.org> <87bkdue89g.fsf@seketeli.org> <44d76150-3e34-4bef-9970-d321f5bc224c@quicinc.com> From: John Moon In-Reply-To: <44d76150-3e34-4bef-9970-d321f5bc224c@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: cvqeo89DT-zZxOW7oV99ZhKMJbUFJzZ5 X-Proofpoint-ORIG-GUID: cvqeo89DT-zZxOW7oV99ZhKMJbUFJzZ5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-22_18,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 spamscore=0 priorityscore=1501 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 mlxlogscore=811 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309220171 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP 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: On 9/22/2023 11:28 AM, John Moon via Libabigail wrote: > If not, I think this output is at least easier to post-process! For > example, I could add logic to the script to do something like "if > there's a deleted enum whose contents are present in an added enum, > assume it's an addition to an anonymous enum and ignore". > Proof of concept to filter out anon enum additions from input like this: 2 removed types unreachable from any public interface: [D] 'enum {HNS_ROCE_EXSGE_FLAGS=1, HNS_ROCE_RQ_INLINE_FLAGS=2, }' at hns-abi.h:88:1 [D] 'enum {HNS_ROCE_RSP_EXSGE_FLAGS=1, HNS_ROCE_RSP_RQ_INLINE_FLAGS=2, }' at hns-abi.h:93:1 2 added types unreachable from any public interface: [A] 'enum {HNS_ROCE_CQE_INLINE_FLAGS=4, HNS_ROCE_EXSGE_FLAGS=1, HNS_ROCE_RQ_INLINE_FLAGS=2, }' at hns-abi.h:88:1 [A] 'enum {HNS_ROCE_RSP_CQE_INLINE_FLAGS=4, HNS_ROCE_RSP_EXSGE_FLAGS=1, HNS_ROCE_RSP_RQ_INLINE_FLAGS=2, }' at hns-abi.h:94:1 --- #!/bin/bash set -o errexit # Take a line and form a normalized string representation get_repr() { local -r line="$1" echo "$line" | grep -o '{.*}' \ | tr -d '{} ' \ | sed -e 's/,$//g' -e 's/,/\n/g' \ | sort -t= -k2 -n \ | xargs } input="${1:-/dev/stdin}" deleted_anon_enum_reprs=() added_anon_enum_reprs=() while read -r line; do if echo "$line" | grep -q "\[D\] 'enum {"; then deleted_anon_enum_reprs+=("$(get_repr "$line")") fi if echo "$line" | grep -q "\[A\] 'enum {"; then added_anon_enum_reprs+=("$(get_repr "$line")") fi done < "$input" # If a deleted enum's representation appears in an added enum's # representation, assume they're the same enum (just being added # on to). legit_breaks=${#deleted_anon_enum_reprs[@]} for del_repr in "${deleted_anon_enum_reprs[@]}"; do for add_repr in "${added_anon_enum_reprs[@]}"; do if echo "$add_repr" | grep -q "^${del_repr}"; then legit_breaks=$((legit_breaks - 1)) break fi done done echo "$legit_breaks breaks" --- There may be a better way to do this sort of thing in a suppression, but I'm not sure how given they operate on diffs (which wouldn't be created in this case). It feels hacky as the abidiff stdout isn't a stable API itself, but if it sounds reasonable to you, I can bake the above filtering logic into the next rev submitted upstream. Just let me know! Thanks, John