pdbg utils for finding all active chips

Change-Id: I444c1062d28c10ecd47426c60ffe0604cc5eaac5
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
diff --git a/analyzer/analyzer_main.cpp b/analyzer/analyzer_main.cpp
index cf78149..30efd74 100644
--- a/analyzer/analyzer_main.cpp
+++ b/analyzer/analyzer_main.cpp
@@ -20,7 +20,7 @@
 
 // Forward references for externally defined functions.
 
-void initializeIsolator(const std::vector<libhei::Chip>& i_chips);
+void initializeIsolator(std::vector<libhei::Chip>& o_chips);
 
 //------------------------------------------------------------------------------
 
@@ -69,67 +69,6 @@
 
 //------------------------------------------------------------------------------
 
-// Returns the chip model/level of the given target.
-libhei::ChipType_t __getChipType(pdbg_target* i_trgt)
-{
-    libhei::ChipType_t type;
-
-    // START WORKAROUND
-    // TODO: Will need to grab the model/level from the target attributes when
-    //       they are available. For now, use ATTR_TYPE to determine which
-    //       currently supported value to use supported.
-    uint8_t attrType = util::pdbg::getTrgtType(i_trgt);
-    switch (attrType)
-    {
-        case 0x05: // PROC
-            type = 0x120DA049;
-            break;
-
-        case 0x4b: // OCMB_CHIP
-            type = 0x160D2000;
-            break;
-
-        default:
-            trace::err("Unsupported ATTR_TYPE value: 0x%02x", attrType);
-            assert(0);
-    }
-    // END WORKAROUND
-
-    return type;
-}
-
-//------------------------------------------------------------------------------
-
-// Gathers list of active chips to analyze.
-void __getActiveChips(std::vector<libhei::Chip>& o_chips)
-{
-    // Iterate each processor.
-    pdbg_target* procTrgt;
-    pdbg_for_each_class_target("proc", procTrgt)
-    {
-        // Active processors only.
-        if (PDBG_TARGET_ENABLED != pdbg_target_probe(procTrgt))
-            continue;
-
-        // Add the processor to the list.
-        o_chips.emplace_back(procTrgt, __getChipType(procTrgt));
-
-        // Iterate the connected OCMBs, if they exist.
-        pdbg_target* ocmbTrgt;
-        pdbg_for_each_target("ocmb", procTrgt, ocmbTrgt)
-        {
-            // Active OCMBs only.
-            if (PDBG_TARGET_ENABLED != pdbg_target_probe(ocmbTrgt))
-                continue;
-
-            // Add the OCMB to the list.
-            o_chips.emplace_back(ocmbTrgt, __getChipType(ocmbTrgt));
-        }
-    }
-}
-
-//------------------------------------------------------------------------------
-
 // Takes a signature list that will be filtered and sorted. The first entry in
 // the returned list will be the root cause. If the returned list is empty,
 // analysis failed.
@@ -237,12 +176,9 @@
 
     trace::inf(">>> enter analyzeHardware()");
 
-    // Get the active chips to be analyzed.
-    std::vector<libhei::Chip> chips;
-    __getActiveChips(chips);
-
-    // Initialize the isolator for all chips.
+    // Initialize the isolator and get all of the chips to be analyzed.
     trace::inf("Initializing the isolator...");
+    std::vector<libhei::Chip> chips;
     initializeIsolator(chips);
 
     // Isolate attentions.