vintf: clean up output.

Output summarizes <hal> tags and omits kernel
configs now. If a user still wants these output, --verbose
can be used.

Test: adb shell vintf
Change-Id: Id7716d55d9a6a159df180d476609d95035ec0c15
diff --git a/CompatibilityMatrix.cpp b/CompatibilityMatrix.cpp
index 00e4d14..7bdc3a9 100644
--- a/CompatibilityMatrix.cpp
+++ b/CompatibilityMatrix.cpp
@@ -313,5 +313,21 @@
     return matrix;
 }
 
+void CompatibilityMatrix::forEachInstance(
+    const std::function<void(const std::string&, const VersionRange&, const std::string&,
+                             const std::string&, bool, bool*)>& f) const {
+    bool stop = false;
+    for (const auto& hal : getHals()) {
+        for (const auto& v : hal.versionRanges) {
+            for (const auto& intf : iterateValues(hal.interfaces)) {
+                for (const auto& instance : intf.instances) {
+                    f(hal.name, v, intf.name, instance, hal.optional, &stop);
+                    if (stop) break;
+                }
+            }
+        }
+    }
+}
+
 } // namespace vintf
 } // namespace android