diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-14 00:31:44 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-06-14 00:31:44 +0000 |
commit | 95fa1350da94a3593c2ce6d84a091458e30cfaef (patch) | |
tree | 90bb3813b2e964d5e7e5c3cb42cc08f6e267240e | |
parent | de2821dfaca7b14228701f5e25de82808c85565e (diff) | |
parent | fd728c6783413a814a932a5fd7c4f140fe596786 (diff) | |
download | extras-android14-gsi.tar.gz |
Snap for 10314561 from 266aa3bf840ab8392397cb86d59a064992db966b to udc-release am: fd728c6783android14-gsi
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/extras/+/23681507
Change-Id: I6ac55c8fd4e245f88b66f02dbe6f5aafc4836c9e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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); |