diff --git a/host/smartperf/client/client_command/include/smartperf_command.h b/host/smartperf/client/client_command/include/smartperf_command.h index e32d154d8..b2e03d4a8 100644 --- a/host/smartperf/client/client_command/include/smartperf_command.h +++ b/host/smartperf/client/client_command/include/smartperf_command.h @@ -67,6 +67,7 @@ public: void HelpCommand(CommandHelp type) const; void HandleCommand(std::string argStr, const std::string &argStr1); int GetItemInfo(std::multimap &spMap); + void printfExecCommand(const std::map data); // 采集次数 int num = 0; // 包名 diff --git a/host/smartperf/client/client_command/smartperf_command.cpp b/host/smartperf/client/client_command/smartperf_command.cpp index 98f571830..bbf340946 100644 --- a/host/smartperf/client/client_command/smartperf_command.cpp +++ b/host/smartperf/client/client_command/smartperf_command.cpp @@ -173,7 +173,6 @@ int SmartPerfCommand::GetItemInfo(std::multimap data = GpuCounter::GetInstance().ItemData(); - for (auto a = data.cbegin(); a != data.cend(); ++a) { - printf("order:%d %s=%s\n", i++, a->first.c_str(), a->second.c_str()); - } - + printfExecCommand(data); SPData spdata; spdata.values.insert(data.begin(), data.end()); vmap.push_back(spdata); @@ -226,6 +220,13 @@ std::string SmartPerfCommand::ExecCommand() SpCsvUtil::WriteCsv(std::string(outPath.c_str()), vmap); return std::string("command exec finished!"); } +void SmartPerfCommand::printfExecCommand(const std::map data) +{ + int i = 0; + for (auto a = data.cbegin(); a != data.cend(); ++a) { + printf("order:%d %s=%s\n", i++, a->first.c_str(), a->second.c_str()); + } +} void SmartPerfCommand::InitSomething() {