[OE-core] [PATCH] perf: Additional fixes for 5.5+

Andrey Zhizhikin andrey.z at gmail.com
Mon Feb 3 07:07:40 UTC 2020


On Mon, Feb 3, 2020 at 7:35 AM Joel Stanley <joel at jms.id.au> wrote:
>
> In e5c4f3127521 ("perf: fix build for v5.5+") this recipe was fixed for
> 5.5 kernels, however testing shows that there's a few other changes
> required.
>
> perf's build system uses a file from the scripts/ directory to
> generate a bpf header, so this must be added to the list of files to
> perform a replace on.
>
> Additionally the replacement would run on all occurrences of
> /usr/bin/python first, resulting in lines that contained
> "/usr/bin/env python32". This re-orders the sed lines to avoid that.
>
> This fixes warnings such the following:
>
>    File "/usr/lib/python3.6/sysconfig.py", line 421, in _init_posix
>      _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
>  ModuleNotFoundError: No module named '_sysconfigdata'
>
> Change-Id: I8d0011908c87d5fbcf1c3aefb362fe6beb64d22e
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
> Found when attempting to use 5.5 with OpenBMC.
>
> The sed method of fixing this may be fragile, and moving to patching the
> source tree may be preferred in the future.
>
>  meta/recipes-kernel/perf/perf.bb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
> index 6d1b06693d26..1e0be467c024 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -239,11 +239,11 @@ do_configure_prepend () {
>      fi
>
>      # use /usr/bin/env instead of version specific python
> -    for s in `find ${S}/tools/perf/ -name '*.py'`; do
> -        sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}"
> +    for s in `find ${S}/tools/perf/ -name '*.py'` scripts/bpf_helpers_doc.py; do

bpf_helpers_doc.py script is already python3, and according to the GIT
[1] - it was created like that. Do we really need to include it in the
list? Besides, provided this is really needed - does it make sense to
check all scripts instead of explicitly supplying just one here?

>          sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "${s}"
>          sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "${s}"
>          sed -i 's,/usr/bin/python3,/usr/bin/env python3,' "${s}"
> +        sed -i 's,/usr/bin/python,/usr/bin/env python3,' "${s}"
>      done
>
>      # unistd.h can be out of sync between libc-headers and the captured version in the perf source
> --
> 2.24.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/scripts/bpf_helpers_doc.py?h=v5.5

-- 
Regards,
Andrey.


More information about the Openembedded-core mailing list