mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-18 16:04:34 +00:00
17b04f2e04
Abipkgdiff now attempts to extract packages and compare the resulting ELF pairs in parallel. First off, a thread is spawned to extract each package and each debuginfo package. After the ELF files are extracted, mapped and the threads are successfully collected, the resulting ELF vectors are traversed to identify existing pairs and a list of arguments for future comparison is made. This list is then sorted by size from largest to smallest. Unless --no-parallel is specified on the command line, MIN(pairs,active_processors) threads are spawned, sharing a single list of arguments. This list is processed and a map of (ELF_PATH,DIFF_CORPUS) is created. Meanwhile, the main thread checks this same map for results in the original order of the ELF pairs, ensuring sequential output. After all the diffing and reporting is done, the threads are collected again. * doc/manuals/abipkgdiff.rst: Mention the new --no-parallel option. * tools/Makefile.am: Add -pthread to abipkgdiffs link options. * tools/abipkgdiff.cc (elf_file_paths_tls_key): New key for the thread-local vector of ELF filepaths. (reports_map): A map of the path of the first ELF of a compared pair and a corpus representing the difference. (env_map): A map of the corpus difference and a corresponding environment needed to be kept alive until the diff is reported. ({arg,map}_lock): mutexes to control access to the comparison argument list and the {reports,env}_map respectively. (options): Add a new member "parallel" and set it to true in the ctor. (elf_file): Add a new "size" member and set it in the ctor. (package descriptor): Arguments passed to extract_package_set. (compare_args): Arguments passed to the ELF comparison function. (display_usage): Mention the new "--no-parallel" option. (pthread_routine_extract_package): A wrapper function around extract_package to be used in a multi-threaded environment. ({first_second}_package_tree_walker_callback_fn): Add the new ELF file paths to a thread-specific vector. (compare): In an overload of compare, verbose output is updated to always mention the ELF files being compared for each reported stage. Reporting is no longer done in this function, the resulting difference is instead passed back to the calling function for reporting in the main thread, along with a corresponding environment. (pthread_routine_compare): Accept a pointer to a vector of comparison arguments. This function is to be called NTHREAD times and share the vector passed to it with its other invocations. Create the environment for compare() and store its output in a map if there is a difference. (create_maps_of_package_content): Allocate memory for a thread local vector of ELF paths and dispose of it before returning. (pthread_routine_extract_pkg_and_map_its_content): Renamed from extract_package_and_map_its_content. Extract the debuginfo as well as the regular package in this function. Spawn a separate thread for the extraction of the debug package. (pthread_join): A function handling thread joining throughout package extractions. (prepare_packages): Spawn a thread to extract each set of packages. (elf_size_is_greater): New comparison function used to order ELF pairs by size. (compare): In the overload of compare, pass through the ELF path vectors and identify pairs to be diffed. Put them in a vector and sort it by the summed ELF pair size. Spawn comparison threads and safely check for results in the proper order of the ELF pairs. Report any differences ASAP and collect the threads after all the reporting is done, checking their return status. (parse_command_line): Check for the "--no-parallel" option. Signed-off-by: Ondrej Oprala <ooprala@redhat.com> |
||
---|---|---|
.. | ||
.gitignore | ||
abiar.cc | ||
abicompat.cc | ||
abidiff.cc | ||
abidw.cc | ||
abilint.cc | ||
abipkgdiff.cc | ||
abisym.cc | ||
binilint.cc | ||
Makefile.am |