libabigail/tools
Dodji Seketeli f6bca156ca Make abipkgdiff.cc use the abigail::workers interface
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>
2017-02-27 10:15:33 +01:00
..
.gitignore Add .gitignore files. 2014-09-12 11:05:01 +02:00
abiar.cc Adjust archive-related code for the recent addition of tools_utils::* 2015-01-13 11:02:10 +01:00
abicompat.cc Update copyright year on a bunch of files 2017-01-05 12:51:49 +01:00
abidiff.cc Bug 20476 - Compare virtual member functions when comparing classes 2017-02-14 12:49:47 +01:00
abidw.cc Fix help string for --header-dirs 2017-02-13 17:42:26 +01:00
abilint.cc Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
abipkgdiff.cc Make abipkgdiff.cc use the abigail::workers interface 2017-02-27 10:15:33 +01:00
abisym.cc Fix misleading indentation issues 2016-09-21 12:06:51 +02:00
binilint.cc Update copyright years 2015-01-07 17:52:10 +01:00
fedabipkgdiff fedabipkgdiff refuses to compare packages with the same release number 2017-02-15 16:06:32 +01:00
Makefile.am Control symbols exported from libabigail.so 2016-07-27 12:51:02 +02:00