Skip to content

Commit

Permalink
Merge pull request #14 from zilzho01/zilzho01
Browse files Browse the repository at this point in the history
save perf result for each thread
  • Loading branch information
per-mathisen-arm authored May 6, 2024
2 parents fb5facd + 03d0f80 commit a0ef3f1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions collectors/perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,15 +452,22 @@ bool PerfCollector::postprocess(const std::vector<int64_t>& timing)
int i=0;
for (perf_thread& t : mReplayThreads)
{
Json::Value perf_threadValue;
perf_threadValue["CCthread"] = t.name.c_str();
t.postprocess(perf_threadValue);
t.postprocess(replayValue);
for (unsigned int j =0; j<mMultiPMUEvents.size();j++)
{
mMultiPMUThreads[i].postprocess(replayValue);
i++;
}
mCustomResult["thread_data"].append(perf_threadValue);
}
for (perf_thread& t : mCSPMUThreads)
{
Json::Value perf_threadValue;
perf_threadValue["CCthread"] = t.name.c_str();
t.postprocess(perf_threadValue);
t.postprocess(replayValue);
std::string sec_name = t.device_name + "_sec";
std::string nsec_name = t.device_name + "_nsec";
Expand All @@ -474,11 +481,16 @@ bool PerfCollector::postprocess(const std::vector<int64_t>& timing)
clockValue[sec_name.c_str()].append((Json::Value::Int64)iter.tv_sec);
clockValue[nsec_name.c_str()].append((Json::Value::Int64)iter.tv_nsec);
}
mCustomResult["thread_data"].append(perf_threadValue);
mCustomResult["thread_data"].append(clockValue);
}
for (perf_thread& t : mBookerThread)
{
Json::Value perf_threadValue;
perf_threadValue["CCthread"] = t.name.c_str();
t.postprocess(perf_threadValue);
t.postprocess(replayValue);
mCustomResult["thread_data"].append(perf_threadValue);
}
mCustomResult["thread_data"].append(replayValue);

Expand All @@ -492,6 +504,9 @@ bool PerfCollector::postprocess(const std::vector<int64_t>& timing)

for (perf_thread& t : mBgThreads)
{
Json::Value perf_threadValue;
perf_threadValue["CCthread"] = t.name.c_str();
t.postprocess(perf_threadValue);
t.postprocess(bgValue);
t.postprocess(allValue);
for (unsigned int j =0; j<mMultiPMUEvents.size();j++)
Expand All @@ -500,7 +515,9 @@ bool PerfCollector::postprocess(const std::vector<int64_t>& timing)
mMultiPMUThreads[i].postprocess(allValue);
i++;
}
mCustomResult["thread_data"].append(perf_threadValue);
}

mCustomResult["thread_data"].append(bgValue);
mCustomResult["thread_data"].append(allValue);
}
Expand Down Expand Up @@ -649,6 +666,11 @@ void PerfCollector::create_perf_thread()
mBgThreads.emplace_back(tid, thread_name);
for (unsigned int i =0; i<mMultiPMUEvents.size();i++) mMultiPMUThreads.emplace_back(tid, thread_name);
}
if (mAllThread && !strncmp(thread_name.c_str(), "ANGLE-", 6))
{
mBgThreads.emplace_back(tid, thread_name);
for (unsigned int i =0; i<mMultiPMUEvents.size();i++) mMultiPMUThreads.emplace_back(tid, thread_name);
}
}
}
closedir(dirp);
Expand Down

0 comments on commit a0ef3f1

Please sign in to comment.