Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions android/gradle/collector_android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 30

defaultConfig {
applicationId "org.arm.collector_android"
minSdkVersion 15
targetSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -41,7 +41,7 @@ android {
externalNativeBuild {
cmake {
arguments "-DANDROID_TOOLCHAIN=clang",
"-DANDROID_PLATFORM=android-28",
"-DANDROID_PLATFORM=android-30",
"-DCMAKE_BUILD_TYPE=Debug"
}
}
Expand All @@ -51,7 +51,7 @@ android {
externalNativeBuild {
cmake {
arguments "-DANDROID_TOOLCHAIN=clang",
"-DANDROID_PLATFORM=android-28",
"-DANDROID_PLATFORM=android-30",
"-DCMAKE_BUILD_TYPE=Release"
}
}
Expand Down
8 changes: 4 additions & 4 deletions android/gradle/layer_android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 28
compileSdkVersion 30

defaultConfig {
minSdkVersion 15
targetSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
externalNativeBuild {
Expand All @@ -25,7 +25,7 @@ android {
externalNativeBuild {
cmake {
arguments "-DANDROID_TOOLCHAIN=clang",
"-DANDROID_PLATFORM=android-28",
"-DANDROID_PLATFORM=android-30",
"-DCMAKE_BUILD_TYPE=Debug"
}
}
Expand All @@ -35,7 +35,7 @@ android {
externalNativeBuild {
cmake {
arguments "-DANDROID_TOOLCHAIN=clang",
"-DANDROID_PLATFORM=android-28",
"-DANDROID_PLATFORM=android-30",
"-DCMAKE_BUILD_TYPE=Release"
}
}
Expand Down
4 changes: 2 additions & 2 deletions collectors/collector_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ static bool searchMemoryAreaForKeyword(const char* data, size_t dataLen, const s
const int n = dataLen;

// Generate bad-character shift table
int ASIZE = UCHAR_MAX+1; // Alphabet size
int bmBc[ASIZE];
const int ASIZE = UCHAR_MAX+1; // Alphabet size
std::vector<int> bmBc(ASIZE);

for (int i = 0; i < ASIZE; ++i)
bmBc[i] = m;
Expand Down
3 changes: 0 additions & 3 deletions collectors/ferret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,6 @@ Json::Value postprocess_ferret_data(const std::string& outputFname, const std::v
double max_active = 0.0;
double max_duration = 0.0;
double mcycle_sum = 0.0;
int sample_index = 0;
int max_index = 0;

for ( auto& pid_pair : pidHistory )
Expand Down Expand Up @@ -1406,8 +1405,6 @@ Json::Value postprocess_ferret_data(const std::string& outputFname, const std::v

skipped += 1;
}

sample_index += 1;
}

results["main_thread_index"] = max_index;
Expand Down
3 changes: 0 additions & 3 deletions collectors/perf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,7 @@ class PerfCollector : public Collector
std::map<std::string, std::vector<struct event>> mCSPMUEvents;
std::map<std::string, std::vector<struct timespec>> mClocks; // device_name -> clock_vector
int last_collect_scope_flags = 0;

bool attempt_collect_scope_x64 = false;
uint64_t PMCNTENSET_EL0_safe = 0;
uint64_t PMCR_EL0_safe = 0;

struct perf_thread
{
Expand Down
26 changes: 11 additions & 15 deletions collectors/power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ bool PowerDaemon::start(const Json::Value& config_root)

Json::Value config = config_root["rails"];

uint32_t numRails = uint32_t(config.size());
const uint32_t numRails = uint32_t(config.size());
uint32_t d = htonl(numRails);
DBG_LOG("Sending rail configuration for %d rails\n", numRails);
if (write(mSocketFD, &d, sizeof(d)) != sizeof(d))
Expand Down Expand Up @@ -292,8 +292,8 @@ bool PowerDaemon::stop(const std::vector<int64_t>& timing, CollectorValueResults
DBG_LOG("Rail %d resistor coefficient = %3.3f\n", i, railResistorCoefficients[i]);
}

unsigned int totalSamples = numBytes / sizeof(float64);
unsigned int numRails = railResistorCoefficients.size();
const unsigned totalSamples = numBytes / sizeof(float64);
const unsigned numRails = railResistorCoefficients.size();

DBG_LOG("Got %u bytes of data (%u samples or %3.3f s) from the daemon.\n", numBytes,
totalSamples, (float)totalSamples / (10000 * 2 * numRails));
Expand All @@ -308,12 +308,9 @@ bool PowerDaemon::stop(const std::vector<int64_t>& timing, CollectorValueResults

unsigned int currentTime = 0; // unit = one sample (100 us)

long long accountedv[numRails];
long long accountedi[numRails];
long long accountedp[numRails];
memset(accountedv, 0x00, sizeof(accountedv));
memset(accountedi, 0x00, sizeof(accountedi));
memset(accountedp, 0x00, sizeof(accountedp));
std::vector<int64_t> accountedv(numRails);
std::vector<int64_t> accountedi(numRails);
std::vector<int64_t> accountedp(numRails);
unsigned int accountedSamples = 0;

double nextFrameEndTime = 0;
Expand All @@ -322,12 +319,9 @@ bool PowerDaemon::stop(const std::vector<int64_t>& timing, CollectorValueResults
nextFrameEndTime += i;
unsigned int nextFrameEndTimeInSamples = (unsigned int)(nextFrameEndTime * 10000);
unsigned int samples = 0;
int64_t framev[numRails];
int64_t framei[numRails];
int64_t framep[numRails];
memset(framev, 0x00, sizeof(framev));
memset(framei, 0x00, sizeof(framei));
memset(framep, 0x00, sizeof(framep));
std::vector<int64_t> framev(numRails);
std::vector<int64_t> framei(numRails);
std::vector<int64_t> framep(numRails);

while (currentTime < nextFrameEndTimeInSamples)
{
Expand Down Expand Up @@ -384,6 +378,8 @@ bool PowerDaemon::stop(const std::vector<int64_t>& timing, CollectorValueResults
TraceExecutor::addResult(mResultNames[2][i].c_str(), avgp * 1000.0f);
}
}
#else
(void)accountedSamples; // silence compiler
#endif

DBG_LOG("%d extra samples (%3.3f s) of power data.\n", totalSamples / (2 * numRails) - currentTime,
Expand Down
2 changes: 0 additions & 2 deletions interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,5 @@ class Collection
std::vector<std::string> mCustomHeaders;
int64_t mStartTime = 0;
int64_t mPreviousTime = 0;
bool mScopeStarted = false;
int64_t mScopeStartTime = 0;
bool mDebug = false;
};
1 change: 1 addition & 0 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class Test8
int tmp = 1;
for (int i = 0; i < ops; i++)
tmp *= rand();
(void)tmp; // shush compiler
};

if (strncmp(thread_name.c_str(), "patrace", 7) == 0)
Expand Down