From cef581e9e1224bbcba5107477e8383a4002627a3 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Fri, 6 Oct 2017 11:25:48 +0200 Subject: [PATCH] Add --impacted-changes option to kmidiff kmidiff displays leaf changes by default and and it does so by *not* showing impacted interfaces. This patch add a --impacted-changes option to kmidiff so that it shows the interfaces that are impacted by each leaf change. Thus, by default, no impacted interface is shown. * doc/manuals/kmidiff.rst: Document the new --impacted-changes option. * tools/kmidif.cc (options::show_impacted_interfaces): Add new data member. (options::options): Initialize the new data member to false. (display_usage): Add a description string for the new --impacted-changes option. (parse_command_line): Parse the new --impacted-changes option. (set_diff_context): Update the 'show-impacted-interface' property accordingly. Signed-off-by: Dodji Seketeli --- doc/manuals/kmidiff.rst | 4 ++++ tools/kmidiff.cc | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/manuals/kmidiff.rst b/doc/manuals/kmidiff.rst index eafefce2..f1564f8c 100644 --- a/doc/manuals/kmidiff.rst +++ b/doc/manuals/kmidiff.rst @@ -149,6 +149,10 @@ Options ` are loaded . + * ``--full-impact | -f`` + + Tell what interfaces got impacted by each individual ABI change. + * ``--full-impact | -f`` Emit a change report that shows the full impact of each change on diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc index c10d850d..142821d4 100644 --- a/tools/kmidiff.cc +++ b/tools/kmidiff.cc @@ -73,6 +73,7 @@ struct options bool verbose; bool missing_operand; bool leaf_changes_only; + bool show_impacted_interfaces; string wrong_option; string kernel_dist_root1; string kernel_dist_root2; @@ -88,7 +89,8 @@ struct options display_version(), verbose(), missing_operand(), - leaf_changes_only(true) + leaf_changes_only(true), + show_impacted_interfaces(false) {} }; // end struct options. @@ -111,6 +113,7 @@ display_usage(const string& prog_name, ostream& out) << " --suppressions|--suppr specify a suppression file\n" << " --kmi-whitelist|-w path to a kernel module interface " "whitelist\n" + << " --impacted-interfaces|-i show interfaces impacted by ABI changes\n" << " --full-impact|-f show the full impact of changes on top-most " "interfaces\n"; } @@ -209,6 +212,9 @@ parse_command_line(int argc, char* argv[], options& opts) opts.suppression_paths.push_back(argv[j]); ++i; } + else if (!strcmp(argv[i], "--impacted-interfaces") + || !strcmp(argv[i], "-i")) + opts.show_impacted_interfaces = true; else if (!strcmp(argv[i], "--full-impact") || !strcmp(argv[i], "-f")) opts.leaf_changes_only = false; @@ -264,6 +270,7 @@ set_diff_context(diff_context_sptr ctxt, const options& opts) ctxt->show_symbols_unreferenced_by_debug_info (true); ctxt->show_leaf_changes_only(opts.leaf_changes_only); + ctxt->show_impacted_interfaces(opts.show_impacted_interfaces); ctxt->switch_categories_off(get_default_harmless_categories_bitmap()); -- 2.43.5