diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-13 23:22:55 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-13 23:22:55 +0000 |
commit | fd728c6783413a814a932a5fd7c4f140fe596786 (patch) | |
tree | 90bb3813b2e964d5e7e5c3cb42cc08f6e267240e | |
parent | 403269d8d415d985371bd0e4f1bdd9ce744c41a6 (diff) | |
parent | 266aa3bf840ab8392397cb86d59a064992db966b (diff) | |
download | extras-android-14.0.0_r28.tar.gz |
Snap for 10314561 from 266aa3bf840ab8392397cb86d59a064992db966b to udc-releaseandroid-vts-14.0_r1android-security-14.0.0_r9android-security-14.0.0_r8android-security-14.0.0_r7android-security-14.0.0_r6android-security-14.0.0_r5android-security-14.0.0_r4android-security-14.0.0_r3android-security-14.0.0_r2android-security-14.0.0_r1android-platform-14.0.0_r7android-platform-14.0.0_r6android-platform-14.0.0_r5android-platform-14.0.0_r4android-platform-14.0.0_r3android-platform-14.0.0_r2android-platform-14.0.0_r1android-cts-14.0_r1android-14.0.0_r28android-14.0.0_r2android-14.0.0_r15android-14.0.0_r14android-14.0.0_r13android-14.0.0_r1android14-security-releaseandroid14-s2-releaseandroid14-s1-releaseandroid14-releaseandroid14-platform-release
Change-Id: Iabe75d65cfde318046f45eb76b5965edf50027c0
-rw-r--r-- | simpleperf/test_util.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/simpleperf/test_util.cpp b/simpleperf/test_util.cpp index d93ddcd8..60d8ea35 100644 --- a/simpleperf/test_util.cpp +++ b/simpleperf/test_util.cpp @@ -85,9 +85,10 @@ bool HasHardwareCounter() { android::base::StartsWith(fingerprint, "google/sdk_gpc") || android::base::StartsWith(fingerprint, "generic/cf"); - if (arch == ARCH_X86_64 || arch == ARCH_X86_32 || is_emulator) { - // On x86 and x86_64, it's likely to run on an emulator or vm without hardware perf - // counters. It's hard to enumerate them all. So check the support at runtime. + if (arch == ARCH_X86_64 || arch == ARCH_X86_32 || !IsInNativeAbi() || is_emulator) { + // On x86 and x86_64, or when we are not in native abi, it's likely to run on an emulator or + // vm without hardware perf counters. It's hard to enumerate them all. So check the support + // at runtime. const simpleperf::EventType* type = simpleperf::FindEventTypeByName("cpu-cycles", false); CHECK(type != nullptr); perf_event_attr attr = CreateDefaultPerfEventAttr(*type); |