From: Dodji Seketeli Date: Wed, 4 Oct 2017 08:33:53 +0000 (+0200) Subject: Add --full-impact option to kmidiff X-Git-Tag: upstream/1.0~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b34a860e2300c27268933700cb812fe8dc1bf5c;p=platform%2Fupstream%2Flibabigail.git Add --full-impact option to kmidiff This patch changes the default report emitted by kmidiff. Now, it emits a leaf changes report by default. And if the user wants the classical kind of report then she can use the --full-impact option. * doc/manuals/kmidiff.rst: Add documentation for the new --full-impact|-f option. * tools/kmidiff.cc (options::leaf_changes_only): Add new data member. (option::option): Initialize the new data member. (display_usage): Add a documentation string for the new --full-impact|-f option. (parse_command_line): Parse the new --full-impact|-f option. (set_diff_context): Set the diff context appropriately. Signed-off-by: Dodji Seketeli --- diff --git a/doc/manuals/kmidiff.rst b/doc/manuals/kmidiff.rst index 1b184c35..eafefce2 100644 --- a/doc/manuals/kmidiff.rst +++ b/doc/manuals/kmidiff.rst @@ -147,3 +147,10 @@ Options Please note that, by default, if this option is not provided, then the :ref:`default suppression specification files ` are loaded . + + + * ``--full-impact | -f`` + + Emit a change report that shows the full impact of each change on + exported interfaces. This is the default kind of report emitted + by tools like ``abidiff`` or ``abipkgdiff``. diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc index 02dd5e8a..c10d850d 100644 --- a/tools/kmidiff.cc +++ b/tools/kmidiff.cc @@ -72,6 +72,7 @@ struct options bool display_version; bool verbose; bool missing_operand; + bool leaf_changes_only; string wrong_option; string kernel_dist_root1; string kernel_dist_root2; @@ -86,7 +87,8 @@ struct options : display_usage(), display_version(), verbose(), - missing_operand() + missing_operand(), + leaf_changes_only(true) {} }; // end struct options. @@ -108,7 +110,9 @@ display_usage(const string& prog_name, ostream& out) << " --vmlinux2|--l2 the path to the second vmlinux\n" << " --suppressions|--suppr specify a suppression file\n" << " --kmi-whitelist|-w path to a kernel module interface " - "whitelist\n"; + "whitelist\n" + << " --full-impact|-f show the full impact of changes on top-most " + "interfaces\n"; } /// Parse the command line of the program. @@ -205,6 +209,9 @@ parse_command_line(int argc, char* argv[], options& opts) opts.suppression_paths.push_back(argv[j]); ++i; } + else if (!strcmp(argv[i], "--full-impact") + || !strcmp(argv[i], "-f")) + opts.leaf_changes_only = false; } return true; @@ -256,6 +263,7 @@ set_diff_context(diff_context_sptr ctxt, const options& opts) (false); ctxt->show_symbols_unreferenced_by_debug_info (true); + ctxt->show_leaf_changes_only(opts.leaf_changes_only); ctxt->switch_categories_off(get_default_harmless_categories_bitmap());