Re: [PATCH v2 dwarves 2/2] github CI: Add comparison of generated BTF functions between baseline, change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30/06/2025 19:36, Ihor Solodrai wrote:
> On 6/30/25 3:15 AM, Alan Maguire wrote:
>> Sometimes changes can be introduced that modify the set of functions
>> encoded in BTF, or change aspects of that encoding.  Add a non-fatal
>> comparison job to compare between the change and the base branch,
>> by default the "next" branch.
>>
>> Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
>> ---
>>   .github/scripts/compare-functions.sh | 30 ++++++++++++++++++++++++++++
>>   .github/workflows/vmtest.yml         |  4 ++++
>>   2 files changed, 34 insertions(+)
>>   create mode 100755 .github/scripts/compare-functions.sh
>>
> 
> Hi Alan. That's a good addition. See a couple of comments below.
> 

Thanks for taking a look! Replies below..

>> diff --git a/.github/scripts/compare-functions.sh b/.github/scripts/
>> compare-functions.sh
>> new file mode 100755
>> index 0000000..062f15c
>> --- /dev/null
>> +++ b/.github/scripts/compare-functions.sh
>> @@ -0,0 +1,30 @@
>> +#!/usr/bin/bash
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +#
>> +# Copyright (c) 2025, Oracle and/or its affiliates.
>> +#
>> +
>> +GITHUB_WORKSPACE=${GITHUB_WORKSPACE:-$(pwd)}
>> +REPO_TARGET=${GITHUB_WORKSPACE}/.kernel
>> +VMLINUX=${GITHUB_WORKSPACE}/.kernel/vmlinux
>> +SELFTESTS=${GITHUB_WORKSPACE}/tests
> 
> nit: SELFTESTS isn't used
>

good catch! will remove

>> +export PATH=${GITHUB_WORKSPACE}/install/usr/local/bin:${PATH}
>> +which pahole
>> +pahole --version
>> +cd $REPO_TARGET
>> +pfunct --all --format_path=btf $VMLINUX > functions_latest
>> +# now use baseline pahole for comparison
>> +export PAHOLE=/usr/local/bin/pahole
> 
> So we assume that the baseline is installed at this path?
> And that would be an installation done by
> libbpf/ci/setup-build-env action?
> 
> I would not rely on that behavior.  I think a better approach is to
> build and use master (or whatever is the baseline) explicitly.
> 

sure I can change this for v3; likely patch 1 will be changed then to
pahole: 'none' since there's no advantage in building pahole as part of
the setup-build-env step.

>> +rm -f vmlinux vmlinux.o
>> +export PATH=/usr/local/bin:${PATH}
>> +make oldconfig
>> +make -j $((4*$(nproc))) all
>> +pfunct --all --format_path=btf $VMLINUX > functions_base
>> +echo "Comparing vmlinux BTF functions generated with this change vs
>> baseline."
>> +echo "Differences are non-fatal to the workflow, but should be
>> examined for correctness."
> 
> You might find it useful to dump a formatted diff to
> $GITHUB_STEP_SUMMARY, to get a rendered output in github UI.
> 
> See here: https://docs.github.com/en/actions/reference/workflow-
> commands-for-github-actions?versionId=free-pro-
> team%40latest&productId=actions#adding-a-job-summary
>

great, thanks for the tip!

Alan




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux