Skip to content

Commit

Permalink
Merge pull request #17 from qiq-2022/fixtowerPMU
Browse files Browse the repository at this point in the history
Fix the error of Tower PMU after upgrade to kernel6.6
  • Loading branch information
per-mathisen-arm authored Jul 4, 2024
2 parents d9524e2 + 1505ea8 commit d629076
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions collectors/perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,18 @@ void PerfCollector::create_perf_thread()
{
std::string current_pName = getThreadName(0);

if(!mCSPMUEvents.empty())
{
int i=0;
for (auto pair : mCSPMUEvents)
{
mCSPMUThreads.emplace_back(getpid(), current_pName);
mCSPMUThreads[i].device_name = pair.second[0].device;
i++;
}
return;
}

DIR *dirp = NULL;
if ((dirp = opendir("/proc/self/task")) == NULL)
return;
Expand Down Expand Up @@ -679,14 +691,6 @@ void PerfCollector::create_perf_thread()
}
closedir(dirp);

int i=0;
for (auto pair : mCSPMUEvents)
{
mCSPMUThreads.emplace_back(getpid(), current_pName);
mCSPMUThreads[i].device_name = pair.second[0].device;
i++;
}

if (mBookerEvents.size() > 0)
{
mBookerThread.emplace_back(getpid(), current_pName);
Expand Down

0 comments on commit d629076

Please sign in to comment.