summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-10-10 17:06:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-11 12:17:03 +0100
commit827716ac0aa2de296f64db5d950ae5b31dd2dcc8 (patch)
tree2d4266fc85cd51c3a524a84d4f2dca91039d28ad
parent876d319f73cadd1168beecb5b2eedae696f68fd9 (diff)
downloadpoky-827716ac0aa2de296f64db5d950ae5b31dd2dcc8.tar.gz
insane: tidy up objdump preloading in package_qa_walk()
Move the prepopulate function out of global scope, and access the dictionary once instead of repeatedly. This still results in each ELF being opened twice, but this avoids opening all of the files at once and the ELFFile.open() call is fairly fast. (From OE-Core rev: cda3647b32703f43c4fe2af3bab977e5698633f6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-global/insane.bbclass21
1 files changed, 11 insertions, 10 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 401807b2be..b165f111ce 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -763,10 +763,6 @@ def qa_check_staged(path,d):
763 if not skip_shebang_size: 763 if not skip_shebang_size:
764 package_qa_check_shebang_size(path, "", d, None) 764 package_qa_check_shebang_size(path, "", d, None)
765 765
766def prepopulate_objdump_p(elf, d):
767 output = elf.run_objdump("-p", d)
768 return (elf.name, output)
769
770# Walk over all files in a directory and call func 766# Walk over all files in a directory and call func
771def package_qa_walk(checkfuncs, package, d): 767def package_qa_walk(checkfuncs, package, d):
772 elves = {} 768 elves = {}
@@ -782,17 +778,22 @@ def package_qa_walk(checkfuncs, package, d):
782 if elf: 778 if elf:
783 elves[path] = elf 779 elves[path] = elf
784 780
781 def prepopulate_objdump_p(elf, d):
782 output = elf.run_objdump("-p", d)
783 return (elf.name, output)
784
785 results = oe.utils.multiprocess_launch(prepopulate_objdump_p, elves.values(), d, extraargs=(d,)) 785 results = oe.utils.multiprocess_launch(prepopulate_objdump_p, elves.values(), d, extraargs=(d,))
786 for item in results: 786 for item in results:
787 elves[item[0]].set_objdump("-p", item[1]) 787 elves[item[0]].set_objdump("-p", item[1])
788 788
789 for path in pkgfiles[package]: 789 for path in pkgfiles[package]:
790 if path in elves: 790 elf = elves.get(path)
791 elves[path].open() 791 if elf:
792 for func in checkfuncs: 792 elf.open()
793 func(path, package, d, elves.get(path)) 793 for func in checkfuncs:
794 if path in elves: 794 func(path, package, d, elf)
795 elves[path].close() 795 if elf:
796 elf.close()
796 797
797def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d): 798def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
798 # Don't do this check for kernel/module recipes, there aren't too many debug/development 799 # Don't do this check for kernel/module recipes, there aren't too many debug/development