From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120002 invoked by alias); 13 Feb 2020 16:19:52 -0000 Mailing-List: contact libabigail-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Id: List-Subscribe: Sender: libabigail-owner@sourceware.org Received: (qmail 119991 invoked by uid 89); 13 Feb 2020 16:19:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-Spam-Status: No, score=-26.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mail-wr1-f74.google.com Received: from mail-wr1-f74.google.com (HELO mail-wr1-f74.google.com) (209.85.221.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2020 16:19:50 +0000 Received: by mail-wr1-f74.google.com with SMTP id u8so2550738wrp.10 for ; Thu, 13 Feb 2020 08:19:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=OhhMucISEXLxr1wgqaxEyYgbO9NudnDH6wW011oMuTo=; b=GZUkmv/mYLJXWZQR+1mU359sX7XvHZcSD0zHXyKU8OOfOyPdvZ9sDOalLCyF/tpU30 jrLgR6wU/DBiEvF5IIxqIYHOjWm78V+Hh4P+Luc8+F3rzmgZDbuM+1htbbLDZqiYLJPb bgia0hfvbqsStHlC47zeI3Yq8A6jEsKbPx6urHZz3A4f+K+1lTQL/710p90YVp/BTQbz xcE/r7kVW9TP3tFN4cExAivpxRpw9/VDcDV8Sfb1/RSm7AMXCo58OQrlCx2eM9RtrYts +Z66hlYeirb+oInIyO+XubtQPw4WeqZKKlfQE+po+0BuGmQzd7A865JC2i43WjKuoNtF We5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=OhhMucISEXLxr1wgqaxEyYgbO9NudnDH6wW011oMuTo=; b=TlNAzEI2ymmjyceH6fK1yF2vz5DkaqzhNesoXz3ksdNHAkjqOqqiJFyfo/UpKPxC9Q i7iPvAES8eVklrM46xdTxZI6+Mm0wt8OMy2Ly9tb4I6QDwF70axjnBebX+M7RziyzlxG qeiZijXBOwKdfh6jwK7sVlHmVfmZvK8REth0/qSlNPjBbFzabMD+Ls2FccAQhc4UNiUW KkzyEz5Dad/vgCOtiZwIDJHwQezzG0028oKhZltPRQ8vC7q2mS8OBCDzMJ9o1f2XEPo6 PN+lsmYNJsLPSZK0YVV4DGtOMYZxkm/FIAVP8zVe6IQCpKTIVbh3WnU6a9YtHuOlA3Of X/uw== X-Gm-Message-State: APjAAAXHgwCR7/TjTJZsYWAXGvjAysRA9tINpcTXMAyPS1ugFythMLbW m/4lYsuIt7KJxMBE5K76nU163oND1e5u1LwKp+1q+qMfNHoO1+kglQXhvdiHgJDdqKmjDL3yYDD ZbP3G8LBgrb4Q8QA8VCeKQIeZ8pzIPt1o/YwGCqIH376IBsCs1JMacr43wikif6gRKGcMTyU= X-Google-Smtp-Source: APXvYqw4O5V+R+QVw8XBdA1Z2XTBoLPs3CzHF1Nng0nvBUYmb806srlyrlQib+0TOl3Slnfd8FM8DiASB6Faqg== X-Received: by 2002:adf:f0c8:: with SMTP id x8mr22673055wro.359.1581610787685; Thu, 13 Feb 2020 08:19:47 -0800 (PST) Date: Wed, 01 Jan 2020 00:00:00 -0000 In-Reply-To: <20200213004424.144689-1-gprocida@google.com> Message-Id: <20200213161926.167729-1-gprocida@google.com> Mime-Version: 1.0 References: <20200213004424.144689-1-gprocida@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v2] Fix the reporting of leaf change statistics. From: "Giuliano Procida via libabigail" Reply-To: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2020-q1/txt/msg00081.txt Leaf changes (as reported with --leaf-changes-only) to variables were miscounted as changes to functions. * src/abg-comparison.cc (apply_filters_and_compute_diff_stats): Increment the correct counter for leaf variable changes. * tests/data/Makefile.am: Add test case files. * tests/data/test-abidiff-exit/test-leaf0-*: New test case. * tests/test-abidiff-exit.cc: Run new test case. Signed-off-by: Giuliano Procida --- src/abg-comparison.cc | 4 ++-- tests/data/Makefile.am | 3 +++ .../data/test-abidiff-exit/test-leaf0-report.txt | 13 +++++++++++++ tests/data/test-abidiff-exit/test-leaf0-v0.o | Bin 0 -> 2784 bytes tests/data/test-abidiff-exit/test-leaf0-v1.o | Bin 0 -> 2824 bytes tests/test-abidiff-exit.cc | 9 +++++++++ 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 tests/data/test-abidiff-exit/test-leaf0-report.txt create mode 100644 tests/data/test-abidiff-exit/test-leaf0-v0.o create mode 100644 tests/data/test-abidiff-exit/test-leaf0-v1.o diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index af4cd5e7..61aea47f 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -9767,8 +9767,8 @@ corpus_diff::priv::apply_filters_and_compute_diff_stats(diff_stats& stat) (stat.num_leaf_var_changes_filtered_out() + 1); } if ((*i)->has_local_changes()) - stat.num_leaf_func_changes - (stat.num_leaf_func_changes() + 1); + stat.num_leaf_var_changes + (stat.num_leaf_var_changes() + 1); } stat.num_func_syms_added(added_unrefed_fn_syms_.size()); diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 1f574d2e..2a928ef2 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -107,6 +107,9 @@ test-abidiff-exit/test-loc-v0.bi \ test-abidiff-exit/test-loc-v1.bi \ test-abidiff-exit/test-loc-with-locs-report.txt \ test-abidiff-exit/test-loc-without-locs-report.txt \ +test-abidiff-exit/test-leaf0-v0.o \ +test-abidiff-exit/test-leaf0-v1.o \ +test-abidiff-exit/test-leaf0.report.txt \ \ test-diff-dwarf/test0-v0.cc \ test-diff-dwarf/test0-v0.o \ diff --git a/tests/data/test-abidiff-exit/test-leaf0-report.txt b/tests/data/test-abidiff-exit/test-leaf0-report.txt new file mode 100644 index 00000000..46f39976 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-leaf0-report.txt @@ -0,0 +1,13 @@ +Leaf changes summary: 2 artifacts changed +Changed leaf types summary: 0 leaf type changed +Removed/Changed/Added functions summary: 0 Removed, 1 Changed, 0 Added function +Removed/Changed/Added variables summary: 0 Removed, 1 Changed, 0 Added variable + +1 function with some sub-type change: + + [C]'function int changed_fun()' has some sub-type changes: + return type changed: + type name changed from 'int' to 'long int' + type size changed from 32 to 64 (in bits) + + diff --git a/tests/data/test-abidiff-exit/test-leaf0-v0.o b/tests/data/test-abidiff-exit/test-leaf0-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..a79511cc3c6db039aaa1f5528db19b55f75c7a2d GIT binary patch literal 2784 zcmbtVOKTHR6h4#N*w)yPHa=P^GJ;QZ#zabO)oL_a>jM$Ng@VLMa?=ExiA*Ln>Ouq& z+__LhaOa=UwSUBoKftvMJ!j^g7U?FU5HTMC@sQE@6!DgoF5@&QSRuyJEkBH-SRzd@ z88C4G>oZu>*5PbEBeL_^X=`RYw+|q-03v%fb1t)-xt_l`mzo6-hai)=kP#DDnF|-^ zSnp@A=gF-!`|NnS--PWI7U6hWm^!+Zs=@CuTgL| z3vR6zIi&M287Dw-cY5c|v~@p~Lcdzm^Vem)(&+iX{H7O-M!9zTo?Sk1qPSo$yQkfv zeY#LwF5u60+F{R^E9=siL92$M7u1?7{iQ``alv-hZKvUNpZT?B(D6IHuG90Mw*0yi zdesftg;Qbs2~-{wi<}$l*aWy%E}ylJU6Iw6=g0Y+rQ=58XkELb5tse^E?E7XHNR_o z;vKeOKjQQ!ikf&Sn|qTgPwiMmgBVU6>EMjPuRlpjk$5s`BL zP<3zk-4T)I+QzIAw09({!NDCljl9ux z$VNAwJFpYuF;7KsC4|$ej}wSA9Z$eG-noeO82C#i(`6%~eb#r4<53*_e7Izc#PPX~ zb1@vn(Ytz6;cTx&xNG3AmHa@>W<9)iiW5CU$}YE!{o*#bt#DeazFu&<&)RqgaSnrc zZZa3jeh6;e3q5eF-7dI+-0#t;2ATfE%iC6{#kV?*q`dBSJJG%j+hw} zAvmMJ8zg9C+E!4Plz&a-=RQ$>dY8=nPY|P+Tqm*-y;6xjFra46&+`k!ll=Fp%Y5V? z{;!q4VFu^7JO)E8=Vj!R@;A*(3Rq%8HS_uzeveF2{~jgukG?|e&wZtO%-j^aufV1% mn7#w_4x9e8C+6Kl2!1H=6bTxc>!-L${(V*d7tNPg)Bi7zRJKt7 literal 0 HcmV?d00001 diff --git a/tests/data/test-abidiff-exit/test-leaf0-v1.o b/tests/data/test-abidiff-exit/test-leaf0-v1.o new file mode 100644 index 0000000000000000000000000000000000000000..4a433b9572abb46799391619f21538b54fb3204c GIT binary patch literal 2824 zcmbtVOOF#r5UzH!FU(r|0KsYl8k84^%&B>w0zdV}AYahuxeIz$D-b zj5J08ZcdNnk`_y_3`=nD=I?*~N&15i8g1ivL`$w7qqnBSkGUNB)mmZHRP{<@5CO{vVGI|O?ml#SQPXQj z3Ea4S&nsWJP+a%6f=fZsyR=r^TEm~`cauS+cA6?ual3|U7}r`mhnpMz#=7S>J--q5 zA4auS+>3gHzCVb5Zbx-L39B8|hsyn8k#l1HgN)K|l*^aBbKk0JJB-rY{^oh72)#gB zmJ!4+cR?I3h}B~=voEkEpCL|vBHhqyg@vcN^8EBJ8l-UMNQdYM{PQtuQf8i1+LU3J z$J`{&WRWx{)}51J9eQh0!i=SjLs&LD2#*GSh9sIG;?;Gyc$vvSs`q?se z3!kvx_yq15oO)pQ0fPR+E?!mSNu2T)ONly6AgG5)2tl>qhags+FsQ5Qpjl~0jULWv zIjmM=bucy^#`NNhyL8%-Vi!ySL9N&ADtvf?sF$b!pC7-UgtebcAl0fg;;^es;s2AZ zqCfSP`^n)-Mi`!7qm!*oXHg-{z2Usiwk^r7KRx4g&RqXHWQ=5=!7ROqpc|9y*uP7P zMXoJsn4s@;v;(GWV?I7mHL+I$ey6^9EcSdZvPF zOMT9&zho{2`&0e&db;)35p!cA1ltDuo)n8*+X~KQ<=;2?xlfdz-VHbZK4KJ;>qJr0 z6O-sI1BP>c=8q81^8egiW_}+z4Er(v&G_>?^S!ahfYHfby*B=?`5gmnj$F0G>u2~S z3R(SomeD`@I