Add support for performance dump
Performance dump is a collection of hardware performance data
stored in the hardware registers. This commit adds support for
collecting the performance data from the hardware.
Test:
/tmp/dump-collect --type 3 --id 1 \
--path /tmp/dd/plat_dump/ \
--failingunit 1
PDBG Initialization started
Enter: getDump(3) on /proc3
Enter: getDump(3) on /proc0
Enter: getDump(3) on /proc1
Enter: getDump(3) on /proc2
Collected contents
plat_dump/00000001.SbeDataClocksOn.node0.proc0
plat_dump/00000001.SbeDataClocksOn.node0.proc1
plat_dump/00000001.SbeDataClocksOn.node0.proc2
plat_dump/00000001.SbeDataClocksOn.node0.proc3
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I45d021b8ea109e4c7def4b92ccef9dcf0df7ae4c
diff --git a/dump/dump_collect_main.cpp b/dump/dump_collect_main.cpp
index 158b6cf..ac43fb1 100644
--- a/dump/dump_collect_main.cpp
+++ b/dump/dump_collect_main.cpp
@@ -31,7 +31,7 @@
app.add_option("--type, -t", type, "Type of the dump")
->required()
->check(CLI::IsMember({SBE_DUMP_TYPE_HARDWARE, SBE_DUMP_TYPE_HOSTBOOT,
- SBE_DUMP_TYPE_SBE}));
+ SBE_DUMP_TYPE_SBE, SBE_DUMP_TYPE_PERFORMANCE}));
app.add_option("--id, -i", id, "ID of the dump")->required();
diff --git a/dump/sbe_consts.hpp b/dump/sbe_consts.hpp
index 731aecc..4088929 100644
--- a/dump/sbe_consts.hpp
+++ b/dump/sbe_consts.hpp
@@ -4,6 +4,7 @@
// Dump type to the sbe_dump chipop
constexpr auto SBE_DUMP_TYPE_HOSTBOOT = 0x5;
constexpr auto SBE_DUMP_TYPE_HARDWARE = 0x1;
+constexpr auto SBE_DUMP_TYPE_PERFORMANCE = 0x3;
// SBE dump type
constexpr auto SBE_DUMP_TYPE_SBE = 0xA;
diff --git a/dump/sbe_dump_collector.cpp b/dump/sbe_dump_collector.cpp
index bdf43c8..3e74736 100644
--- a/dump/sbe_dump_collector.cpp
+++ b/dump/sbe_dump_collector.cpp
@@ -68,6 +68,11 @@
std::vector<uint8_t> clockStates = {SBE_CLOCK_ON, SBE_CLOCK_OFF};
for (auto cstate : clockStates)
{
+ // Skip collection for performance dump if clock state is not ON
+ if (type == SBE_DUMP_TYPE_PERFORMANCE && cstate != SBE_CLOCK_ON)
+ {
+ continue;
+ }
auto futures = spawnDumpCollectionProcesses(type, id, path, failingUnit,
cstate, targets);