mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-01 23:12:05 +00:00
f6bca156ca
With this patch, the code of abipkgdiff.cc doesn't use the pthreads API directly anymore. Rather, it uses the higher level "Workers Queue" API provided by the abigail::workers namespace. The main benefits are: - better code readability and maintainability. The code base doesn't have any global variable anymore. This is going to be helpful when adding new features to the abipkgdiff.cc code base. - faster code. The tests/runtestdiffpkg test program executes on ~ 17s without the patch, and on ~ 11s with the patch on my old X220 laptop. * tools/abipkgdiff.cc: Remove ftw.h, pthread.h, unistd.h, add fts.h and abg-workers.h. (verbose, elf_file_paths_tls_key, reports_map, env_map, map_lock) (arg_lock, prog_options): Remove all these global variables. (struct package_descriptor): Remove this type. (pthread_routine_extract_package) (first_package_tree_walker_callback_fn) (second_package_tree_walker_callback_fn, pthread_routine_compare) (pthread_join, pthread_routine_extract_pkg_and_map_its_content): Remove these functions. (options::{num_workers, verbose}): Define new data members. (options::options): Initialize the new verbose and num_workers data members. (package::erase_extraction_directory) (erase_created_temporary_directories_parent): Take the program options in parameter. Don't use the global verbose variable anymore. (package::erase_extraction_directories) (erase_created_temporary_directories, extract_package): Take the program options in parameter. (extract_rpm, extract_deb, extract_tar): Likewise. And don't use the global verbose variable anymore. (compare): Don't use the global verbose variable anymore. Use the new compare_task type along with the abigail::workers::queue type. (pkg_extraction_task, pkg_prepare_task, compare_task) (comparison_done_notify): Define new classes. (maybe_update_vector_of_package_content): Define new static function. (create_maps_of_package_content): Don't take the ftw_cp_type anymore. Don't use the global verbose variable anymore. Use the fts_{open,read,close} functions, rather than the ftw one. (extract_package_and_map_its_content): Don't use pthreads anymore. Use the new pkg_extraction_task type created along with the abigail::workers::queue type. (prepare_packages): Don't use pthreads anymore. Use the new pkg_prepare_task type along with the abigail::workers::queue type. (elf_size_is_greater): Adjust to use abigail::workers::queue::tasks, rather than the previous compaer_args_sptr type. (parse_command_line): Adjust to stop using the global verbose variable. (main): Remove use of global variables prog_options and also the packages variable. * tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt: Adjust. * tests/data/test-diff-pkg/dirpkg-0-report-0.txt: Likewise. * tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-0.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-1.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-2.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-3.txt: Likewise. * tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test4-glib-0.100.2-2.fc20.x86_64.rpm-glib-0.106-1.fc23.x86_64.rpm-report-0.txt: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
test-abicompat | ||
test-abidiff | ||
test-abidiff-exit | ||
test-alt-dwarf-file | ||
test-annotate | ||
test-core-diff | ||
test-default-supprs | ||
test-diff-dwarf | ||
test-diff-dwarf-abixml | ||
test-diff-filter | ||
test-diff-pkg | ||
test-diff-suppr | ||
test-fedabipkgdiff | ||
test-lookup-syms | ||
test-read-dwarf | ||
test-read-write | ||
test-types-stability | ||
test-write-read-archive | ||
Makefile.am |