summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2019-07-09 23:09:17 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-07-09 23:09:17 +0000
commit285f61dffd0d2e85402176febacc1686349891a5 (patch)
treea2201a5d1182123270bd6891a6e25fe3e9b68bae
parent73090f8e72821559d1574f4d6c2a9f696c41620e (diff)
parent9b6d49f14949eb30d9a9b5e776354f9ec99cc17e (diff)
downloadextras-285f61dffd0d2e85402176febacc1686349891a5.tar.gz
Merge "Snap for 5714901 from 233d0cacbaae51d3e30e0a75545819a4bdf56194 to pie-vts-release" into pie-vts-releaseandroid-vts-9.0_r11android-vts-9.0_r10
-rw-r--r--simpleperf/environment.h6
-rw-r--r--simpleperf/perf_clock.cpp4
2 files changed, 10 insertions, 0 deletions
diff --git a/simpleperf/environment.h b/simpleperf/environment.h
index 7f8683de..8886e470 100644
--- a/simpleperf/environment.h
+++ b/simpleperf/environment.h
@@ -23,6 +23,7 @@
#if defined(__linux__)
#include <sys/syscall.h>
#include <unistd.h>
+#include <sys/prctl.h>
#endif
#include <functional>
@@ -35,6 +36,11 @@
#include "build_id.h"
#include "perf_regs.h"
+#if defined(__ANDROID__)
+ #define PR_SET_VMA 0x53564d41
+ #define PR_SET_VMA_ANON_NAME 0
+#endif
+
std::vector<int> GetOnlineCpus();
std::vector<int> GetCpusFromString(const std::string& s);
diff --git a/simpleperf/perf_clock.cpp b/simpleperf/perf_clock.cpp
index 127470e7..127fd21d 100644
--- a/simpleperf/perf_clock.cpp
+++ b/simpleperf/perf_clock.cpp
@@ -70,6 +70,10 @@ static void ThreadA(ThreadArg* thread_arg) {
}
array[i].end_system_time_in_ns = GetSystemClock();
+
+#if defined(__ANDROID__)
+ prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, array[i].mmap_start_addr, 4096, "anony_map_region");
+#endif
}
size_t best_index = 0;
uint64_t min_duration_in_ns = UINT64_MAX;